From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada202X : Adding functors
Date: Fri, 16 Nov 2012 00:09:56 -0600
Date: 2012-11-16T00:09:56-06:00 [thread overview]
Message-ID: <k84lbn$95o$1@munin.nbi.dk> (raw)
In-Reply-To: WdGdnd-Z6-nFHzjN4p2dnAA@giganews.com
"Peter C. Chapin" <pcc482719@gmail.com> wrote in message
news:WdGdnd-Z6-nFHzjN4p2dnAA@giganews.com...
> On 11/15/2012 12:04 PM, Dmitry A. Kazakov wrote:
>
>>> 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.
>
> In the functional language that I use the most (Scala) lambda terms are
> statically typed and fully checked at compile time, just like any other
> expression.
There's more to a function contract than just the type-and-result-profile!
To truly statically check such things, you also have to match the
precondition, the postcondition, the exception contract, the global in/out
usage, and so on. (Matching doesn't necessarily mean exact equivalence, of
course, which makes it even harder.)
For Ada 2012, we simply punted on these issues. But that makes
access-to-subprogram (or any sort of lambda, which would be semantically
similar to access-to-subprogram) fragile: you can get Assertion_Error from
any access-to-subprogram value, and there isn't much you can do about it.
One hopes that Ada 2020 will do better in this area, but I'm dubious that it
can be done well for access-to-subprogram (and lambdas, and formal
subprograms, all semantically similar). Complete reliance on dynamic
contracts can be useful, but it certainly isn't my idea of strong types
(that is, enforced at compile-time).
Randy.
next prev parent reply other threads:[~2012-11-16 6:10 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
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 [this message]
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