Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

The main reason it was implemented is because people have wanted this for at least a decade. And wanted it badly. There have been some very heated arguments about this operator (and its name, anyone remember the ||| and ?? suggestions?) in the past.

If the idea behind the feature that ~~ represents existed this long, it would have too. It is new, though. However, it gives us given/when and THAT has also been wanted for a very long time. Just see Google Groups and our own Perl Monks for proof. In fact, I think a switch statement has been asked for/about much more often than defined-or.

I read your "see no reason why it couldn't be implemented in current Perl" as being such a suggestion.

I was evaluating the technical possibility, not implying that it SHOULD be done.

Well, you saw no reason why it couldn't be implemented in current Perl - but I did. And that's the reason.

It could, but it probably won't.

Or, well, I asked xmath if it would be easy to implement ~~ so that it called a perl side sub. This would enable me to do the comparisons themselves in Perl, probably reusing some logic from Switch.pm. (Consider File::Glob.) xmath answered my question by saying it wouldn't be a great deal of work, and my gut says he's already started working on it even though I haven't asked for the actual implementation yet :)

And he brought up an improbable but existing clash: foo~~bar is now foo(~~bar). But I think we should just strongly state that scalar should be written as scalar instead of ~~ ;) (Those who really want to use ~~ for the first argument of a function, can use + or parens to disambiguate.)

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }


In reply to Re^6: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5? by Juerd
in thread (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5? by blazar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 16:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found