Maybe start with lisp and just add {key: value key2: value2} syntax for tables? It'd be useful to get ruby-style keyword args for free, at least.
I spend a lot of time thinking about keyword args because I've been working on a lisp interpreter that supports them. Here's a webserver that is nice to read because of a crucial keyword arg (it starts with a colon):
http://github.com/akkartik/wart/blob/460565a2e0/064http-serv...
Like in python the keyword arg is always optional. You could delete it from this definition and it would behave the same.
In conclusion: please try to include python-style keyword args in your next language. You never know when they'll come in handy.
Or perhaps using some CLOS magic do to do this behind the scenes, e.g. no-applicable-method
http://www.lispworks.com/documentation/HyperSpec/Body/f_no_a...
[NB It's been a long time since I did much Lisp]
I wasn't aware of no-applicable-method; thanks for that pointer.
How does Python handle mixing order of specifying keyword args positionally and with a keyword?
>>> def foo(a=0, b=1, c=2): return [a, b, c];
...
>>> foo(34)
[34, 1, 2]
>>> foo(b=34)
[0, 34, 2]
>>> foo(b=34, 35)
File "<stdin>", line 1
SyntaxError: non-keyword arg after keyword arg
I chose instead to simply bind args by position after keyword args have been taken: wart> (foo :b 34 35)
(35 34 2)This is how Clojure hacks around keyword args, and altho destructuring kind of makes up for it, it's not that pretty. (It's not pretty in Ruby either) Hash table literals are a nice addition to Lisp but I think it's kind of ugly to use them for keyword args.