Groups | Search | Server Info | Login | Register


Groups > comp.lang.ada > #49646

Re: On absurdity of collections 7.6.1 (11.1/3)

From "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Newsgroups comp.lang.ada
Subject Re: On absurdity of collections 7.6.1 (11.1/3)
Date 2021-09-29 13:20 +0200
Organization Aioe.org NNTP Server
Message-ID <sj1i6g$7hv$1@gioia.aioe.org> (permalink)
References <sj1ah7$7kr$1@gioia.aioe.org> <lybl4bbq19.fsf@pushface.org>

Show all headers | View raw


On 2021-09-29 13:05, Simon Wright wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> 
>>        type Item_Ptr is access all Item;
>>        function New_Item
>>                 (  Pool : in out Root_Storage_Pool'Class;
>>                    Text : String
>>                 )  return Item_Ptr;
> 
> What I don't see is how you can implement this, never mind any other
> problems.

A naive, but wrong due to 7.6.1 (11.1/3) nonsense, implementation would be:

      function New_Item
               (  Pool : in out Root_Storage_Pool'Class;
                  Text : String
               )  return Item_Ptr is
         type Ptr is access Item;
         for Ptr'Storage_Pool use Pool;
         Object : Ptr := new Item (Text'Length);
      begin
         Object.Text := Text;
         return Object.all'Unchecked_Access;
      end New_Item;

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

Back to comp.lang.ada | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-29 11:09 +0200
  Re: On absurdity of collections 7.6.1 (11.1/3) Simon Wright <simon@pushface.org> - 2021-09-29 12:05 +0100
    Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-29 13:20 +0200
      Re: On absurdity of collections 7.6.1 (11.1/3) Simon Wright <simon@pushface.org> - 2021-09-29 22:38 +0100
        Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-30 10:07 +0200
          Re: On absurdity of collections 7.6.1 (11.1/3) Simon Wright <simon@pushface.org> - 2021-09-30 09:35 +0100
            Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-30 10:49 +0200
          Re: On absurdity of collections 7.6.1 (11.1/3) "Randy Brukardt" <randy@rrsoftware.com> - 2021-09-30 20:37 -0500
            Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-10-01 09:57 +0200
      Re: On absurdity of collections 7.6.1 (11.1/3) "Randy Brukardt" <randy@rrsoftware.com> - 2021-09-29 19:23 -0500
        Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-30 10:06 +0200
  Re: On absurdity of collections 7.6.1 (11.1/3) "G.B." <bauhaus@notmyhomepage.invalid> - 2021-09-30 20:23 +0200
    Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-09-30 20:52 +0200
      Re: On absurdity of collections 7.6.1 (11.1/3) "Randy Brukardt" <randy@rrsoftware.com> - 2021-09-30 20:40 -0500
        Re: On absurdity of collections 7.6.1 (11.1/3) "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-10-01 09:57 +0200

csiph-web