Subject: variable length arrays

From: [email-masked] (Ray R. Larson)
Date: Wed, 17 Mar 93 07:52:29 -0800

Thanks Paul;

>
>   The code in 4.1 assumes that you quote your array elements in the case 
>   of a single item.  (This is documented ... somewhere...)  Otherwise, 

I think this is only documented (vaguely) in the comments to arrayfuncs.c The
4.1 (pre-release) manual says the format of an array constant is:
    "{<val1><delim><val2><delim>}" 
with no mention of quoting for single element array constants. 

>   there is no way to tell a blank string from an empty array.  For example,
>   the test added by Ray correctly handles
>	   {hi mom}
>   (whereas the 4.1 code requires you to say
>	   {"hi mom"}
>   in this case).  However, Ray's test also assumes that
>	   {  }
>   is the same thing as
>	   {"  "}
>   instead of the empty array, which may or may not be what you want.
>   This can be especially confusing if you're using non-character types :-)

Yep, that was my original problem 
{1,2} was OK and made sense {1} made sense but wasn't OK -- and I had a
multi-megabyte file to load of some thousands of these that I didn't want 
to edit by hand. Anyhow, everyone should probably ignore my cheap hack
and quote all your array elements.

Ray

---

From: [email-masked] (Paul M. Aoki)
Date: Wed, 17 Mar 93 11:00:51 -0800

> and quote all your array elements.

It's no more a cheap hack than the current fix (which is admittedly
pretty arbitrary...).  I was just explaining what the current stuff does 
and why.  I'm sure many people will *want* your semantics, in which case 
they can apply your patch.  It's probably better to accept {1} than to 
care about { } but since {1} was *already* broken and { } wasn't, I didn't
want to confuse people even more :-)

Sunita Sarawagi is highly and personally offended by the lack of 
multidimensional arrays and is rewriting the array code anyway ...
stay tuned :-)