in reply to Consistency, syntax, and little minds

IIRC Perl6 does this. Or maybe that was some other language I was looking at recently. Certainly it's a good idea - what else could a programmer have meant if he passes a reference to an array?

It's just one of those things in Perl5 that could and should be tweaked, like the 'No comma after filehandle in print statement' error. If perl can detect the problem, why can't it do what I want? (The answer, of course, is that I haven't gotten off my arse and patched perl).

____________________
Jeremy
I didn't believe in evil until I dated it.

  • Comment on Re: Consistency, syntax, and little minds

Replies are listed 'Best First'.
Re: Re: Consistency, syntax, and little minds
by diotalevi (Canon) on Oct 03, 2002 at 03:20 UTC

    Well I guess I didn't want to bring it up but the lines between parentheses and square brackets are being seriously blurred in perl6. Read this longish thread for the full scoop. It's still waiting for a ruling from Larry but in general lists treated as scalars return array references and array references treated as lists dereference themselves.

    http://www.perl.com/pub/a/2002/09/p6pdigest/20020929.html?page=2

    __SIG__
    printf "You are here %08x\n", unpack "L!", unpack "P4", pack "L!", B::svref_2object(sub{})->OUTSIDE