comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: Enumerations and Arrays Unnecessary!???
Date: 1997/06/18
Date: 1997-06-18T00:00:00+00:00	[thread overview]
Message-ID: <01bc7b84$5fa9e300$LocalHost@xhv46.dial.pipex.com> (raw)
In-Reply-To: dewar.866335292@merv




Robert Dewar <dewar@merv.cs.nyu.edu> wrote in article
<dewar.866335292@merv>...
> YOu mean that you don't see that Character is obviously a class, and
> specific characters like 'C' '+' '+' are simply objects of that class
> to which messages should be sent as required.

Conceptually, this is a perfectly reasonable idea. But imagine implementing
characters this way in Ada (where each character would be a tagged type).
Uh oh! Better still, imagine (as we are not allowed arrays either)
implementing strings as linked lists (or whatever) of these tagged types.
[Of course, this is roughly how languages such as (traditional) Prolog _do_
implement strings!]

Class CHARACTER would have obvious subclasses, such as LETTER and DIGIT,
with their own specialised constants and methods (such as FIRST, LAST,
NEXT, and VALUE). This approach is really not so silly, if it could be
implemented efficiently (in a language other than Ada).

I think this is an interesting question: could it be implemented
efficiently? In my ignorance, how does Smalltalk implement characters? And
other O. O. languages?

Nick.





  reply	other threads:[~1997-06-18  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-13  0:00 Enumerations and Arrays Unnecessary!??? JR Crosmer
1997-06-14  0:00 ` Robert Dewar
1997-06-16  0:00   ` Fanaticism [was Re: Enumerations and Arrays Unnecessary!???] Jan Galkowski
1997-06-14  0:00 ` Enumerations and Arrays Unnecessary!??? Robert A Duff
1997-06-14  0:00   ` Robert Dewar
1997-06-18  0:00     ` Nick Roberts [this message]
1997-06-18  0:00       ` Robert A Duff
1997-06-16  0:00 ` David Wheeler
replies disabled

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