On Sep 10, 2008, at 2:08 PM, Rich Hickey wrote:

It would work, but it seems like overkill. In particular, there's no
intention to extend it any further, and all symbol versions do the
same thing, call find-ns and delegate, so maybe just adding a let
level to the existing fns is best:

(let [ns (the-ns ns)] ...)

where the-ns x is just (if (instance? Namespace x) x (find-ns x))

That looks good. Thanks for the advice. I adopted it in the enclosed patch.

These are the changes it makes to boot.clj:

add private the-ns
change to allow namespace arguments to be either a namespace or a symbol in ns-*
change to lispy syntax for java calls in ns-* and find-ns, create-ns, remove-ns, all-ns

I made the last change for consistency and brevity--moving to the more modern syntax while I was in this code. I can give you a patch that excludes that change if you prefer.

I've tested all the modified functions and worked with the new behavior a little. Using these functions feels more flexible after the change. Please consider adopting this patch.

--Steve

Attachment: ns-symbol.patch
Description: Binary data

Reply via email to