Re: Lisp/Unix impedance [a programming challenge]



David Steuber <david@xxxxxxxxxxxxxxxxx> writes:

> However, how do you explain this oddity in a language that
> values the principle of least surprise?

I'll be surprised if Perl is such a language.

> $ perl -e 'print "true\n" if ("1" == 1);'
> true

$ perl -we 'print "true\n" if ("1 apple" == "1 orange");'
Argument "1 orange" isn't numeric in numeric eq (==) at -e line 1.
Argument "1 apple" isn't numeric in numeric eq (==) at -e line 1.
true
.



Relevant Pages

  • Re: print(true and true) #=> the parenthesis issue
    ... "What happened to the principal of least surprise? ... Your suggestive remarks are irritating at best. ... "principle of least surprise" because different expectations, patterns, ... It's fundamental - to good reason ...
    (comp.lang.ruby)
  • Re: Why Does Hash Apparently Reorder Its Internal Representation And Other Associated Ponderings
    ... You also accused it of not following the PoLS, ... context around it and then proclaim "this is not a bold statement." ... language well, then the language will cease to surprise you. ...
    (comp.lang.ruby)
  • Re: OT/ Hidden racial bias
    ... Now, let's see, did I say it was a surprise or weird? ... I find that, about language, and about cultures, great fun. ... been somehow ruined for discussion because inadvertent racist language was ... I'd be quite surprised if most here were grudge ...
    (alt.support.diabetes)
  • Re: ruby gnome question
    ... > Joe Van Dyk wrote: ... Is that the principle of Matz's least surprise ... One of the most basic facts you learn ...
    (comp.lang.ruby)
  • Re: print(true and true) #=> the parenthesis issue
    ... "What happened to the principal of least surprise? ... "principle of least surprise" because different expectations, patterns, ... I have seen it used in the game Wesnoth and what this basically means it ... But I am no language designer. ...
    (comp.lang.ruby)