my $x = new Proxy: FETCH => { foo() }, STORE => { bar($^new) };
$x ~~ Proxy; # true
$x = 42; # neither foo nor bar called
$x ~~ Num; # true
my $y := new Proxy: FETCH => { foo() }, STORE => { bar($^new) };
$y ~~ Proxy; # false (unless foo returns a Proxy object)
$y = 42; # bar(42) called
$y ~~ Proxy; # still false (unless foo returns a Proxy object)
say $y; # foo() called
Correct?
BTW, is it possible to implement the Proxy class in pure Perl? (I don't
think so.)
--Ingo
--
Linux, the choice of a GNU | Row, row, row your bits, gently down the
generation on a dual AMD | stream...
Athlon! |
It would have to be possible, because Perl 6 will be written in Perl 6.
(I like that Perl 6 will be written in Perl 6, because as Perl 6 is very
fast, Perl 6 will probably be fast too. We don't need C for speed ;))
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
I don't like how Python is will be written in Python. Since Python is
very slow, Python will probably be slow too. :-)
Luke