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 Path: border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Sun, 7 Apr 2013 20:28:24 +0200 Organization: cbb software GmbH Message-ID: <1htu9idmcci7x.1vr9eafeivqah$.dlg@40tude.net> 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> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: rHWOzyHApalsT5sEUcbvVQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 3054 Date: 2013-04-07T20:28:24+02:00 List-Id: On Sun, 7 Apr 2013 20:17:43 +0200, Stefan.Lucks@uni-weimar.de wrote: > On Sat, 6 Apr 2013, Dmitry A. Kazakov wrote: > >> On Fri, 5 Apr 2013 21:55:27 +0200, Stefan.Lucks@uni-weimar.de wrote: > >>> In any case, Ada.Text_IO.Create is a good example. > [...] >>> No Universal_ type will solve this issue -- you just cannot get rid of >>> explicit conversions. >> >> You can. Actually, what people do right now is implicit unchecked >> conversions from UTF-8 to String. It is even worse than PL/1, it is plain >> wrong, C-esque of worst kind. Unfortunately Ada simply offers no means to >> design it right. > > If you have mounted different filesystems using different encodings on > your system, how on earth should Ada.Text_IO even "know" which encoding to > apply? How is this relevant to the issue that encoding must a part of the type? > Yes, this is C-esque of the worst kine. However, what would you expect > when making system calls with operation systems written in C? I expect the type system to handle equivalent types of different representations such as UTF-8 and UCS-4 strings. As it already does in the case Universal_Integer vs. Integer. Both are distinct types, both have different representations, both are considered equivalent in certain cases. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de