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,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII X-Received: by 10.180.189.209 with SMTP id gk17mr99752wic.7.1366082118119; Mon, 15 Apr 2013 20:15:18 -0700 (PDT) Path: p18ni69727wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.teledata-fn.de!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!telefonica.de!news-1.dfn.de!news.dfn.de!news.uni-weimar.de!medsec1.medien.uni-weimar.de!lucks From: Stefan.Lucks@uni-weimar.de Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Mon, 8 Apr 2013 17:35:17 +0200 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <1gnmajx2fdjju.1bo28xwmzt1nr.dlg@40tude.net> <3gv2jwc95otm.pl2aahsh9ox8.dlg@40tude.net> <1gkxiwepaxvtt$.u3ly33rbwthf.dlg@40tude.net> <1fmcdkj58brky.bjedt0pr39cd$.dlg@40tude.net> <1bj564vat3q1j$.1s4d00rlzx4ux$.dlg@40tude.net> <4hzv51v872q2$.1imijbwd7heqm$.dlg@40tude.net> <1htu9idmcci7x.1vr9eafeivqah$.dlg@40tude.net> NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 X-Trace: tigger.scc.uni-weimar.de 1365435392 28908 141.54.178.228 (8 Apr 2013 15:36:32 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Mon, 8 Apr 2013 15:36:32 +0000 (UTC) X-X-Sender: lucks@debian In-Reply-To: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Date: 2013-04-08T17:35:17+02:00 List-Id: On Mon, 8 Apr 2013, Dmitry A. Kazakov wrote: >> Because even if the implementation of Ada.Text_IO.Open would know the >> encoding of the filename, it could do nothing useful with it. > > ??? It must know the encoding in order to handle the file properly. Ah! Finally you seem to understand where the problem is! Ada.Text_IO would have to know the encoding, but it doesn't. So it just=20 treats the string like a sequence of bytes (much like a C-string) and=20 leaves it to the Application Programmer to apply the proper conversion=20 before. Which means, the conversion must be done explicitly. >> Universal_Integer is a pseudo-type. > > With pseudo-values and pseudo-operations used by pseudo-programmers? (:-)= ) All objects of that type are constant. All operations are evaluated at=20 compile time. Whenever values of this type make it into run-time objects,= =20 they magically change their type. >> You cannot define an object O: >> Universal_Integer, neither a function returning Universal_Integer ... > > As if it were relevant. But you are wrong here. How so? > Universal types leak into > run time through attributes. I.e. you do have objects of universal types = at > run time in expressions like > > Integer'Pos (X) * 2 You just used the already existing object 2 of type constant=20 Universal_Integer. Even if you ignore the "constant", there is no=20 *definition* (or *declaration*) of an object O: Universal_Integer. >> The only thing that Universal_Integer handles well is a neat way of >> defining constants. > > That is the whole point. It is already here, because it is needed. I see. Some pseudo-type Universal_String might possibly help with string=20 constants (I am not sure -- it is much more difficult to figure out the=20 proper transformation to whatever string type you really need). But the mess with string types in Ada goes deeper, and Universal_Strings=20 would at best solve half of the problem. YMMV, but I'd say much less than half of the problem. ------ I love the taste of Cryptanalysis in the morning! ------ --Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universit=E4t Weimar, Germany--