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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,a024982454b4248e,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.72.165 with SMTP id e5mr1654643pav.4.1343318467452; Thu, 26 Jul 2012 09:01:07 -0700 (PDT) Received: by 10.66.72.165 with SMTP id e5mr1636428pav.4.1343316163030; Thu, 26 Jul 2012 08:22:43 -0700 (PDT) Path: b9ni65285795pbl.0!nntp.google.com!4no557300pbo.1!news-out.google.com!p10ni65051721pbh.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!volia.net!news2.volia.net!feed-A.news.volia.net!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.straub-nv.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Using 'Base Date: Sat, 21 Jul 2012 17:26:48 +0100 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="84970f972981d06cedfb580c49fe4706"; logging-data="23352"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0klqihvBGYi9oT07h0yKbOd1/lMOF4Ww=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (darwin) Cancel-Lock: sha1:ZHCbxNAUFoFs5bydX4pRW1hrEHU= sha1:myqTlZBiHMKBG974duca+1AXpqM= Content-Type: text/plain Date: 2012-07-21T17:26:48+01:00 List-Id: I've been working on a binding to msgpack[1]; progress so far at [2], for booleans, integer, and modular types. Looking at the read-integer spec, I have with Ada.Streams; generic type Integer_Type is range <>; function Message_Pack.Integer_Reader (From : not null access Ada.Streams.Root_Stream_Type'Class) return Integer_Type'Base; and I _think_ that the point of returning the 'Base of the formal type is that any Constraint_Errors will happen in user code during assignment of the function result. The idea was copied from the Generic Elementary Functions, but I may well have got the reason wrong. And, also, I may still raise CE internally if the value received from the wire won't fit in Integer_Type'Base. Is there any point in a similar declaration for write-integer? At present I have with Ada.Streams; generic type Integer_Type is range <>; procedure Message_Pack.Integer_Writer (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Item : Integer_Type'Base); (again, cf Generic Elementary Functions). [1] http://msgpack.org/ [2] git://git.code.sf.net/u/simonjwright/msgpack-ada/code