Re: $ME in a method called as a subroutine

[email protected] (Piers Cawley)
Newsgroups perl.perl6.language.objects
Message-ID <[email protected]>
Markus Peter <[email protected]> writes:

> --On 22.08.2000 18:24 Uhr +0000 David L. Nicol wrote:
> 
> >
> > Regardless of what its called, in a method called as a subroutine,
> > the variable could refer to the last instance of this kind of object
> > used by this thread.
> 
> Hmm.... Does that mean if I once all $obj->method() and then afterwards
> somewhere else obj::method() then $ME or whatever it is called still holds
> $obj ? If yes, why? I can imagine _some_ cases where that's useful, 
> especially if someone is sloppily mixing procedural and object oriented 
> programming, but I can also imagine many more cases where it adds 
> confusion.
> 
> In my opinion the contents of $ME should allow to determine wether it was 
> called as a procedure or as a method, the easiest way to do that is undef 
> for procedure, object for method and classname for class methods.

Procedure reference for a procedure call please. It makes for some
nice wins with anonymous subroutines...

-- 
Piers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.