[m-dev.] io__write and arrays

Peter Schachte pets at cs.mu.oz.au
Thu Apr 10 16:19:08 AEST 1997


On Tue, 8 Apr 1997, Fergus Henderson wrote:

> If you want to be able to read things back in again, then you need to
> write out the type name (to disambiguate).  So to read them in again,
> you can read in the type name, look up the type name in a global table
> mapping from type name to base_type_info.

Yup, that's what I was suggesting with the #Typename{...} syntax.

> > On a related topic, how should users write
> > manifest constants of a C-implemented type?
> 
> I think they should write them as function calls to functions
> that create values of that type.

That's fine if the user is writing code, but it won't work if they're
writing data (terms that will just be read in with read).  I was looking
for a way to have read be able to read in such terms.

> > For the purposes of discussion let's
> > use the syntax #Typename{...}, where "Typename" could be any type name,
> > and the interpretation of the "..." depends on the type.  For example, an
> > integer array of 1, 2, and 3 might be written #array{1,2,3}.  This is
> > ugly, but it'll do for discussion. 
> 
> I think that
> 
> 	uniq_array.from_list([1,2,3]) : uniq_array.uniq_array(int)
> 
> is less ugly.

It looks terribly verbose to me, making it more difficult to see what it
means. It's disappointing to me that you can read a list of the first 3
counting written as

	[1,2,3]

but for an array of the first 3 counting numbers you have to write

	uniq_array.from_list([1,2,3]) : uniq_array.uniq_array(int)

and still not be able to read this in from a file.

And why should you have to specify the int type for an array of ints?  You
don't for a list of ints. 


-Peter Schachte      URL:  http://www.cs.mu.oz.au/~pets/
pets at cs.mu.OZ.AU     PGP:  finger pets at 128.250.37.150 for key
    [A computer is] like an Old Testament god, with a lot of rules
    and no mercy.  -- Joseph Campbell




More information about the developers mailing list