What happened to keyword arguments for 1.8?

  • Thread starter David Heinemeier Hansson
  • Start date
D

David Heinemeier Hansson

The pickaxe book speaks of keyword arguments planned for 1.8:

"Some languages feature ``keyword arguments''---that is, instead of
passing arguments in a given order and quantity, you pass the name of
the argument with its value, in any order. Ruby 1.6 does not have
keyword arguments (although they are scheduled to be implemented in
Ruby 1.8)."

Since "New & Shiny" [1] didn't speak of it, I reckon it didn't make it.
So is this scheduled for a 1.8.x release, postponed to 2.0, or dropped
altogether?


[1] http://www.whytheluckystiff.net/articles/2003/08/04/rubyOneEightOh


/ David
 
W

why the lucky stiff

This is still listed in doc/ToDo:

* named arguments like foo(nation:="german") or foo(nation: "german").

Over a year ago, there was a popular RCR
[http://www.rubygarden.org/article.php?sid=217] which provided the
second syntax above by mandating a general shortcut to symbols used as
Hash keys. This RCR has yet to be accepted/rejected.

Matz has looked into it and found it to be more difficult than expected.
[ruby-talk:19912]. I'm guessing he means fitting such syntax into the
current parser.

_why
 
G

Gavin Sinclair

The pickaxe book speaks of keyword arguments planned for 1.8:
"Some languages feature ``keyword arguments''---that is, instead of
passing arguments in a given order and quantity, you pass the name of
the argument with its value, in any order. Ruby 1.6 does not have
keyword arguments (although they are scheduled to be implemented in
Ruby 1.8)."
Since "New & Shiny" [1] didn't speak of it, I reckon it didn't make it.
So is this scheduled for a 1.8.x release, postponed to 2.0, or dropped
altogether?


If you're writing some code that would benefit from keyword arguments,
or just want to experiment, check out

http://www.rubygarden.org/ruby?KeywordArguments

Gavin
 
Y

Yukihiro Matsumoto

Hi,

In message "What happened to keyword arguments for 1.8?"

|"Some languages feature ``keyword arguments''---that is, instead of
|passing arguments in a given order and quantity, you pass the name of
|the argument with its value, in any order. Ruby 1.6 does not have
|keyword arguments (although they are scheduled to be implemented in
|Ruby 1.8)."

Not in 1.8. There are more issues to consider. The experiment will
take place in 1.9 series.

matz.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top