develooper Front page | perl.perl6.language | Postings from March 2005

Re: does <> imply () or are pairs special?

Thread Previous
From:
Larry Wall
Date:
March 12, 2005 15:37
Subject:
Re: does <> imply () or are pairs special?
Message ID:
20050312233656.GA28769@wall.org
On Sat, Mar 12, 2005 at 09:40:46PM +0100, Juerd wrote:
:     %foo<bar>
: 
: is really
: 
:     %foo{'bar'}
: 
: and
:     :foo<bar>
: 
: is actually
: 
:     :foo('bar')

But it's not--it's actually

    :foo{'bar'}

What's happening is that :foo is using the subscript syntax oddly.

: naturally,
: 
:     :foo<bar>, 'baz'
: 
: is
: 
:     :foo('bar'), 'baz'

Nope,

    :foo{'bar'}, 'baz'

: but is
: 
:     reverse<bar>, 'baz'
: 
: then
:     
:     reverse('bar'), 'baz'

No, that's

    reverse{'bar'}, 'baz'

which makes sense only if reverse returns something that
can be hash subscripted.

: ? And if that is so, then is
: 
:     reverse <bar>, 'baz'
: 
: any different?

That's the same as

    reverse qw/bar/, 'baz'

Larry

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About