comp.lang.ada
 help / color / mirror / Atom feed
From: Martin <martin@thedowies.com>
Subject: Re: Ada202X : Adding functors
Date: Tue, 13 Nov 2012 04:35:05 -0800 (PST)
Date: 2012-11-13T04:35:05-08:00	[thread overview]
Message-ID: <8332147c-e574-4970-9b88-5bc27546c42f@googlegroups.com> (raw)
In-Reply-To: <50a224b0$0$9523$9b4e6d93@newsspool1.arcor-online.net>

On Tuesday, November 13, 2012 10:45:05 AM UTC, Georg Bauhaus wrote:
> On 13.11.12 00:19, Martin wrote:
> 
> > I don't think it would need to extend to existing code or to explicit calls, only to functors - would that be more acceptable?
> 
> 
> 
> But is adding syntactic implicitness of ?() enough?
> 
> 
> 
> Isn't there more about "functors"? And if so, wouldn't Ada
> 
> generics have to become "more recursive" so as to get all the
> 
> benefits of using "functors" in a generalized and checked fashion?
> 
> 
> 
> http://www.catonmat.net/blog/on-functors/
> 
> 
> 
> (Otherwise, overloading "()" just looks like catering to those who
> 
> write programs in a style that is between lazy (avoiding names) and
> 
> obfuscating.)

I would have no problems with an attempt to make Ada Generics more 'recursive' as you put it...I'm finding a lot of milage in some of C++ templates.

One mod could be for generics to say that a generic type parameter could be specified in terms of an interface type but that actual parameter need not be derived from that same interface type - providing that it met the contract of the interface type(s), i.e. allow Duck-ish Typing for interface types.

It isn't Duck Typing, as the generic still has the contract...but I think it could open up Ada generics to some interesting (and still safe...I think! The compiler would still have to check the instantiation) directions...

I'm thinking out loud on this one... :-)

-- Martin



  parent reply	other threads:[~2012-11-13 12:35 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 22:09 Ada202X : Adding functors Martin
2012-11-12 23:14 ` Jeffrey Carter
2012-11-12 23:19   ` Martin
2012-11-13 10:45     ` Georg Bauhaus
2012-11-13 12:08       ` Yannick Duchêne (Hibou57)
2012-11-13 12:35       ` Martin [this message]
2012-11-12 23:44 ` Adam Beneschan
2012-11-13  2:11   ` Jeffrey Carter
2012-11-13 11:11   ` Martin
2012-11-14  0:51     ` Adam Beneschan
2012-11-14  8:39       ` Martin
2012-11-14 16:54         ` Adam Beneschan
2012-11-14 18:54           ` Martin
2012-11-14 20:37           ` Dmitry A. Kazakov
2012-11-14 20:57             ` Shark8
2012-11-14 21:31             ` Martin
2012-11-14 22:42               ` Adam Beneschan
2012-11-15  9:27               ` Dmitry A. Kazakov
2012-11-14 21:45             ` Simon Wright
2012-11-14 22:22               ` Martin
2012-11-14 22:27               ` Martin
2012-11-13  4:22 ` Shark8
2012-11-15  0:20 ` sbelmont700
2012-11-15  7:12   ` Martin
2012-11-15 12:21     ` Georg Bauhaus
2012-11-15 12:31     ` Georg Bauhaus
2012-11-15 12:46       ` Martin
2012-11-16  6:15       ` Randy Brukardt
2012-11-15 10:11   ` Dmitry A. Kazakov
2012-11-15 15:52     ` Peter C. Chapin
2012-11-15 17:04       ` Dmitry A. Kazakov
2012-11-15 19:57         ` Georg Bauhaus
2012-11-15 20:39           ` Dmitry A. Kazakov
2012-11-16  0:15             ` Peter C. Chapin
2012-11-16 10:12               ` Georg Bauhaus
2012-11-16  0:01         ` Peter C. Chapin
2012-11-16  6:09           ` Randy Brukardt
2012-11-16 12:35             ` Peter C. Chapin
2012-11-16 18:10               ` Martin
2012-11-16  8:59           ` Dmitry A. Kazakov
2012-11-16 12:20             ` Peter C. Chapin
2012-11-16 17:44               ` Dmitry A. Kazakov
2012-11-18 15:58                 ` Peter C. Chapin
2012-11-15 21:34     ` sbelmont700
replies disabled

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