On Aug 16, 2009, at 7:38 PM, Chas Emerick wrote:

On Aug 16, 2009, at 6:29 PM, Stephen C. Gilardi wrote:

Very cool! I like this a lot. Would you be up for writing some doc strings and including it in clojure.contrib.def?

Yeah, I could do that.

I don't actually think it's practical on its own, though. My one concern is that using two hinting syntaxes in parallel (e.g. s:String in defh forms, but #^String s everywhere else) is, to put it lightly, painful.

Good point.

What I might be able to do is define alternatively-hinted versions of let, for, doseq, etc., and rebind clojure.core/destructure during the evaluation of those macros so that the s:String style can get layered on top of binding forms (more) uniformly.

Feels hacky, though....thoughts?

My current favorite is a gen-class'd alternative to clojure.main that calls "bindRoot" on clojure.core/destructure to replace it with your customized version and then calls clojure.main. This way we can play with this pervasively both in the repl and in loaded code with the only tweak being calling your customized entry point instead of clojure.main.

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to