Re: SDL-News: Request for more flexible initialisation of array!

Subject: Re: SDL-News: Request for more flexible initialisation of array!
From: Anders Olsen ( )
Date: Mon Dec 01 1997 - 13:34:00 GMT

The originator of this message is responsible for its content.
-----From (Anders Olsen) to sdlnews -----

Dear SDL colleagues
There is another problem with arrays that makes it difficult to define
a constructor in the general case. The problem is that the index type need not be
discrete or ordered. For example the integer arrays: Array(Real,Integer), array(Charstring,Integer),
Array(Powerset(Integer),Integer) all have non-discrete or non-ordered index type.

This is more a problem with the nature of the Array generator than with the underlying
SDL data model. The problem is that an SDL array resembles more a complete (i.e. non-partial)
mathematical mapping than an array as known from programming languages.

But a shorthand notation could easily be introduced for the String generator, e.g.

(. 1,2,3 .) could be a shorthand for mkString(1) // mkstring(2) // mkstring(3)

and for Powerset, e.g.

(. 1,2,3 .) could be a shorthand for Incl(Incl(Incl(empty,1),2),3)

But for array, we need to know the index value as well, therefore a Z.105-like construct
must be used for the shorthand, e.g.

a value of Array(Charstring,integer) could be

{ 'a' 1,'ab' 2, default 3 } being equivalent to Modify(Modify(Make(3),'a',1),'ab',2)

In the current data model, all elements of an array are always well-defined which is why the 'default' value is
needed. However, this may be relaxed in the future data model.

Regards Anders

-----End text from (Anders Olsen) to sdlnews -----
For help, email "" with the body of your email as:
or (iff this does not answer your question) email:

This archive was generated by hypermail 2a23 : Sun Jun 16 2013 - 10:41:40 GMT