From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Alternative syntax for function definitions?
Date: Sat, 27 Oct 2012 10:37:11 +0200
Date: 2012-10-27T10:37:11+02:00 [thread overview]
Message-ID: <en1cfkh3booj$.idqhb9xfwi97.dlg@40tude.net> (raw)
In-Reply-To: op.wmtun2kuule2fv@cardamome
On Sat, 27 Oct 2012 09:49:04 +0200, Yannick Duch�ne (Hibou57) wrote:
> Le Sat, 27 Oct 2012 09:11:28 +0200, Dmitry A. Kazakov
> <mailbox@dmitry-kazakov.de> a �crit:
>>> I feel it would be the most relevant when having a list of accessors
>>> functions, like in
>>>
>>> function P1 (A : A_Type) return T1;
>>> function P2 (A : A_Type) return T2;
>>> function P3 (A : A_Type) return T3;
>>> function P4 (A : A_Type) return T4;
>>> function P5 (A : A_Type) return T5;
>>
>> The type A_Type should simply implement a record interface:
>>
>> type A_Type is ... and record
>> P1 : T1;
>> P2 : T2;
>> ...
>> P5 : T5;
>> end record;
>> ...
>> private
>> ... -- functions implementing "components" P1..P5
>
> You got the point (I was precisely thinking of functions define on private
> type, that is, the record is not exposed), but unless I missed it, there
> is nothing like a function implementing the access to a record component
> in Ada.
I know. The point is that there are underlying concepts Ada's type system
fails to capture. The language was already suffered dearly from plastic
surgeries to get another one.
> I agree that would be the best, but less likely to be done (we
> already have dotted notation for function designation, but only for tagged
> types).
That is no problem. All types should have classes anyway. The dotted
notation itself is an implementation of some record interface.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2012-10-29 2:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-27 6:30 Alternative syntax for function definitions? Yannick Duchêne (Hibou57)
2012-10-27 7:11 ` Dmitry A. Kazakov
2012-10-27 7:49 ` Yannick Duchêne (Hibou57)
2012-10-27 8:37 ` Dmitry A. Kazakov [this message]
2012-10-27 9:02 ` Yannick Duchêne (Hibou57)
2012-10-27 9:38 ` Bill Findlay
2012-10-27 11:13 ` Yannick Duchêne (Hibou57)
2012-10-27 23:46 ` Bill Findlay
2012-10-27 9:50 ` 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