comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Text_IO, was: Re: Something I don't understand
Date: Wed, 19 Feb 2014 10:36:29 +0200
Date: 2014-02-19T10:36:29+02:00	[thread overview]
Message-ID: <bmj8o6Fmpc5U1@mid.individual.net> (raw)
In-Reply-To: <1mh0lp04e4bzc.vr6hi3fcbba5.dlg@40tude.net>

On 14-02-18 11:31 , Dmitry A. Kazakov wrote:
> On Tue, 18 Feb 2014 11:00:44 +0200, Niklas Holsti wrote:
> 
>> On 14-02-18 10:40 , Dmitry A. Kazakov wrote:
> 
>>> because texts are formatted differently depending
>>> on the medium. Different mediums deploy integrated mechanisms of
>>> formatting. E.g. paging is postponed until rendering if the medium is HTML.
>>> Alignment with proportional fonts is not about fields and decimal places,
>>> etc.
>>
>> Exactly. I meant that the type "Text" would represent text abstractly,
>> according to its logical structure, not in rendered form.
> 
> You mean text buffer like in GUI?

Possibly so, but I'm not familiar with GUI text buffers. It sounds like
a similar thing.

> To me text buffer, stream, file, string are all instances of the class of
> types over which Put dispatches. OK, we can call the abstract root type of
> the class "Text."

Perhaps Put would just be overloaded for these types. It depends if you
consider the types a class, or not. I'm not sure what is best.

>> The final
>> "Put" would then render according to the output medium.
> 
> Yes, that Put would be an implementation of the primitive operation defined
> for the class Text.

I would make Text a type, not a class. This would avoid the need for
multiple dispatch on a controlling Text parameter.

I'm thinking of two levels of "Put":

   Put (To : in out Text, Item : in String);
      Add items to a Text, building a logically structured Text,
      but without rendering it yet. This wil probably need
      some concept of "points in a Text where more stuff can
      be inserted" so that the Put can preserve or extend the
      logical Text structure.

   Put (To : in out File; Item : in Text);
      Render the Text into some external File.

The Text buffer intermediary means that each level of Put can (if
desired) be dispatching on one of the parameters, without needing
multiple dispatch.

> I think it is only logical for a strongly typed language to map this kind
> of stuff onto types.

I agree.

> This search for other "ways" (aspects, generics etc) is really damaging the
> language.

I don't agree. I see aspects as strengthening or broadening the type
concept, and generics as a meta-type level. But I must admit that I have
lately been using generics less often and have instead used classes and
dispaching more often. However, I think that generics are useful and are
not entirely subsumed by classes.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
      .      @       .

  reply	other threads:[~2014-02-19  8:36 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 23:57 Something I don't understand Laurent
2014-02-14  0:18 ` adambeneschan
2014-02-14  7:05   ` Charles H. Sampson
2014-02-15 15:27   ` Laurent
2014-02-15 19:10     ` Laurent
2014-02-15 20:05       ` Niklas Holsti
2014-02-15 21:16         ` Laurent
2014-02-15 21:40       ` Jeffrey Carter
2014-02-16  1:39       ` Robert A Duff
2014-02-16  9:08         ` Text_IO, was: " Simon Clubley
2014-02-16  9:43           ` Dmitry A. Kazakov
2014-02-16 16:57             ` Dennis Lee Bieber
2014-02-16 16:17           ` Robert A Duff
2014-02-17 12:52             ` Simon Clubley
2014-02-17 15:32               ` G.B.
2014-02-17 15:35                 ` G.B.
2014-02-17 17:34                 ` Mike H
2014-02-17 16:59               ` Niklas Holsti
2014-02-17 17:17                 ` Dmitry A. Kazakov
2014-02-17 17:42                   ` Niklas Holsti
2014-02-17 19:55                     ` Dmitry A. Kazakov
2014-02-18  7:14                       ` Niklas Holsti
2014-02-18  8:40                         ` Dmitry A. Kazakov
2014-02-18  9:00                           ` Niklas Holsti
2014-02-18  9:31                             ` Dmitry A. Kazakov
2014-02-19  8:36                               ` Niklas Holsti [this message]
2014-02-19  9:40                                 ` Dmitry A. Kazakov
2014-02-19 13:20                                   ` Niklas Holsti
2014-02-19 14:13                                     ` Dmitry A. Kazakov
2014-02-19 15:37                                       ` Georg Bauhaus
2014-02-19 16:32                                         ` Laurent
2014-02-19 17:46                                           ` Simon Clubley
2014-02-20  2:39                                         ` Dennis Lee Bieber
2014-02-20 11:44                                           ` G.B.
2014-02-19 21:45                                       ` Niklas Holsti
2014-02-20  9:52                                         ` Dmitry A. Kazakov
2014-02-20 18:19                                           ` Niklas Holsti
2014-02-19 15:06                                     ` Robert A Duff
2014-02-19 17:03                                       ` Niklas Holsti
2014-02-19 22:30                                         ` Robert A Duff
2014-02-17 18:13                 ` Simon Clubley
2014-02-17 20:09                   ` Dmitry A. Kazakov
2014-02-18  7:50                     ` Georg Bauhaus
2014-02-18  8:28                       ` Dmitry A. Kazakov
2014-02-17 20:22                   ` Niklas Holsti
2014-02-18  0:50                     ` Simon Clubley
2014-02-18  6:56                       ` Niklas Holsti
2014-02-18  8:04                         ` Georg Bauhaus
2014-02-19 22:01                     ` Robert A Duff
2014-02-20  8:25                       ` Dmitry A. Kazakov
2014-02-20 15:54                         ` Robert A Duff
2014-02-20 17:54                           ` Dmitry A. Kazakov
2014-02-20 20:45                       ` Niklas Holsti
2014-02-19 21:52                   ` Robert A Duff
2014-02-20  0:50                     ` Simon Clubley
2014-02-19 21:46                 ` Robert A Duff
2014-02-20  0:09                   ` Jeffrey Carter
2014-02-20  1:09                     ` Simon Clubley
2014-02-20  7:06                       ` Niklas Holsti
2014-02-20 13:05                         ` Simon Clubley
2014-02-20 11:51                       ` G.B.
2014-02-20 12:53                         ` Simon Clubley
2014-02-21 11:50                       ` Brian Drummond
2014-02-23 21:37                         ` AdaMagica
2014-02-23 23:23                           ` Bill Findlay
2014-02-24  4:29                           ` AdaMagica
2014-02-24 12:22                           ` Brian Drummond
2014-02-24 19:03                             ` AdaMagica
2014-02-20 20:02                   ` Niklas Holsti
2014-02-19 21:15               ` Robert A Duff
2014-02-19 22:01                 ` Simon Clubley
2014-02-16 14:50         ` Mike H
2014-02-17 16:09         ` Laurent
2014-02-17 17:42           ` Mike H
2014-02-18  1:05             ` Dennis Lee Bieber
2014-02-17 22:31           ` Jeffrey Carter
2014-02-19 12:51             ` Laurent
replies disabled

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