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

Re: $:attr vs $.:attr

Thread Previous | Thread Next
From:
Juerd
Date:
May 15, 2005 10:18
Subject:
Re: $:attr vs $.:attr
Message ID:
20050515171821.GN18368@c4.convolution.nl
Now:
	Declaration	Explicit	Implicit $_	$?SELF
	has $.var | 	$obj.var \	.var \		./var \
	has $:var |	$obj.:var \	.:var \		./:var \

Consistent:
 	has $.var \	$obj.var \	.var \		./var \
 	has $.:var \	$obj.:var \	.:var \		./:var \

See it yet? It's about consistency in the whole scheme, not the clarity
of a single element.

(I wouldn't mind if $:var was a shortcut syntax for $.:var, although we
will regret this when we think of an even better purpose for the colon
as a sigil.)

Note that it's not *implicit* $?SELF. "./" is a prefix operator that
calls a method on $?SELF, not an infix operator that when prefixly used
defaults to something. "./" is not like ".+" and friends. It cannot be
used infix, it does not default to anything. Read the two characters as
one.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

Thread Previous | Thread Next


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