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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e1bb9627c57b7d5b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-14 13:58:29 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.mathworks.com!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail Message-ID: <3F8C636F.3020003@comcast.net> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: U : Unbounded_String := "bla bla bla"; (was: Is the Writing...) References: <3F8B00F6.1050206@comcast.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.34.139.183 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc52.ops.asp.att.net 1066165108 24.34.139.183 (Tue, 14 Oct 2003 20:58:28 GMT) NNTP-Posting-Date: Tue, 14 Oct 2003 20:58:28 GMT Organization: Comcast Online Date: Tue, 14 Oct 2003 20:58:28 GMT Xref: archiver1.google.com comp.lang.ada:861 Date: 2003-10-14T20:58:28+00:00 List-Id: Mark A. Biggar wrote: > With either of the above suggestions you probably also need to specify > the type of literal allowed as well. This would allow for multiple > different types of literals to be used. Yep, there are types where you want to add numeric literals, and other types where you want character or string literals. But I think Alexander Kopilovitch does have a good idea on how to do it. Bind to a named function that returns the type, and allow that function to raise Constraint_Error. There may be cases, like an arbitrary precision numeric type where you CAN'T support all possible literals but you can try. This of course argues for a numeric literal conversion function that takes a string and is actually run at compile time. But that is a detail. -- Robert I. Eachus "Quality is the Buddha. Quality is scientific reality. Quality is the goal of Art. It remains to work these concepts into a practical, down-to-earth context, and for this there is nothing more practical or down-to-earth than what I have been talking about all along...the repair of an old motorcycle." -- from Zen and the Art of Motorcycle Maintenance by Robert Pirsig