http://www.perlmonks.org?node_id=533299


in reply to Re^8: Why Perl 6 is taking so !@#$ long
in thread Why Perl 6 is taking so !@#$ long

Not sure if there is a little sarcasm in that message or not, but I'll assume there isn't.

I would say it has nothing to do with computers, and much to do with programming languages, or at least Perl. Obviously, a large part of Perl's attraction is DWIM, which to me implies intuition, at least to a point.

Not knowing that "err" is "defined OR", my first thought would be that it had something to do with exceptions. The definition of the word implies that it has something to do with errors.

While expressions in programming languages and human languages often don't match up, they more often do. "do, if, else, and, or, etc, not, while, use, etc".

Seems like it should have been more appropriately named defor, dor, whatever.


-Lee
"To be civilized is to deny one's nature."

Replies are listed 'Best First'.
Re^10: Why Perl 6 is taking so !@#$ long
by Fletch (Bishop) on Feb 28, 2006 at 14:37 UTC

    And maybe a defined or specifically for hashes, doh (which again is getting back into error-related-sounding-words territory :).

    Update: Not to be confused with D::oh, of course. :)

      Well it's certainly less so than "err". Suprisingly, not everyone is a Simpsons fan.

      -Lee
      "To be civilized is to deny one's nature."
Re^10: Why Perl 6 is taking so !@#$ long
by duff (Parson) on Feb 28, 2006 at 15:30 UTC
    Not knowing that "err" is "defined OR", my first thought would be that it had something to do with exceptions. The definition of the word implies that it has something to do with errors.

    It sounds like your intuition is working just fine to me. Isn't that how err will be used? Isn't that how or is used now? (And since or is slightly wrong, err is introduced to pay attention to definedness rather than truth)

    BTW, what does your intuition tell you about //? And why? Intuition comes from experience and is specific to the tool you're using. A C++ programmer would intuit that // introduces a comment. A Perl programmer has no such intuition. A Perl programmer might think it has something to do with the other doubled-character operators, &&, and || (or just be confused and have to look it up :).

      Something being undefined is not necessarily an error. More along the lines of false, not wrong IMHO.

      I think // is a bit different. I did come from a C/C++ background and it's use made it fairly obvious that it wasn't a comment. Err binds a bit tighter in the way that most people think.The fact that 69 distributions on CPAN currently define a sub named err should say something.

      -Lee
      "To be civilized is to deny one's nature."

        Many routines in the perl world return undef to designate a failure of some sort. This usage is not false in the sense of "opposite of true", but it is exceptional.

        The fact that 69 distributions on CPAN currently define a sub named err should say something.
        Yeah! That there's need of some standardization. Perl6ism to the rescue! ;-)

        update: BTW, read the Read or Die section of Exegesis4.

      And that's why I suggested that err be made into a very local try/CATCH block. It keeps the same mnemonics (deals with the "error" produced by the LHS), but does so in an actually exception oriented way.