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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e5d23ac8a9173493 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!i76g2000hsf.googlegroups.com!not-for-mail From: sjw Newsgroups: comp.lang.ada Subject: Re: Using a string as a binary operator Date: Wed, 15 Oct 2008 12:32:34 -0700 (PDT) Organization: http://groups.google.com Message-ID: <330f9f8a-0045-40dc-b67a-881362dc0487@i76g2000hsf.googlegroups.com> References: <8cbb04c3-e789-4b67-897a-fd6f83486bbc@x16g2000prn.googlegroups.com> <8d9b43fa-05a1-4024-bbd3-ddf276478748@40g2000prx.googlegroups.com> NNTP-Posting-Host: 62.49.19.209 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1224099155 26394 127.0.0.1 (15 Oct 2008 19:32:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 15 Oct 2008 19:32:35 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i76g2000hsf.googlegroups.com; posting-host=62.49.19.209; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2402 Date: 2008-10-15T12:32:34-07:00 List-Id: On Oct 15, 4:22=A0pm, Adam Beneschan wrote: > =A0 =A0 Available_Operators : constant Operator_Desc_Array :=3D > =A0 =A0 =A0 =A0 ((new string' ("+"), Plus'access), > =A0 =A0 =A0 =A0 =A0(new string' ("-"), Minus'access), .......); > > Then you can search the array for an element whose Name.all matches > the operator string, and then call the Operation function of the > element. Or you could use the Containers library - looks like a Map from string to access-to-function