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!proxad.net!feeder1-2.proxad.net!weretis.net!feeder4.news.weretis.net!news.teledata-fn.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Structural unification (pattern matching) in Ada [was: 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> <1omt2srxtpsga$.c3hbxthzo6cf.dlg@40tude.net> <1e4cch2df5uyb.18brqdd16dhv8.dlg@40tude.net> <14y70ke8am9qw$.2csc9eflvigg.dlg@40tude.net> <4c601b5c$0$7665$9b4e6d93@newsspool1.arcor-online.net> <9czktq4ntzq7.fhbsnocx0x4w$.dlg@40tude.net> <4c6078f9$0$12500$426a74cc@news.free.fr> <4c6132d2$0$8378$426a74cc@news.free.fr> <4c61dafd$0$14549$426a74cc@news.free.fr> <4oebq9a8m8et$.gvv6eyo3umfh$.dlg@40tude.net> <4c62e31a$0$10493$426a34cc@news.free.fr> Date: Wed, 11 Aug 2010 20:06:55 +0200 Message-ID: <4iv76734t4kw$.1rh1lqvr4rpdr.dlg@40tude.net> NNTP-Posting-Date: 11 Aug 2010 20:06:54 CEST NNTP-Posting-Host: 7694321a.newsspool4.arcor-online.net X-Trace: DXC=kiOd5L;S\AX@@RW1FjIB5S4IUK On Wed, 11 Aug 2010 19:51:23 +0200, _FrnchFrgg_ wrote: > I don't understand what Streams have to do with ML pattern matching. You mentioned to constructors stream I/O deploys them. > Just to be sure we are talking about the same thing, I read one of you > wishing Ada had a more powerful/generic "switch" construct, and I > noticed that the description of such a "switch" looked like a subset of > structural unification as you can find in most functionnal languages. Can you explain why it looked so to you. Actually I didn't wish a more generic "switch", I wished it as it is. What I needed is an enumeration interface for non-discrete types in order to be able to use them in case. String was just one example. > Perhaps the current Ada is powerful enough to write some function/code > doing this switch machinery, but I was thinking it would be a new > language construct (or an extension of "switch"). That was my first thought, so I asked if you meant *normal* patterns, like regular expressions etc. No, I certainly don't want them in Ada case-statement. Alternatives of a case statement can be evaluated in any order, they can be statically verified for being exhaustive and not overlapping. These are most important features, which any more or less usable pattern language lacks. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de