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: 103376,24d7acf9b853aac8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news4.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: S-expression I/O in Ada Date: Sat, 14 Aug 2010 13:11:25 +0200 Organization: A noiseless patient Spider Message-ID: <8739uhjvoi.fsf@ludovic-brenta.org> References: <547afa6b-731e-475f-a7f2-eaefefb25861@k8g2000prh.googlegroups.com> <87aap6wcdx.fsf@ludovic-brenta.org> <87vd7jliyi.fsf@ludovic-brenta.org> <699464f5-7f04-4ced-bc09-6ffc42c5322a@w30g2000yqw.googlegroups.com> <87k4nylb8c.fsf@ludovic-brenta.org> <4c617774$0$6765$9b4e6d93@newsspool3.arcor-online.net> <2610d347-27cf-4c88-ac18-84f73c7da858@h32g2000yqm.googlegroups.com> <878w4blhzj.fsf@ludovic-brenta.org> <85fc256b-bb92-43f5-9de7-5148f5b23622@k10g2000yqa.googlegroups.com> <87vd7fk1ar.fsf@ludovic-brenta.org> <518d22c5-2a6e-49b3-8022-b82f4402f216@m1g2000yqo.googlegroups.com> <8f73cb40-3988-4039-9ffa-822d703f4a1d@v8g2000yqe.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 14 Aug 2010 11:11:27 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="+Zo/4jpxoYstrAwcAAtWAw"; logging-data="15632"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fEup2LBh4fCOJJgoiv/vP" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:ffZyn3sgwdMyq6J+fDbXkYUjQBs= sha1:Y1j4u7+LhRSpxCxQJTtviZcUs44= Xref: g2news1.google.com comp.lang.ada:13278 Date: 2010-08-14T13:11:25+02:00 List-Id: Natacha Kerensikova writes: > On Aug 13, 11:08 am, Ludovic Brenta > wrote: >> Natacha Kerensikova wrote on comp.lang.ada: >> > Consider these two objects: >> >> > L--A--tcp-connect >> >    | >> >    L--A--host >> >    |  | >> >    |  A--foo.example >> >> This part cannot exist: the second L cannot have more than 2 children; >> here you gave it three (A, A and the next L). The dot notation would >> have prevented that mistake :) > > No, it has only two children: the A connected to "host" and the L you > haven't quoted. All the nodes in both my graphs have exactly one > "right child", which is their value, and zero or one (but not more) > "lower child" being the next element in the list, i.e. the second > argument of cons. OK, so your A nodes weren't really atoms after all, they were cons pairs, the car of which was the actual atom. I misunderstood that. > So if you really want a dot notation, here is the first object: > (tcp-connect . > ( > (host . (foo.example . nil)) > . > ((port . (80 . nil)) . nil) > ) > ) > > while the second one is: > > (tcp-connect . > ( > ( > (host . (foo.example . nil)) > . > ((port . (80 . nil)) . nil) > ) > . > nil > ) > ) > > I hope my vertical alignment will make these cons pairs clear enough. > > > Hoping to finally understand, > Natacha OK, but these two are equivalent if you remember the axiom that (y . nil) is really just y. If you apply that transformation to both of your examples you reach the same topology: (tcp-connect . ((host . (foo.example . nil)) . ((port . (80 . nil)) . nil))) = (tcp-connect . ((host . foo.example ) . ((port . 80) . nil))) = (tcp-connect . ((host . foo.example ) . (port . 80))) (tcp-connect . (((host . (foo.example . nil)) . ((port . (80 . nil)) . nil)) . nil)) = (tcp-connect . (((host . foo.example ) . ((port . 80) . nil)) . nil)) = (tcp-connect . (((host . foo.example ) . (port . 80)) . nil)) = (tcp-connect . ((host . foo.example ) . (port . 80))) -- Ludovic Brenta.