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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f28dd1d63a9466b2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-11 13:00:08 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!Germany.EU.net!EU.net!uunet!gwu.edu!gwu.edu!not-for-mail From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: Syntax question Date: 11 Mar 1995 15:45:48 -0500 Organization: George Washington University Message-ID: <3jt25s$dim@felix.seas.gwu.edu> References: <3jrt1m$9rk@erinews.ericsson.se> NNTP-Posting-Host: 128.164.9.3 Keywords: help syntax Date: 1995-03-11T15:45:48-05:00 List-Id: In article <3jrt1m$9rk@erinews.ericsson.se>, Geoffrey Hollingworth 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/ ------------------------------------------------------------------------