develooper Front page | perl.perl5.porters | Postings from October 2013

Re: Features and keywords versus namespaces and functions

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
October 24, 2013 12:27
Subject:
Re: Features and keywords versus namespaces and functions
Message ID:
20131024122744.24748.qmail@lists-nntp.develooper.com
Yves Orton wrote:
> Thanks. I like your proposal. A lot.

If we agree on something so readily, there must be some misunder-
standing. :-)

> The reason I left blessed untouched was that it was possible to bless
> things into a class which evaluated to false and blessed is supposed
> to return the classname, so we needed a way to tell apart the silly
> buggers from the rest.

It has never actually worked reliably.  With one line of code I can cause
all classes blessed into 0 to be blessed into ::0 instead.

And bless "\0" has not caused ref to return false since 5.16.

> If it is no longer possible to bless things into such a class then we
> could change the "false" return.
> 
> Alternatively we could split the blessed() functionality into two
> routines is_blessed() which returns a boolean, and blessed() which
> continues to return the classname.

We already have ref().  If blessed() returns true, then get the class
name from ref().


Thread Previous | Thread Next


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