From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,6085ae1d74309e83 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!feeder.news-service.com!news2.euro.net!newsfeed.freenet.de!news.teledata-fn.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: reference to a name variable Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <9129a8e6-1aba-430c-bfbc-3154026697b8@i18g2000pro.googlegroups.com> <2c3059c2-e454-4746-9abe-ae9a12867169@b15g2000yqd.googlegroups.com> Date: Thu, 23 Jul 2009 22:26:15 +0200 Message-ID: <1xwokx2f7b5np.uqcsbkgyedg9.dlg@40tude.net> NNTP-Posting-Date: 23 Jul 2009 22:26:14 CEST NNTP-Posting-Host: cf1c88e2.newsspool4.arcor-online.net X-Trace: DXC=nJ=Ul0N^DX^YI9]OHn9o5^4IUK On Thu, 23 Jul 2009 13:02:25 -0700 (PDT), Hibou57 (Yannick Duch�ne) wrote: > 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). A map would be even better suited for that. (What was requested is not a variable, a named scoped object.) > 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. Yes, it is a right idea not to mix these two languages keeping them apart. However, a need in some interpreted domain-specific languages is very overestimated. In the automation area, customers are frequently asking for this. We promptly supply them with a tailored scripting language they want, knowing in advance that they will never ever use it. That would be just too expensive for them, requiring personal training, permanent use, just mental efforts nobody wanted to invest. But they are always certain that they utterly need it... (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de