Skip to content

Comment on Keyword Arguments: Ruby, Clojure, Common Lisp

Comments

Isn't being able to give functions as a default keyword argument more or less obvious when functions are first-class objects instead of it being insane? It's something that I use several times in any decent sized project.

For my bot for the current Google AI challenge I use A* pathfinding and one of the keyword args is the function for getting a node's neighbours.

Yes, all these languages support that. My CL is rusty, and it's not clear from the article, but I think he's talking about providing a function to calculate the default value from some of the other args.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.