comp.lang.ada
 help / color / mirror / Atom feed
From: "SteveD" <nospam_steved94@attbi.com>
Subject: Re: On functions and access types.
Date: Thu, 27 Jun 2002 01:29:47 GMT
Date: 2002-06-27T01:29:47+00:00	[thread overview]
Message-ID: <eUtS8.328969$cQ3.19883@sccrnsc01> (raw)
In-Reply-To: eFrS8.4786$Uu2.750@sccrnsc03

"Caffeine Junky" <nospam@hotmail.com> wrote in message
news:eFrS8.4786$Uu2.750@sccrnsc03...
[snip]
> Now the compiler tells me that I cannot assign to an 'in' parameter.
> However, as I understand it, a function can only take an 'in' parameter.
> I can copy S to a stack which is local to the function, but results in
> the function only returning the last item in the stack.
...
> If I use a procedure, it works fine. But I run into problems whenever I
> try to use similiar acess types into a function.
>
> I'm definitely overlooking something here. Probably something obvious.
> I'll continue to search through my book for an answer, but any pointers
> or references would be appreciated.

The only thing you're overlooking is the philosophy that functions should
not change the state of the system.  By modifying their parameters for
example.

The concept of not permitting "out" or "in out" parameters to functions has
been debated in this group many times.

>
> Now, eventually I changed this to a procedure for the sake of expediancy.
> But I'm continuing to work on the problem.
>
That's the right answer anyway.

SteveD

>
> Thanks for your patience.
>
> Staple





  parent reply	other threads:[~2002-06-27  1:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-26 22:57 On functions and access types Caffeine Junky
2002-06-27  0:25 ` Robert A Duff
2002-06-27  2:33   ` Ted Dennison
2002-06-27  1:29 ` SteveD [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-27  7:36 Grein, Christoph
replies disabled

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