comp.lang.ada
 help / color / mirror / Atom feed
* Constructor functions and extension aggregate
@ 2008-03-12 13:37 Maciej Sobczak
  2008-03-12 13:50 ` christoph.grein
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej Sobczak @ 2008-03-12 13:37 UTC (permalink / raw)


Consider:

http://www.adacore.com/2007/10/01/ada-gem-11/

The constructor function P.Make_T has:

   return (Name => To_Unbounded_String (Name), others => <>);

Shouldn't it be rather:

   return (Ada.Finalization.Limited_Controlled with
      Name => To_Unbounded_String (Name));

?

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Constructor functions and extension aggregate
  2008-03-12 13:37 Constructor functions and extension aggregate Maciej Sobczak
@ 2008-03-12 13:50 ` christoph.grein
  2008-03-12 15:02   ` Robert A Duff
  0 siblings, 1 reply; 3+ messages in thread
From: christoph.grein @ 2008-03-12 13:50 UTC (permalink / raw)


On 12 Mrz., 14:37, Maciej Sobczak <see.my.homep...@gmail.com> wrote:
> Consider:
>
> http://www.adacore.com/2007/10/01/ada-gem-11/
>
> The constructor function P.Make_T has:
>
>    return (Name => To_Unbounded_String (Name), others => <>);
>
> Shouldn't it be rather:
>
>    return (Ada.Finalization.Limited_Controlled with
>       Name => To_Unbounded_String (Name));

Most probably you're right. However the theme of this gem was how to
use constructor functions for limited type, not how to implement them.
Thus this must be an oversight of the author. I guess he even should
have said:

    return (Ada.Finalization.Limited_Controlled with
            Name => To_Unbounded_String (Name), others => <>);




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Constructor functions and extension aggregate
  2008-03-12 13:50 ` christoph.grein
@ 2008-03-12 15:02   ` Robert A Duff
  0 siblings, 0 replies; 3+ messages in thread
From: Robert A Duff @ 2008-03-12 15:02 UTC (permalink / raw)


christoph.grein@eurocopter.com writes:

> On 12 Mrz., 14:37, Maciej Sobczak <see.my.homep...@gmail.com> wrote:
>> Consider:
>>
>> http://www.adacore.com/2007/10/01/ada-gem-11/
>>
>> The constructor function P.Make_T has:
>>
>> � �return (Name => To_Unbounded_String (Name), others => <>);
>>
>> Shouldn't it be rather:
>>
>> � �return (Ada.Finalization.Limited_Controlled with
>> � � � Name => To_Unbounded_String (Name));
>
> Most probably you're right. However the theme of this gem was how to
> use constructor functions for limited type, not how to implement them.
> Thus this must be an oversight of the author. I guess he even should
> have said:
>
>     return (Ada.Finalization.Limited_Controlled with
>             Name => To_Unbounded_String (Name), others => <>);

Yes, that's what I meant.

- Bob



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-12 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-12 13:37 Constructor functions and extension aggregate Maciej Sobczak
2008-03-12 13:50 ` christoph.grein
2008-03-12 15:02   ` Robert A Duff

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