As much as I'm not for it, would
having
sub foo :method {} # In objects vtbl
and
sub foo {} # only if procedural call
being a valid construct and having perl dispatch appropriately, be
viable?
<chaim>
>>>>> "GB" == Graham Barr <[EMAIL PROTECTED]> writes:
GB> However, if for method calls the object is moved out into $ME (or whatever)
GB> then this could be an advantage to a dual API. For example
GB> sub i_dont_care_sur_or_method {
GB> # just process @_, ignore $ME
GB> }
GB> sub dual_api {
GB> my $me = ref($ME) ? $ME : $default_obj; # Pkg->dual_api is same as sub-call
GB> # process
GB> }
GB> So I am hoping that we get the object removed from @_ into an predefined
GB> lexical so the sub can more easily determine how it was called with
GB> little expense.
--
Chaim Frenkel Nonlinear Knowledge, Inc.
[EMAIL PROTECTED] +1-718-236-0183
- Re: How to implement both object->method a... Graham Barr
- Re: How to implement both object->method a... Bart Lateur
- Re: How to implement both object->method a... Hildo Biersma
- Re: How to implement both object->method a... Bart Lateur
- Re: How to implement both object->method a... Graham Barr
- Re: How to implement both object->method a... Graham Barr
- Re: How to implement both object->method a... Bart Lateur
- Re: How to implement both object->method and module... John Berthels
- Re: How to implement both object->method and m... Jonathan Scott Duff
- Re: How to implement both object->method a... Graham Barr
- Re: How to implement both object->method a... Chaim Frenkel
- Re: How to implement both object->method a... Graham Barr
- Re: How to implement both object->method a... Chaim Frenkel
- Re: How to implement both object->method a... Graham Barr
- Re: How to implement both object->method a... John Berthels
- Re: How to implement both object->method a... Tim Bunce
- Re: How to implement both object->method a... Michael Fowler
- Re: How to implement both object->method a... Graham Barr
- Re: How to implement both object->method a... David L. Nicol
- Re: How to implement both object->method a... Tim Bunce
- Re: How to implement both object->method a... Graham Barr
