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

SV: marking can() coderef as a method

Thread Previous
From:
Arthur Bergman
Date:
August 23, 2001 11:18
Subject:
SV: marking can() coderef as a method
Message ID:
016d01c12c00$f7498fe0$052aa8c0@foo


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

Arthur


Thread Previous


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