comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: Syntax question
Date: 11 Mar 1995 15:45:48 -0500
Date: 1995-03-11T15:45:48-05:00	[thread overview]
Message-ID: <3jt25s$dim@felix.seas.gwu.edu> (raw)
In-Reply-To: 3jrt1m$9rk@erinews.ericsson.se

In article <3jrt1m$9rk@erinews.ericsson.se>,
Geoffrey Hollingworth <etlghh@garbo.ericsson.se> wrote:

>When binding formal parameters with actual parameters the '=>'
>operator is used, irrespective of whether the formal parameter
>is declared as IN, INOUT or OUT.  Is there a reason for this ?
>If I proposed an alternative syntax where "=>" indicated the FP
>was an IN parameter, "<=" to indicate an OUT parameter and "<=>"
>to indicate an INOUT.

This is an interesting idea, but of course it's not part of the language.
The => is used as a general sort of binding operator:

- formal to actual parameters
- formal to actual discriminants (variant record tags)
- in CASE and exception handler clauses

etc.

In the first two cases, it is quite legal to omit the named association,
that is, a procedure P(X: T1; Y OUT T2; Z :IN OUT T3) can be called
using positional asociation: P(A,B,C).

The named association is very convenient in teaching about parameters,
and makes for nice readable code (IMHO, of course), but in general is
really "syntactic sugar." 

Mike Feldman
------------------------------------------------------------------------
Michael B. Feldman -  chair, SIGAda Education Working Group
Professor, Dept. of Electrical Engineering and Computer Science
The George Washington University -  Washington, DC 20052 USA
202-994-5919 (voice) - 202-994-0227 (fax) - mfeldman@seas.gwu.edu (Internet)
------------------------------------------------------------------------
One, two, three ways an underdog: Ada fan, Mac fan, Old Liberal Democrat
------------------------------------------------------------------------
Ada on the WWW: http://lglwww.epfl.ch/Ada/ or http://info.acm.org/sigada/
------------------------------------------------------------------------



  parent reply	other threads:[~1995-03-11 20:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-03-11 10:12 Syntax question Geoffrey Hollingworth
1995-03-11 15:16 ` Robert A Duff
1995-03-11 20:45 ` Michael Feldman [this message]
1995-03-15 23:29   ` David Kusuda
1995-03-16  2:25     ` David Weller
1995-03-16 14:44       ` Spencer Allain
1995-03-19  1:04       ` Robert Dewar
1995-03-16  9:19     ` Fred J. McCall
1995-03-17  5:44     ` Niklas Holsti
1995-03-19 20:53       ` Robert Dewar
1995-03-11 21:44 ` Road Pilot
1995-03-23 13:07   ` Bob Collins
1995-03-24  1:11     ` Kevin F. Quinn
1995-03-27 14:19       ` Norman H. Cohen
1995-03-13  4:43 ` Keith Thompson
1995-03-16 20:37   ` Norman H. Cohen
1995-03-21  0:51     ` Robert Dewar
1995-03-16 19:20 ` Adam Beneschan
  -- strict thread matches above, loose matches on Subject: below --
2001-07-05 17:58 Syntax Question Robby Simpson
2001-07-05 18:32 ` Marin David Condic
2001-07-05 18:38 ` Robby Simpson
2001-07-05 19:09 ` Ted Dennison
2001-07-05 20:14   ` Robby Simpson
2001-07-05 21:44 ` Robert Dewar
2001-07-09 12:39   ` Robby Simpson
     [not found] <Cx6pG3.IEp@ucc.su.oz.au>
1994-10-05 14:20 ` Syntax question Tucker Taft
     [not found]   ` <36ui0u$4dg@gnat.cs.nyu.edu>
1994-10-06  0:04     ` David Weller
1994-10-05  5:19 Adrian Cho
1994-10-05 11:52 ` Robert Dewar
1994-10-05 17:19   ` Norman H. Cohen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox