comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: String view of file
Date: Mon, 21 Nov 2022 16:18:48 +0100	[thread overview]
Message-ID: <tlg4sn$9es$1@gioia.aioe.org> (raw)
In-Reply-To: d1d4d819-8da2-4442-8bf9-a00c7ab6b4a5n@googlegroups.com

On 2022-11-21 09:30, Jesper Quorning wrote:

> Is it possible to write something like this with ADA
> 
> ```Ada
> package my_rw_file is new file
>    (name => "whatever"
>     ,mode => read_write
>     ,implementation => standard -- or portable or fast
>    );
> package as_string is new. xxx(from => my_rw_file);
> 
> -- parse (as_string);
> package data is new parse (as_string, format => markdown); -- or whatever

It is difficult to guess what you want to achieve. What it looks to me 
is a design opposite to the customary approach:

     abstract code source  (generic and/or tagged)
       /        |       \
      /         |        \
   string   text_file   stream

Since string and file cannot be derived, in a tagged case some mix-in is 
used.

The parser from simple-components has multi-line and single-line 
sources. A single-line source can be set on a string. Multi-line source 
is for files and streams.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  parent reply	other threads:[~2022-11-21 15:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  8:30 String view of file Jesper Quorning
2022-11-21 13:01 ` G.B.
2022-11-21 13:48 ` Jeffrey R.Carter
2022-11-21 15:52   ` Niklas Holsti
2022-11-21 16:42     ` Jeffrey R.Carter
2022-11-21 17:29       ` Niklas Holsti
2022-11-21 15:18 ` Dmitry A. Kazakov [this message]
2022-11-21 16:11 ` Marius Amado-Alves
2022-11-21 17:29 ` Qunying
2022-11-21 21:43 ` Gautier write-only address
2023-01-01 23:36 ` Jesper Quorning
2023-01-02 18:57   ` Stephen Leake
2023-01-03 16:37   ` Jeffrey R.Carter
2023-01-03 17:02     ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox