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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a3b1adae5552af6d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Text parsing package Date: Mon, 28 Mar 2011 12:18:38 +0200 Organization: Ada @ Home Message-ID: References: <4fa6c081-910a-4e62-928a-0f6cdd1da951@l18g2000yqm.googlegroups.com> <1j2rym8p7nnpr$.6ov97ypbvrfe$.dlg@40tude.net> NNTP-Posting-Host: H+AM93vqGaZRLdQzwI1fHQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/11.01 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:18536 Date: 2011-03-28T12:18:38+02:00 List-Id: Le Mon, 28 Mar 2011 10:15:52 +0200, Dmitry A. Kazakov = a =C3=A9crit: >>> 3. As others have mentioned, it is a good idea to abstract the sourc= e >>> formats in order to be able to parse files, strings, streams etc. >> And Ada already provides a root for that: Ada.Streams.Root_Stream_Typ= e > > Unfortunately Root_Stream_Type is not an interface and string cannot b= e > inherited from. So in the effect you would need a special root. I meant implementing a concrete Root_Stream_Type using a string as sourc= e. = You would have an open method, getting a string or any kind of reference= = to string, just not as a filename this time. But wonder about efficiency= = (because of the tagged type), which is important for such low-level and = = heavily iterated stuff. Buffering with systematic batch input/output may= = still be option to reach efficiency, even with a tagged stream type (bat= ch = often help efficiency I feel). The advantage is that this would be clean to use, as this may be used = every where something expect a standard Ada Stream. The disadvantage may= = be the above. Also can be done with generics, but will not try to advocate it, as when= I = used it, I was not happy with that in the end. > Yes, it would be nice to have structured multiple co-routines as an > alternative to FSM. There are some cases where tasks look like an = > overkill. I remember I made that wish too (can't remember what was said to advocat= e = against it). Let's hope for Ada 2017 or Ada 2022. -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens. =E2=80=9C c++; /* this makes c bigger but returns the old value */ =E2=80= =9D [Anonymous]