On Sun, 6 Oct 2002, Trey Harris wrote: : In a message dated Sun, 6 Oct 2002, Noah White writes: : > On Sunday, October 6, 2002, at 01:50 AM, Brent Dax wrote: : > : > > Parens don't construct lists EVER! They only group elements : > > syntactically. One common use of parens is to surround a : > > comma-separated list, but the *commas* are creating the list, *not* the : > > parens! : > > : > : > Following this rule would mean that : > : > $a = (); # $a is a list reference with 0 elements : > : > should not be a list reference at all and would appear inconsistent. : : No, because there are zero commas. Squint and you can see them. :-)
Actually, () has -1 commas, which is why it's not ambiguous. Rather, it's ($x) that has zero commas, so it's naturally ambiguous, and thus must depend on context to determine whether to produce a scalar or a list value. Seriously, () is just a special token. We could easily have used a special token like NULLLIST instead. What does INTERCAL use? Larry