Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Binding and the Proxy class

8 views
Skip to first unread message

Ingo Blechschmidt

unread,
Apr 23, 2005, 1:42:33 PM4/23/05
to perl6-l...@perl.org
Hi,

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! |

Juerd

unread,
Apr 23, 2005, 1:56:46 PM4/23/05
to Ingo Blechschmidt, perl6-l...@perl.org
Ingo Blechschmidt skribis 2005-04-23 19:42 (+0200):

> BTW, is it possible to implement the Proxy class in pure Perl? (I don't
> think so.)

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

Luke Palmer

unread,
Apr 23, 2005, 5:11:21 PM4/23/05
to Juerd, Ingo Blechschmidt, perl6-l...@perl.org
Juerd writes:
> Ingo Blechschmidt skribis 2005-04-23 19:42 (+0200):
> > BTW, is it possible to implement the Proxy class in pure Perl? (I don't
> > think so.)
>
> 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 ;))

I don't like how Python is will be written in Python. Since Python is
very slow, Python will probably be slow too. :-)

Luke

0 new messages