Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by JavaFan (Canon)
on Dec 06, 2008 at 02:33 UTC ( [id://728470]=note: print w/replies, xml ) Need Help??


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

I never said I want that push accepts a default second argument, I just want a consistent and orthogonal behaviour.
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. (BTW, my 'you' was a generic you, not specifically aimed at you).
It may be the occupational disease of a mathematician, but I just prefer a predictabel symmetry in logical systems!
Guido van Rossum is a mathematician as well. Hence Python. (This isn't meant as a jab at Python - far from it; Python is a nice language, it just has a different philosophy than Perl).

Replies are listed 'Best First'.
Re^4: why does push not default to $_?
by LanX (Saint) on Dec 06, 2008 at 02:43 UTC
    > 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

      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

      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://728470]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-03-29 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found