On Sat, 21 Sep 2002 16:33:31 -0600 (MDT), Luke Palmer said: > You know, the idea that square brackets are the only things that can > make lists is starting to really appeal to me. Similar for squiggles > and hashes. I don't know how many times in my early Perl5 days I did > this:
> Since we now have an explicit flattening operator (unary *), there's
> no need to differentiate between a "real" list and a reference to one.
> We
> could extend it to sub calls:
>
> print["foo ", "bar"];
>
> But that would look like Mathematica, which would be creepy. It would
> be good to keep parens in sub calls (and declarations), but the
> details on how that unifies are wrinkly. Of course, they were never
> ironed anyway:
>
> print "foo ", "bar";
>
> So parens really do provide grouping, not list constructing. Thus,
> this can stay:
>
> print("foo ", "bar");
>
> It also provides a really nice visual clue: If and only if you see
> [], there's a list creeping around. Before, the "and only if" could
> not be included.
>
> Sure, it's not clean yet, but I presume it could be. Objections?
> Suggestions? Obsessions?
I really really like this. The list/precedence ambiguity can sometimes
cause some really nasty confusion... and there's something to be said
for matching the array-construction symbol with the array-lookup one,
and hash-construction with hash-lookup as well.
P.S. Delurk.
msg10771/pgp00000.pgp
Description: PGP signature
