From: attriel [mailto:[EMAIL PROTECTED]] > > >> > >I think what Jonathan asked for was an operator for > >> > >returning a method (as an object) which can be invoked > >> > >later with some arguments (or even applied with a > >> > >partial list of arguments for currying). > >> > > > >> > >This would be a lot more useful than a yes-or-no > >> > >answer about the existence of a method. > > > > Exactly. 'Yes' might be valid one moment, and invalid the > > next. Not a very useful operation... Returning a coderef > > on the other hand is useful. > > Er. How could "Is it possible to call this method" become > invalid, but the fptr remains valid? I'm not sure that I > follow that ...
Perhaps I'm misunderstanding Dan's meaning when he talks of invalidating method handles. In Perl5: package Foo; sub bar { print "hello world\n" } package main; my $cref = Foo->can('bar'); undef *Foo::bar; Foo->$cref(); Foo->bar(); 1; would result in: hello world Can't locate object method "bar" via package "Foo" (perhaps you forgot to load " Foo"?) at [...] line 7. As you can see, this is something you can do this in Perl5. And as Perl6 is supposed to be able to run Perl5... I'd think this'd be something parrot'd be required to support. -- Garrett Goebel IS Development Specialist ScriptPro Direct: 913.403.5261 5828 Reeds Road Main: 913.384.1008 Mission, KS 66202 Fax: 913.384.2180 www.scriptpro.com [EMAIL PROTECTED]