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

Reply via email to