comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: [No_Elaboration_Code] GNAT still generating rep_to_pos, why?
Date: 04 Jan 2004 12:26:11 +0000
Date: 2004-01-04T12:26:11+00:00	[thread overview]
Message-ID: <x7vd69z528s.fsf@smaug.pushface.org> (raw)
In-Reply-To: pan.2004.01.03.12.20.22.494534@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk

"Luke A. Guest" <laguest@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk> writes:

> > I'm not familiar with System'To_Address .. neater than the
> > Storage_Elements version, but more difficult to grep for in the
> > source!
> 
> Well, the difference is that System.Storage_Elements.To_Address is a
> function call and System'To_Address isn't. So with the latter, you
> get a nice static initialisation, which is what is really required
> in this case.

This is a GNAT attribute, I see.

   The System'To_Address (System is the only permissible prefix)
   denotes a function identical to System.Storage_Elements.To_Address
   except that it is a static attribute. This means that if its
   argument is a static expression, then the result of the attribute
   is a static expression. The result is that such an expression can
   be used in contexts (e.g. preelaborable packages) which require a
   static expression and where the function call could not be used
   (since the function call is always non-static, even if its argument
   is static).

> As for grepping, this works for me: grep -r System\'To\_Address *

No, I meant that you can't grep system.ads, so if you are thinking to
yourself "I know there's a To_Address function somewhere ..." you have
a long search ahead of you!

-- 
Simon Wright                               100% Ada, no bugs.



  reply	other threads:[~2004-01-04 12:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-02 11:59 [No_Elaboration_Code] GNAT still generating rep_to_pos, why? Luke A. Guest
2004-01-02 17:51 ` Stephen Leake
2004-01-02 18:14   ` Luke A. Guest
2004-01-02 19:31     ` Per Sandberg
2004-01-02 19:46       ` Luke A. Guest
2004-01-02 21:17     ` Stephen Leake
2004-01-02 22:16       ` Luke A. Guest
2004-01-03  1:43         ` Stephen Leake
     [not found]         ` <87ekuhe5wq.fsf@news.sdbk.de>
2004-01-03  9:58           ` Luke A. Guest
2004-01-03  8:44       ` Luke A. Guest
2004-01-03  1:12     ` Robert I. Eachus
2004-01-03  8:41       ` Luke A. Guest
2004-01-03 11:53         ` Simon Wright
2004-01-03 12:20           ` Luke A. Guest
2004-01-04 12:26             ` Simon Wright [this message]
2004-01-03  1:41 ` sk
2004-01-03  2:29   ` Luke A. Guest
2004-01-03 10:48 ` Florian Weimer
2004-01-03 11:32   ` Luke A. Guest
2004-01-03 13:11     ` Florian Weimer
replies disabled

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