Re: Homogeneous sequence

new topic     » goto parent     » topic index » view thread      » older message » newer message

Bernie Ryan wrote:
> 
> Derek Parnell wrote:
> > As all of these are variations are sequences of some sort, and the common
> > English
> > term for a sequence is 'list', then maybe something along the lines of ...
> > 
> >   integer list x
> >   object list x
> >   sequence list x
> >   atom list list x
> >   my_user_defined_type list x
> > 
> 
> Derek:
> 
> Aren't we simply saying:
> 
> array of integer x
> array of object x
> array of sequence x
> array of array of sequence x
> array of my_user_defined_type x

Yes. The operative word being "simply". 

Most English speaking people, especially non-programmers, use the term "list"
rather than "array" or "sequence" when describing such a structure. I feel that
"list" is a simple, one-syllable, commonly used word. Also the form "<adjective>
<noun>" is simpiler than the form "<noun> of <noun>", IMHO.

Try reading out source code over the telephone.

I agree that people who would write long definitions using this syntax should be
gentle taken aside and educated. So maybe its also time to borrow another idea
from the D programming language - alias.

  alias atom list text
  alias text list file
  file options

These lines above mean that "text" is an alias for "atom list", and "file" is an
alias for "text list", and we are declaring a symbol called "options" is is of
type "file" which is really "text list" which is really "atom list list". The
alias can be thought of as a light-weight UDT.
 

-- 
Derek Parnell
Melbourne, Australia
Skype name: derek.j.parnell

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu