comp.lang.ada
 help / color / mirror / Atom feed
From: "Dan'l Miller" <optikos@verizon.net>
Subject: Re: Multiple iterators for a type
Date: Sat, 26 May 2018 07:22:35 -0700 (PDT)
Date: 2018-05-26T07:22:35-07:00	[thread overview]
Message-ID: <c6acccfc-9e77-4bd2-9a9c-a6c5bba51359@googlegroups.com> (raw)
In-Reply-To: <peboqf$f7q$1@gioia.aioe.org>

On Saturday, May 26, 2018 at 8:52:18 AM UTC-5, Dmitry A. Kazakov wrote:
> On 2018-05-26 15:03, Lucretia wrote:
> > On Saturday, 26 May 2018 07:59:59 UTC+1, Dmitry A. Kazakov  wrote:
> >> On 2018-05-26 05:57, Luke A. Guest wrote:
> >>> Stephen Leake <> wrote:
> >>>
> >>>> An "iterator" can be anything you want it to be. As Randy pointed out,
> >>>> there can be only one that gets special treatment from the compiler, but
> >>>> you did not mention that as a requirement.
> >>>>
> >>>
> >>> I’m attempting to implement a Unicode string using UTF-8, so I want the
> >>> basic iterator over octets, then the next will iterate over the octets and
> >>> generate code points, then another will be graphème clusters.
> >>
> >> Why do you bother? I mean, there is no solution for having a
> >> user-defined array type in Ada. Iterator is only a small part of it.
> >> Even if the iterator kludge worked somehow, the rest would not.
> >>
> >> Multiple inheritance is not complete either, so having two array
> >> interfaces for one object will be extremely difficult and uncomfortable.
> >> You will end up with a mess of helper generic packages to emulate full
> >> inheritance. [I went that way, there is nothing good there.]
> >>
> >> In short, there is nothing useful Ada 20xx could bring to the problem of
> >> dealing with encoded strings.
> > 
> > Sorry, didn't understand a word of this wrt to my post.
> > 
> > We can't have user defined array types in Ada? WTF?
> 
> There are only built-in arrays in Ada. You cannot have an array ADT 
> providing your array object representation and/or implementation of 
> array operations.
> 
> > What wouldn't work?
> 
> Implementation of encoded string with two array views of it, as an array 
> of encoding units and an array of characters/glyphs/code points etc.
> 
> > How is MI involved here?
> 
> An encoded string implements two array interfaces.

Other than from Dmitry, where did “encoded string” come from in this thread?  Dmitry, where are you getting this (bizarre) definition of “encoded string”?  From some non-Ada programming language?  And apparently not a mainstream one, at that.

[I ask because a quick Bing/Google search turns up only the canonical definition of encoded string:  a 2nd string converted to a special encoding (e.g., Base64 in MIME) as the (separate) •output• (encoded-)string of a (encoding-)transformation that took a (separate) (unencoded-)input string that lacked the special encoding.  I couldn't easily find any programming language or library that uses “encoded string” as its internal-culture jargon that has your apparently-novel definition of 2 concurrent/super-imposed array-esque personalities on the same string-instance.]


  reply	other threads:[~2018-05-26 14:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 16:49 Multiple iterators for a type Lucretia
2018-05-25 19:50 ` Jacob Sparre Andersen
2018-05-25 21:50   ` Randy Brukardt
2018-05-26  3:13 ` Stephen Leake
2018-05-26  3:57   ` Luke A. Guest
2018-05-26  4:44     ` Jere
2018-05-26  6:59     ` Dmitry A. Kazakov
2018-05-26 12:33       ` Dan'l Miller
2018-05-26 13:03       ` Lucretia
2018-05-26 13:52         ` Dmitry A. Kazakov
2018-05-26 14:22           ` Dan'l Miller [this message]
2018-05-26  7:14     ` G.B.
replies disabled

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