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

Re: RFC: changing behavior of defined() and exists()

Thread Previous | Thread Next
Michael G Schwern
October 17, 2003 08:22
Re: RFC: changing behavior of defined() and exists()
Message ID:
On Fri, Oct 17, 2003 at 08:38:09AM -0500, Johnson, Roy wrote:
> Thanks for considering my proposal. There were a few issues raised that
> I will address here, even though I understand that it's not going to be
> implemented (at least not anytime soon).

I want to go straight to the heart of the problem.  Where's the use case?

Take dor, for example.  There is a clear and widespread problem its
solving.  People write this all the time:

	$foo ||= "bar";

when they really mean this:

        $foo = "bar" unless defined $foo;

but since that's too long people get sloppy.  dor provides a nice, neat

        $foo //= "bar";

With your thing, its (I think):

	defined($foo ||= "bar");

which is nearly as involved as the current way to do it.  Its not
solving the big problem as well as dor.  Big strike against.

While your idea may be more flexible, flexibility is a means, not an end. 
Will that flexiblity be used?  What widespread problem is it going to solve 
that dor does not?  What's the use case?

Michael G Schwern
Don't be a lover, girl, I'd like to shamelessly hump your inner child.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About