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 X-Google-Thread: 103376,24d7acf9b853aac8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!87.79.20.105.MISMATCH!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: S-expression I/O in Ada Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <547afa6b-731e-475f-a7f2-eaefefb25861@k8g2000prh.googlegroups.com> <1qk2k63kzh7yv$.3jgc403xcqdw$.dlg@40tude.net> <8ae8e899-9eef-4c8c-982e-bfdfc10072f1@h17g2000pri.googlegroups.com> <258zlxrv4fn6.1vszho1rtmf48$.dlg@40tude.net> <984db477-973c-4a66-9bf6-e5348c9b95f2@n19g2000prf.googlegroups.com> <46866b8yq8nn$.151lqiwa0y2k6.dlg@40tude.net> <13b07f2c-2f35-43e0-83c5-1b572c65d323@y11g2000yqm.googlegroups.com> <13tpf7ya3evig$.h05p3x08059s$.dlg@40tude.net> <1omt2srxtpsga$.c3hbxthzo6cf.dlg@40tude.net> <1e4cch2df5uyb.18brqdd16dhv8.dlg@40tude.net> Date: Mon, 9 Aug 2010 08:50:37 +0200 Message-ID: NNTP-Posting-Date: 09 Aug 2010 08:50:36 CEST NNTP-Posting-Host: 47ebf8ef.newsspool3.arcor-online.net X-Trace: DXC=ZVj;a3:Ck29U`5g[@c]@J1McF=Q^Z^V384Fo<]lROoR18kFOW4edIN;[6LHn;2LCV>[ On Sun, 08 Aug 2010 17:08:50 -0400, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > > I actually have no opinion whether it's a good idea, because I > don't like modular types in the first place. ;-) The implementation or the idea? Would you agree that objects with some properties of modular integers have place in Ada programs which do not interface C? > I didn't mention "access" above, which are "elementary" but not > "scalar". Constrained access subtypes are a nightmare! Yes, because the language should decide whether the constraint does influence the behavior (all operations potentially), or is a kludge that prohibits some values when assigned or passed. I understand the motivation why Ada 83 chosen the second, but it does not make it right. Assignment is an operation as any other. >> Empty range does not have bounds. > > Except that in Ada, they do. An empty String is (1..0). > It could also be 10..9 or even -100..-10_000_000, but > that's not a good idea. Yes, because it is wrong. Doing something wrong always will hit back. >> Modular numbers are not ordered. > > But they are -- they have "<", and "for" and so on. "<" is wrong when non-transitive. I wished Ada clarified difference between enumeration and total order. > Perhaps they _should_ be unordered, but I won't agree or disagree, > since I think in an ideal world they should be banished. I think they could be fixed. > By the way, one defense of modular types I've heard is that > they are used in mathematics. True. > But mathematicians do > not use _implicit_ mod. They say things like "X = Y (mod N)", > which is pronounced "X is congruent to Y (modulo N)". > Congruent, not equal. The mathematical notation (mod N) is untyped. It applies to any natural numbers and what is worse you have to add it at each point of the program you use the type. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de