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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dab7d920e4340f12 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,dab7d920e4340f12 X-Google-Attributes: gid1014db,public From: Lawrence Kirby Subject: Re: Ada is 'better' than C because... Date: 1996/08/12 Message-ID: <839880484snz@genesis.demon.co.uk>#1/1 X-Deja-AN: 173778272 x-nntp-posting-host: genesis.demon.co.uk references: <01bb7bf9$b89a1740$96ee6fcf@timhome2> <4un7j3$m9g@ursa.smsu.edu> x-mail2news-path: genesis.demon.co.uk organization: none reply-to: fred@genesis.demon.co.uk newsgroups: comp.lang.ada,comp.lang.c Date: 1996-08-12T00:00:00+00:00 List-Id: In article <4un7j3$m9g@ursa.smsu.edu> aho450s@nic.smsu.edu "OBryan Anthony H" writes: >William Clodius (clodius@hotspec.lanl.gov) wrote: > >: Not quite. First when passed as an argument to a user defined function >: a C array looses a lot of its distinction from a pointer, a problem >: that many other languages do not have. Second, while (almost?) all > > I have a hard time seeing this as a problem. It's one of the fantastic >advantages of the C language. An array of any given type can be passed >to a user function and treated as an array of any other integral type, >converted, processed, etc. in any manner the programmer desires. However the results of doing so are not predictable from the language so it is rarely if ever a useful thing to do (viewing objects specifically as an array of char, or better still unsigned char is sometimes useful). >: additional capabilities that C arrays lack, the ability to specify >: array shape in arguments (Fortran I), and various forms of whole array >: operations, APL, PL/I, Algol 68, and Fortran 90. > >What do you mean by array shape? C is fully capable of performing whole >array operations. The capability is not embedded in the language, as C >is designed to provide only the bare necessicities for program >development with all else being provided in function extensions, but the >language itself allows for anything a machine is capable of doing. As are most other languages. However some operations are much easier to express in some languages than others. If you want to perform a whole array operation then that will clearly be very easy in a language that supports appropriate whole array operations directly. -- ----------------------------------------- Lawrence Kirby | fred@genesis.demon.co.uk Wilts, England | 70734.126@compuserve.com -----------------------------------------