Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^7: When every microsecond counts: Parsing subroutine parameters

by educated_foo (Vicar)
on May 19, 2008 at 01:47 UTC ( [id://687271]=note: print w/replies, xml ) Need Help??


in reply to Re^6: When every microsecond counts: Parsing subroutine parameters
in thread When every microsecond counts: Parsing subroutine parameters

And yet, other than tcl, I can't find reference to a single other language that has felt the need to implement named parameters?
I can think of Common Lisp, Ruby, and Python off the top of my head...
  • Comment on Re^7: When every microsecond counts: Parsing subroutine parameters

Replies are listed 'Best First'.
Re^8: When every microsecond counts: Parsing subroutine parameters
by BrowserUk (Patriarch) on May 19, 2008 at 03:00 UTC

    1. Ruby has to fake keyword args using a hash just like perl.
    2. Python has proper keywork args.

      I just never got into Python enough to reach the point where I would have noticed. (Seems it wasn't implemented until v2 anyway and thats probably after I last looked at it.)

    3. Lisp in all its many forms does my head in.

      I believe that keyword arguments are considered an extension. Still, that is implemented, so I defer.

      Just be really careful that you don't need to pass a value that looks like a keyword (eg:xxx), because things get really confusing really fast.

    So that makes 3. Four if you count Perl 6.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Just for the sake of completeness, we get to five if you count R, which allows one to intersperse positional and named parameters in a remarkably laissez-faire manner. It's not exactly a general-purpose language, though.
      I believe that keyword arguments are considered an extension. Still, that is implemented, so I defer.
      Assuming you're talking about Common Lisp, keywords alone and keywords as argument specifiers are AFAIK both required parts of the spec, not just optional extensions. Other Lisp dialects can and do have different ideas - the only other relatively widely used Lisps, these days, are Scheme and Emacs Lisp (which both don't have keyword args).

        I drew the inference from this page which carries the title (See your browser title bar), of "Common Lisp Extensions".

        I defer because I've no idea when that page was current and if it has been superceded. And because I know very little about Lisp. What little I've ever done was done a long time ago. I've played with Scheme more recently, but that's chalk and cheese.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

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

    No recent polls found