Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: Access keyw...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 20 of 24 Topic 5675 of 5827
Post > Topic >>

Re: Access keyword

by "Randy Brukardt" <randy@[EMAIL PROTECTED] > Apr 30, 2008 at 06:40 PM

"Adam Beneschan" <adam@[EMAIL PROTECTED]
> wrote in message
news:2cc577f4-704a-4235-aad4-a29186309c02@[EMAIL PROTECTED]
> On Apr 30, 12:15 am, Maciej Sobczak <see.my.homep...@[EMAIL PROTECTED]
> wrote:
....
> > Anonymous access types are used by Ada.Containers for iteration (among
> > others). "Rationale" by Barnes presents some nice examples with
> > downward closures as well.
>
> I suspect that Randy was talking only about anonymous access-to-object
> parameters.  Those aren't used by the language's definition of
> Ada.Containers, or at least I didn't spot any.
>
> Anonymous access-to-subprogram parameters (which Ada.Containers does
> use) are a different animal altogether.  They do serve a legitimate
> purpose; downward closures are im****tant but couldn't be done
> satisfactorily in Ada 95.

I agree with this, although the syntax is rotten.
Anonymous-access-to-subprogram parameters have special semantics and
cannot
be stored (you'll get an accessibility error if you try). So they act like
parameters that are subprograms rather than an access type. I think the
syntax is rotten because these are access types only in the sense that a
compiler will implement them this way.

I do include regular anonymous-access-to-subprogram types in the category
of
useless features.

And I do plead guilty to not opposing the expansion of this misfeature in
the Amendment hard enough. I was tem****arily swayed by arguments that they
would allow using far fewer useless type conversions. The problem is that
in
practice it is not true: you still need type conversions unless you purge
all of your named access types from the program. But then you lose the
ability to have storage pools -- a nasty trade-off. Essentially, they
don't
provide the feature that was advertised, and thus should never have been
approved.

Beyond that, I agree with Dmitry that Ada needs a real iterator construct;
passing a subprogram into another subprogram is much less understandable
than
     for Element in Container loop
         ...
     end loop;

And that would eliminate much of the need for "downward closures". (But
not
all! I don't want to get into a silly argument about that...)

                              Randy.
 




 24 Posts in Topic:
Access keyword
=?ISO-8859-1?Q?S=E9bastie  2008-04-29 13:55:17 
Re: Access keyword
Peter Hermann <ica2ph@  2008-04-29 14:35:33 
Re: Access keyword
Ludovic Brenta <ludovi  2008-04-29 07:43:18 
Re: Access keyword
stefan-lucks@[EMAIL PROTE  2008-04-29 17:16:42 
Re: Access keyword
=?ISO-8859-1?Q?S=E9bastie  2008-04-29 16:31:09 
Re: Access keyword
Gautier <gautier@[EMAI  2008-04-29 21:55:56 
Re: Access keyword
=?ISO-8859-1?Q?S=E9bastie  2008-04-30 14:26:18 
Re: Access keyword
Gautier <gautier@[EMAI  2008-04-30 19:13:23 
Re: Access keyword
Adam Beneschan <adam@[  2008-04-29 10:37:05 
Re: Access keyword
"Jeffrey R. Carter&q  2008-04-29 19:08:33 
Re: Access keyword
Maciej Sobczak <see.my  2008-04-29 14:03:18 
Re: Access keyword
"Randy Brukardt"  2008-04-29 16:32:47 
Re: Access keyword
Gautier <gautier@[EMAI  2008-04-30 06:36:16 
Re: Access keyword
Maciej Sobczak <see.my  2008-04-30 00:15:47 
Re: Access keyword
"Dmitry A. Kazakov&q  2008-04-30 09:56:44 
Re: Access keyword
Georg Bauhaus <rm.tsoh  2008-04-30 11:21:06 
Re: Access keyword
=?ISO-8859-1?Q?S=E9bastie  2008-04-30 14:32:40 
Re: Access keyword
Adam Beneschan <adam@[  2008-04-30 08:16:42 
Re: Access keyword
Adam Beneschan <adam@[  2008-04-30 08:20:17 
Re: Access keyword
"Randy Brukardt"  2008-04-30 18:40:43 
Re: Access keyword
Maciej Sobczak <see.my  2008-04-30 14:32:13 
Re: Access keyword
Adam Beneschan <adam@[  2008-04-30 14:58:41 
Re: Access keyword
Adam Beneschan <adam@[  2008-04-30 18:10:22 
Re: Access keyword
Ludovic Brenta <ludovi  2008-04-30 22:44:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 0:18:17 CDT 2008.