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,ASCII-7-bit Path: g2news1.google.com!news3.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: Fri, 13 Aug 2010 17:52:28 +0200 Organization: A noiseless patient Spider Message-ID: <87eie2jyrn.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> <87ocdbl41u.fsf@ludovic-brenta.org> <318d4041-eb01-4419-ae68-e6f3436c5b66@i31g2000yqm.googlegroups.com> <383ec00d-1f62-4d2f-b501-cedaeaa4b3c4@t2g2000yqe.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Fri, 13 Aug 2010 15:52:28 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="49Cd3UBGonzbsZffKKSfQg"; logging-data="27731"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ypexOkn+lPgin/hpT+v98" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:9NCbwdzfVjbq/hZEM3235CnwNgs= sha1:ZxWZr5zGW9uBhL6YQCq3GNCq/UM= Xref: g2news1.google.com comp.lang.ada:13225 Date: 2010-08-13T17:52:28+02:00 List-Id: Natacha Kerensikova writes on comp.lang.ada: > What I found tricky is the "single operation" part. Building 8 nodes > in a single operation does look very difficult, and while Ludovic's > trick of building them from an encoded string is nice, it makes we > wonder (again) about the point of building a S-expression object > before writing it while it's simpler and clearer to write strings > containing hand-encoded S-expressions. The only use case for constructing an S-Expression tree in memory and then writing it out is when the S-Expression is very dynamic. For example, when you want to save the state of your application, e.g. the cache of a web browser, in a structured way. Or when you want to save a tree, the contents and structure of which are unknown in advance. If the S-Expression is static or mostly so, then by all means write it by hand. -- Ludovic Brenta.