From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7e021fc0e7fc15a1 X-Google-Attributes: gid103376,public From: robert_dewar@my-dejanews.com Subject: Re: Ada 95 LRM Error? Date: 1999/01/29 Message-ID: <78seia$f03$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 438296526 References: <36AF6C22.896FC5B8@easystreet.com> <78oaj9$d9g@sjx-ixn5.ix.netcom.com> <36AFC42A.57696F4D@easystreet.com> <78qsvv$pim@dfw-ixnews10.ix.netcom.com> X-Http-Proxy: 1.0 x3.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Fri Jan 29 13:54:23 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-01-29T00:00:00+00:00 List-Id: In article <78qsvv$pim@dfw-ixnews10.ix.netcom.com>, Richard D Riehle wrote: > COBOL is not a strongly-typed language. Well ... We need to be careful in the Ada community to distinguish between the notion of strong typing, and the facilities for declaring types. COBOL is definitely strongly typed, and the typing rules will prevent (for example) doing arithmetic on non-arithmetic items. What Richard means is that the typing capabilities of COBOL are weak in the ordinary English sense of the word, but this is not the same as weak typing in the technical sense. C is also a strongly typed language in this technical sense, but again, the facilities for declaring types are poor, and for example, C chooses to make int and char the same type, just as Ada chooses to make natural and integer the same type. When people say that Ada is strongly typed, they mean two things: 1. It has a semantic notion of typing at compile time, with static type checking. 2. It has a well developed typing system, that allows the programmer to easily create types that take advantage of 1. It is actually 2 that is the really important issue in Ada, and indeed I am happy for people to call that strong typing, but it is important to realize that saying "language X is not strongly typed" in language wars discussions may cause confusion of the 1. vs 2. type above, and it is good to understand this source of confusion, so that discussions do not get confused. > There are, of course, data types in the form of PICTURE > characters, but a COBOL programmer has great latitude in > performing operations that mix alphanumeric numbers > and ordinary alphanumeric characters. > > 05 Some-Number PICTURE S99V99 USAGE DISPLAY. > 05 Some-String PICTURE 9(6). > > We may freely MOVE (actually MOVE means "copy") the > numeric data to the string data without regard to the > typing. That's a bit misleading. Such a move is *only* valid if the sending field contains only digits (this is for instance clear from figure 49 of the ANSI 77 standard). A move where other than digits are moved is what Ada programmers would call erroneous. Still, the point that Richard is making, which is that this is not checked at compile time, is valid, and I think it quite appropriate that the COBOL interface of Ada not try to enforce compile time restrictions which would not exist in a normal COBOL environment (there are plenty of "erroneous" COBOL programs in the world :-) Robert Dewar -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own