comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada202X : Adding functors
Date: Thu, 15 Nov 2012 18:04:42 +0100
Date: 2012-11-15T18:04:42+01:00	[thread overview]
Message-ID: <r00q8we9dpjp.1410izlwuflo3$.dlg@40tude.net> (raw)
In-Reply-To: NLWdnUlRH6U-kjjN4p2dnAA@giganews.com

On Thu, 15 Nov 2012 10:52:02 -0500, Peter C. Chapin wrote:

> On 11/15/2012 05:11 AM, Dmitry A. Kazakov wrote:
> 
>>> IMHO, lambda closures are better in every way than a 'functor', and I for
>>> one would welcome their addition to Ada.
>>
>> I doubt that could be made compatible with static typing. Comparing
>> advantages of both static typing is a clear winner.
>>
>> But it is of course an interesting question how much functions could be
>> made first class citizens without loosing safety (and proper typing).
> 
> Could you elaborate on what you mean here? There are statically typed 
> functional languages where functions are first class and that also have 
> a reasonable notion of type safety.

I think they are actually weakly typed. Nobody would admit that easily, I
would not wonder if Forth people claimed it statically typed as well. (:-))

Anyway, the issue is that functions are intimately related to the types of
their arguments and results as primitive operations. Non-first class
functions are singletons which ensures 1-1 mapping between the operation
and the argument/result type. First-class functions would break that
correspondence. They could be seen as "free functions" regarding their
arguments/result, of course. But, again, there are good reasons why all
operations should be primitive and none free. Yes, Ada violates that rule
and this is a problem already.

It is also unclear what happens with the operations defined on functional
objects. What will be the types of function functions (functionals)? It is
an infinite recursion of higher-order functions to stop somewhere.

Maybe somebody could sort that out, maybe not. In any case there are enough
troubles without that. And I personally find functional decomposition bad.
Georg already posted a quite disgusting example of how it could look like.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-11-15 17:04 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
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 [this message]
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