comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Pop function
Date: Thu, 15 Dec 2011 12:43:11 +0000
Date: 2011-12-15T12:43:11+00:00	[thread overview]
Message-ID: <m2ty5280ps.fsf@pushface.org> (raw)
In-Reply-To: 31100824.174.1323919653265.JavaMail.geo-discussion-forums@yqcs5

"Rego, P." <pvrego@gmail.com> writes:

> Ok. So it would be like
>
>    procedure Pop (Sender : in out T_List_Ptr;
>                   T_Item : out Integer) is
> 	  Previous_Sender : T_List_Ptr;
[...]
> but in this case I could not call 
>    Some_Obj : access T_List;
>    Other_Int : Integer;
>    ...
>    Other_Int := Some_Obj.Pop;
> because Pop is not a primitive of T_List. The notation Some_Obj.Pop
> would be just sintatic sugar, but would exist a way we can implement
> Pop for using with this? (but sure...that's also ok for the non-sugar
> case)

I don't see why Pop takes T_List_Ptr as an argument. I would have
written

    procedure Pop (Sender : in out T_List;
                   T_Item : out Integer) is

and then it would be primitive (assuming T_List is tagged).

And why is the parameter called Sender? that sounds like a name in the
domain of the problem you're trying to solve, rather than in the domain
of popping an item from a List. Maybe From would be better.

And how come a List has an operation Pop? sounds more like a Stack or a
Queue.



  reply	other threads:[~2011-12-15 12:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15  0:06 Pop function Rego, P.
2011-12-15  0:29 ` Martin Dowie
2011-12-15  1:23   ` Rego, P.
2011-12-15  2:08   ` Adam Beneschan
2011-12-15 22:59     ` Martin Dowie
2011-12-16 10:27       ` georg bauhaus
2011-12-15  0:34 ` Jeffrey Carter
2011-12-15  1:35   ` Rego, P.
2011-12-15  2:55     ` Alex Mentis
2011-12-15  3:00       ` Alex Mentis
2011-12-15  3:00     ` Jeffrey Carter
2011-12-15  3:41       ` Rego, P.
2011-12-15  8:38   ` Dmitry A. Kazakov
2011-12-15 19:57     ` Jeffrey Carter
2011-12-15 20:15       ` Dmitry A. Kazakov
2011-12-15 21:02         ` Simon Wright
2011-12-15 21:25           ` Jeffrey Carter
2011-12-16  8:23           ` Dmitry A. Kazakov
2011-12-16  0:31       ` Randy Brukardt
2011-12-15  2:06 ` Adam Beneschan
2011-12-15  3:27   ` Rego, P.
2011-12-15 12:43     ` Simon Wright [this message]
2011-12-15 15:54       ` Adam Beneschan
2011-12-15 18:34         ` Simon Wright
2011-12-15 19:14           ` Dmitry A. Kazakov
2011-12-15 16:14     ` Adam Beneschan
2011-12-28 13:04       ` Rego, P.
replies disabled

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