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,154942e4f1d1b8e9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!130.59.10.21.MISMATCH!kanaga.switch.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!cern.ch!news From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Dynamically tagged expression required Date: Mon, 12 Dec 2005 10:44:22 +0100 Organization: CERN - European Laboratory for Particle Physics Message-ID: References: <2852224.m2vuDFxfOX@linux1.krischik.com> <4718553.l2jsoQ7pK7@linux1.krischik.com> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sunnews.cern.ch 1134380661 18667 (None) 137.138.37.241 X-Complaints-To: news@sunnews.cern.ch User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Red Hat/1.7.12-1.1.3.2.SL3 X-Accept-Language: en-us, en In-Reply-To: <4718553.l2jsoQ7pK7@linux1.krischik.com> Xref: g2news1.google.com comp.lang.ada:6846 Date: 2005-12-12T10:44:22+01:00 List-Id: Martin Krischik wrote: >>OK, so that explains why it's possible to use Shape'Class as a parameter >>in subroutine. Every time the subroutine is called, the parameter is >>*initialized* with the value, and therefore it can be different for each >>call: >> >>procedure Draw(S : Shape'Class); > > You know this procedure won't dispatch? Yes, I want to dispatch *inside* it. I treat it as a more or less equivalent to this in C++: void draw(Shape const &s); (by more or less equivalent I mean that I'm likely to use them in the same design situations, not that they produce the same machine code, even if they do) >>T : Triangle; >>R : Rectangle; >> >>and later: >> >>Draw(T); -- S initialized with T >>Draw(R); -- S initialized with R >> >>Right? > > Yes. But it only look like the parameter is initialized. Internally the > compiler likely to use a pointer to pass the paramer to speed up things. I don't care. :) I don't want to call something a "pointer" when it isn't in my program. > Remember "in" parameter are also constant. Yes. > Once the variable is initialized it becomes constained - you can only > assigned object of the same constain to them. > > Simpler example: > > declare > Text : String := "Hello"; - (A) > begin > Text := "World" - (B) > Text := "World!" - (C) > end It makes sense now. Thank you for all the responses, -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/