From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Real syntax problems in Ada
Date: Wed, 29 Aug 2012 08:58:59 +0200
Date: 2012-08-29T08:58:59+02:00 [thread overview]
Message-ID: <a7fajtasftcd.wpdq5ukic2ny.dlg@40tude.net> (raw)
In-Reply-To: k1jdol$id7$1@munin.nbi.dk
On Tue, 28 Aug 2012 16:38:26 -0500, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:1w3xr2kbz8a19$.wpfoz4p1j1sb.dlg@40tude.net...
>> On Tue, 28 Aug 2012 08:14:15 -0700 (PDT), Adam Beneschan wrote:
> ...
>> Speaking of generics, the formal parameter declarations could be more
>> regular:
>>
>> generic
>> type T ...;
>> Object : T;
>>
>> but
>>
>> generic
>> with procedure Foo ...;
>> with package Bar ...;
>>
>> From formal part one could expect following the pattern:
>>
>> <name> : <type> [:= <default>]
>>
>> On the other hand, it is also clear why one would like to keep it visually
>> different from the signature of a subprogram.
>
> It's not a case of "liking"; without the "with", the syntax would be
> ambiguous, as a generic unit can be a subprogram. And remember that Ada is
> technically free-form, so the indentation and line-endings are irrelevant.
> So
> generic
> function Foo...
> ...
No, I meant rather this:
generic package P (Foo : function return Integer; Q : package...) is ...
instead of
generic
with function Foo return Integer;
with package Q ...;
package P is ...
The problem with that could be distinguishing generic and non-generic
signatures of generic subroutines:
generic procedure Baz (X : Integer);
Is X here a generic formal object or a plain argument of Baz?
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2012-08-29 6:58 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-28 8:13 Real syntax problems in Ada Dmitry A. Kazakov
2012-08-28 10:20 ` Georg Bauhaus
2012-08-28 10:47 ` Niklas Holsti
2012-08-28 11:33 ` J-P. Rosen
2012-08-31 13:35 ` Robert A Duff
2012-08-28 13:27 ` Vasiliy Molostov
2012-08-28 15:23 ` Dmitry A. Kazakov
2012-08-28 20:18 ` Vasiliy Molostov
2012-08-29 7:25 ` Dmitry A. Kazakov
2012-08-29 10:47 ` Vasiliy Molostov
2012-08-29 11:58 ` Dmitry A. Kazakov
2012-08-30 17:38 ` Vasiliy Molostov
2012-08-28 15:14 ` Adam Beneschan
2012-08-28 16:18 ` J-P. Rosen
2012-08-28 16:39 ` Dmitry A. Kazakov
2012-08-28 21:38 ` Randy Brukardt
2012-08-29 6:58 ` Dmitry A. Kazakov [this message]
2012-08-29 10:43 ` stefan-lucks
2012-08-29 10:58 ` stefan-lucks
2012-08-29 13:14 ` Niklas Holsti
2012-08-29 17:52 ` stefan-lucks
[not found] ` <fbps38pgcuf8fgioptt39s6u7dme1aqs7r@invalid.netcom.com>
2012-09-02 10:16 ` svaa
2012-08-29 13:33 ` Georg Bauhaus
2012-08-29 17:20 ` Jeffrey Carter
2012-08-29 17:51 ` stefan-lucks
2012-08-30 9:12 ` Georg Bauhaus
2012-08-28 21:49 ` Randy Brukardt
2012-08-28 23:09 ` Adam Beneschan
2012-08-29 7:34 ` Egil Høvik
2012-08-28 19:41 ` Florian Weimer
2012-08-28 20:53 ` Shark8
2012-08-28 21:07 ` Adam Beneschan
2012-08-28 21:25 ` Shark8
2012-08-28 22:59 ` Adam Beneschan
2012-08-29 7:06 ` Dmitry A. Kazakov
2012-08-30 21:08 ` Randy Brukardt
2012-08-30 22:06 ` sbelmont700
2012-08-30 22:34 ` Adam Beneschan
2012-08-30 22:54 ` William Findlay
2012-08-31 7:39 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox