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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,11414a19b0e4a97a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe16.iad.POSTED!1d9d5bd3!not-for-mail From: David Thompson Newsgroups: comp.lang.ada Subject: Re: Advice on selling Ada to a C shop Organization: Poor Message-ID: References: <101bf8f3-b823-45ee-9afd-40cbafb4b7a9@t26g2000prt.googlegroups.com> <774c25c4-3270-4ffb-ad19-366a0ab16659@i31g2000yqm.googlegroups.com> X-Newsreader: Forte Agent 3.3/32.846 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Tue, 06 Jul 2010 05:36:59 UTC Date: Tue, 06 Jul 2010 01:37:29 -0400 Xref: g2news2.google.com comp.lang.ada:13181 Date: 2010-07-06T01:37:29-04:00 List-Id: On Tue, 22 Jun 2010 22:39:51 -0700, Dennis Lee Bieber wrote: > On Tue, 22 Jun 2010 18:01:50 +0000 (UTC), anon@anon.org declaimed the > following in comp.lang.ada: > > > A second problem is until Ada 2012, C is the only common used language > > that allows functions to have "in out" type of parameters. If functions > > having the "in out" parameters, was a good idea, you would think then > > other older languages like Fortran, Pascal would have them. Or even > > Uhm... The last time I worked FORTRAN (about a decade ago), > functions COULD have side-effects. After all, the normal passing method > in FORTRAN is by-reference, and I never encountered a compiler that > would enforce read-only access to arguments inside a function. Now, > maybe post '90/'95 standard have implemented such -- but I'd bet most > shops are still running a compatibility option for older code... Indeed. Classic Fortran did, and F90+ still does by default (i.e. INTENT unspecified) or if you specify INTENT OUTor INOUT. Only if you explicitly make a subprogram PURE or ELEMENTAL then a function, but not a subroutine, is prohibited from having modifiable arguments. (Both a function and subroutine are prohibited from other 'global' side-effects, i.e. on module~package data or external files.) So did Pascal if you specify VAR, a68 with ref, and COBOL and PL/I always. anon may argue that some of those are not now 'common[ly] used', but Java certainly is and makes all nonprimitive arguments writable references; there's not even a syntax to make a reference readonly -- although you can write a target object, or a wrapper or adapter etc., to be readonly (always or controllably) and some important standard objects like java.lang.String are immutable. And C++ of course, but that's arguably covered under C. It does have added syntax for references (and OO 'this') but same semantics.