Calling functions with keyword args

28 views
Skip to first unread message

Anthony Grimes

unread,
May 16, 2012, 12:38:48 AM5/16/12
to clojure...@googlegroups.com
I'm currently rewriting my little refh (a command line tool for pasting to refheap) tool from Ruby to clojure-py, and I've hit a bit of a road block.
Apparently I don't know how to write code. ;)

http://docs.python.org/library/argparse.html#module-argparse in these examples, several functions/methods take keyword arguments.
Furthermore, even some of the classes are instantiated with keyword arguments. I can't for the life of me figure out how to work with
this code. Are there any examples of this sort of thing lying around?

Antony Lee

unread,
May 16, 2012, 1:54:12 AM5/16/12
to clojure...@googlegroups.com
There is a kwapply function which works like apply but takes a map as a second argument.
(kwapply py/print {"sep" ";" "end" "end"} 1 2 3) => 1;2;3end
Antony

2012/5/15 Anthony Grimes <discip...@gmail.com>
Reply all
Reply to author
Forward
0 new messages