Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: (tye)Re: A vexing list vs. scalar context question.

by japhy (Canon)
on Feb 01, 2002 at 02:06 UTC ( #142570=note: print w/replies, xml ) Need Help??


in reply to (tye)Re: A vexing list vs. scalar context question.
in thread A vexing list vs. scalar context question.

Perhaps ref() should return an overloaded string that returns true when compared to both the underlying reference type and the class owning the object?

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

  • Comment on Re: (tye)Re: A vexing list vs. scalar context question.

Replies are listed 'Best First'.
Re: Re: (tye)Re: A vexing list vs. scalar context question.
by chipmunk (Parson) on Feb 01, 2002 at 02:42 UTC
    Perhaps ref() should return an overloaded string that returns true when compared to both the underlying reference type and the class owning the object?
    Why? That's what UNIVERSAL::isa() is for. Or should the return value from ref() be an overloaded string that returns true when compared to the underlying reference type, or the class owning the object, or any of the super classes of the class owning the object? That seems an unnecessarily complicated solution to a problem that has already been solved.
Re: Re: (tye)Re: A vexing list vs. scalar context question.
by theorbtwo (Prior) on Feb 01, 2002 at 04:35 UTC
(tye)Re2: A vexing list vs. scalar context question.
by tye (Sage) on Feb 01, 2002 at 07:13 UTC

    No, ref() should completely ignore blessedness and there should be a blessed() function that returns false if the reference is not blessed, and the package it is blessed into if it is blessed.

    I've seen too many cases of practical code that wants to ask "is this blessed" and is force to jump through some pretty stupid hoops. The overloading of ref() to combine both reference type and blessedness state was a mistake from the start.

            - tye (but my friends call me "Tye")

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://142570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2019-06-19 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (83 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!