Subject: < ``arrays of arrays'' >

From: [email-masked] (Robert Rothe)
Date: Tue, 19 Jan 1993 21:01:04 +0100 (MET)

hi,

is the following behavior concerning the entry 'Susi' correct ?

create bla (name=char16, telno=text[])  \g

append bla (name="Hans", telno = "{ "110", "112" }") \g
append bla (name="Anna", telno = "{ "1164", "" }"  ) \g
append bla (name="Karl", telno = "{ "1171",  }"    ) \g
append bla (name="Susi", telno = "{ "1191" }"      ) \g

retrieve (bla.all, bla.telno[1]) \g

---------------------------------------------
| name        | telno         | telno       |
---------------------------------------------
| Hans        | {"110","112"} | 110         |
---------------------------------------------
| Anna        | {"1164",""}   | 1164        |
---------------------------------------------
| Karl        | {"1171",""}   | 1171        |
---------------------------------------------
| Susi        | {}            | (null)      |
---------------------------------------------

thanx for info,
	robert.

---

From: <[email-masked]>
Date: Tue, 19 Jan 93 14:05:07 PST

> append bla (name="Susi", telno = "{ "1191" }"      ) \g

No.  This is a bug in the array code.  The code that parses array strings
first counts values in such a way that it can never count exactly one value.
Hence, you can never have an array constant with exactly one value.

This has been fixed in 4.1 (which will be out Any Day Now).  However, you
*have* to quote a single value (or the parser can't tell the difference
between a blank text string and a null array).  An artifact of the syntax..
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  [email-masked]
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki