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!news2.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool3.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> <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> <14y70ke8am9qw$.2csc9eflvigg.dlg@40tude.net> <4c601b5c$0$7665$9b4e6d93@newsspool1.arcor-online.net> Date: Mon, 9 Aug 2010 18:11:08 +0200 Message-ID: <9czktq4ntzq7.fhbsnocx0x4w$.dlg@40tude.net> NNTP-Posting-Date: 09 Aug 2010 18:11:08 CEST NNTP-Posting-Host: 26146bbd.newsspool3.arcor-online.net X-Trace: DXC=UG\ja]^4VG1nBOkdL^Lo7>McF=Q^Z^V384Fo<]lROoR18kF[6LHn;2LCV>[ On Mon, 09 Aug 2010 17:14:36 +0200, Georg Bauhaus wrote: > On 09.08.10 16:38, Dmitry A. Kazakov wrote: > >> I think that all these usages require different types of modular types with >> different sets of operations. So I would prefer a language extension which >> would allow me construction of such types rather than built-in ones, which >> satisfy no one. Just one example from a huge list, why "in" is not an >> operation? >> >> if 0 /= (Mode and Alarm) then -- Isn't it awful? >> >> why am I not allowed to have: >> >> if Alarm in Mode then > > Is anything wrong with packed arrays of Booleans for status thingies? 1. The membership/subset tests look even worse 2. No ranges 3. No loops 4. No case statement 5. Array aggregates as literals aren't not fun 6. No discriminants of 7. No array index of Note that array must be a view of a modular type with the modulus 2**N, but the type itself must remain scalar. >>> Writing "mod" whenever I want an expression that takes the modulus is >>> a GOOD thing. "+" should always do an add, and nothing else. >> >> Huh, modular "+" *does* add in the ring. Your "+" does not! > > How many programmers, among those without a degree in math or > in physics, know what a ring is? Why should they use the type then? > Hence, no "+" can do the "right thing", since "+" is overloaded. Most of modular types should have no + at all. There should be a readable notation for X+1 instead of infernal T'Succ(X) > A definition of the "+" operator, whose meaning(s) is (are) > stipulated to be well known, seems impossible: http://en.wikipedia.org/wiki/Abelian_group ? > Imagine a programming language that is just like Ada with > SPARK restrictions on naming. Then, throw out overloading of > predefined names, too, of "+", for example. I don't think this were possible, but basically it is what inheritance is all about. The concept of checking would be the LSP-conformity. > No more misunderstandings, then. > > But will this language be usable with beginners? Come on, children start counting before knowing anything about groups. Most of them die before they do. The language is a tool it is not a library. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de