develooper Front page | perl.perl5.porters | Postings from August 2001

SV: marking can() coderef as a method

Thread Previous
Arthur Bergman
August 23, 2001 11:18
SV: marking can() coderef as a method
Message ID:

> hi all...
>   I thought it might be genuinely useful to mark a coderef returned by
> UNIVERSAL::can() as being a method so that XS routines can know whether to
> use perl_call_method or perl_call_sv on it.  
>   please forgive me if I misunderstand the purpose of CvMETHOD_on - I
> scoured the archives but could only find a smattering of information and I'm
> probably a bit out of my league here anyway... 
> --Geoff
> this patch is against the current bleedperl available from rsync - a clean
> build passes all tests on my system.

This seems logical but unnecessary.

When you have a coderef, why not just call perl_call_sv and push the object as the first argument. Since can already found the correct method, we don't need to search again using call_method.

I also wonder why you want to know it is a method, you cannot call it unless you have an object connected to it, and then you already know it is a method.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About