Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: why does push not default to $_?

by LanX (Saint)
on Dec 06, 2008 at 02:43 UTC ( [id://728471]=note: print w/replies, xml ) Need Help??


in reply to Re^3: why does push not default to $_?
in thread why does push not default to $_?

> Then Perl isn't your forte. Perl was designed with the human mind and natural languages in mind - neither of which are consistent or orthogonal.

sorry thats a cheap argument. A natural language is not neccesarily inconsistent. Maybe you think this because your an English speaker, but I know plenty of languages which are far more consistent and orthogonal than English.

And if you read the whole thread, you will see that the behaviour of push depends on the prototype interface, which is surely not modelled after a human language!

Cheers Rolf

Replies are listed 'Best First'.
Re^5: why does push not default to $_?
by pobocks (Chaplain) on Dec 06, 2008 at 23:36 UTC

    Even fairly regular natural languages (Latin, for instance) tend to have large numbers of irregularities, tending to cluster around the most commonly used words/concepts.

    English is, of course, a particularly non-standardized language, but it is, as the poster suggests, modeled after English. Specifically, the "default to '$_'/'@_'" functionality is modeled after default pronouns in English, and is certainly a key concern of this thread.

    The "then perl isn't your forte" was kind of a cheap shot, though.

    I'm not sure how non-orthogonal it is for a built-in to choose not to default to $_, especially given that most of the built-ins that do default are unary, to my knowledge.

    for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";
      Specifically, the "default to '$_'/'@_'" functionality is modeled after default pronouns in English, and is certainly a key concern of this thread.

      sorry, maybe it's trivial, but what is the default pronoun in English?

      Cheers Rolf

        "Print, photocopy, and fax it" where the first two verbs are referring to "it". Not really sure if this works as a good example, though.

        I'm so adjective, I verb nouns!

        chomp; # nom nom nom

        It's not trivial, don't worry...

        There's no specific "Default pronoun" in English, per se -- it's more that, in certain circumstances, one of several English pronouns can be defaulted to (assumed). The most common of these is probably the implied "you" that imperative statements have, but there are other circumstances (None of which I can compose off the top of my head, because I'm sleep deprived. I'll try to think up some later.)

        for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";
Re^5: why does push not default to $_?
by JavaFan (Canon) on Dec 06, 2008 at 17:27 UTC
    Maybe you think this because your an English speaker, but I know plenty of languages which are far more consistent and orthogonal than English.
    Well, I'm not a native English speaker, but Larry Wall certainly is. And if any particular natural language was used to model Perl after, it was English, and not a more consistent and orthogonal language.
      look at the specs for perl6, it looks far more consistent than perl5, without loosing perl's "natural" features.

      Discussing the design decissions is certainly not for vain!

      Cheers Rolf

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-18 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found