comp.lang.ada
 help / color / mirror / Atom feed
From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: reference to a name variable
Date: Thu, 23 Jul 2009 13:02:25 -0700 (PDT)
Date: 2009-07-23T13:02:25-07:00	[thread overview]
Message-ID: <2c3059c2-e454-4746-9abe-ae9a12867169@b15g2000yqd.googlegroups.com> (raw)
In-Reply-To: 9129a8e6-1aba-430c-bfbc-3154026697b8@i18g2000pro.googlegroups.com

Hello Pablo,

What you are looking for seems to be a kind of metaprogramming,
something like handling the code as if it was data (Lisp back once
again in the Ada world ?)

I do not know any built-in of this kind in Ada, so I will suggest to
design the application so that variables which would have to be
accessible this way, would be registered in a list of string <->
access associations (just an example implementation, and standard Ada
containers would be well suited here).

You may also think about a kind of simple interpreter for your input
and create an interpretation function in the application. If the input
language is as simple as a set of string interpreted as requests for
some value, you may have a function taking a string as argument and
returning either a reference to an object an explicitely typed value.

If you need this kind of access for introspection, then perhaps access
to debug informations would be nice.

This is all providing I've undertood what you want (if not, I
apologize)

Why do you need this explicitely ? Most of time, solving something
requires to solve an initial requirement not to solve a derivative
problem which is temporaly supposed to be a solution (that's the
reason of the latter question).

Best wishes for your project



  reply	other threads:[~2009-07-23 20:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23 19:08 reference to a name variable Pablo
2009-07-23 20:02 ` Hibou57 (Yannick Duchêne) [this message]
2009-07-23 20:26   ` Dmitry A. Kazakov
2009-07-24 11:03 ` Stephen Leake
2009-07-28 13:51   ` Chrono
2009-07-28 18:25     ` Ludovic Brenta
2009-07-30 14:37       ` Chrono
replies disabled

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