TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
"W. Wesley Groleau (Wes)" <[log in to unmask]>
Tue, 6 May 1997 12:13:53 EST
text/plain (38 lines)
The confusion only confirms my original point (please reply to team-ada
instead of chat--I moved the thread to chat by mistake).  (or don't reply)

IF "the function and the local variables it declares" were at the same level
(they are not) then the compiler would have to flag the declaration as an
illegal re-declaration.

:> The only part of the code I found curious was that I thought the compiler
:> would flag the line:
:> return (Sybelle => Puzzling.Sybelle);
:> as ambiguous since it isn't clear whether it was a recursive function call
:> or a reference to Puzzling's local variable, Sybelle, since I felt the function
:> and the local variables it declares were at the same syntactic level and
:> consequently the local variable should not have been chosen over the function
:> call.
:> > :>     [snip]
:> > :>
:> > :>   Sybelle: Integer;
:> > :>
:> > :>   function Puzzling return Rodriguez is
:> > :>     Sybelle: Integer := 0;    -- <-- NOT an illegal redeclaration
:> > :>   begin
:> > :>     return (Sybelle => Puzzling.Sybelle);
:> > :>   end Puzzling;
:> > :>
:> > :> [snip]

W. Wesley Groleau (Wes), Hughes Defense Communications, Fort Wayne, IN  USA
         w w g r o l  at  p s e s e r v 3  dot  f w  dot  h a c  dot  c o m

SPAM should be sent to   [log in to unmask]
If you don't want to be prosecuted under 47 USC 227, don't send it here.