If you can do that, why not return the literal representation of the type hinted function?
For the repl you could provide a function that interns the type-hinted function into the namespace by evaluating the literal representation first. >From there it's easy to provide something like slamhound. Once you're certain types have been provided to your namespace correctly at the repl, run 'lein type <namespace>' to type hint everything in the namespace by literally restructuring the file. Things type hinted with expressions would be tricky, but this could work (or you could just leave it alone): myfn (original) myfn-int myfn-long myfn-float etc.... On Thursday, August 29, 2013 6:40:16 AM UTC-5, Ambrose Bonnaire-Sergeant wrote: > > With Clojure the lines blur between compile time and runtime. > > The clearest way to put it is that type checking is explicitly called at > the REPL or in a unit test. Usually this is done during development > iterations or testing time. > > Re: performance improvements: Michael is correct. Interestingly Typed > Racket offers numeric optimisations, but leans heavily on Racket's > metaprogramming facilities to insert them automatically. There's potential > in Typed Clojure for *identification* of speed improvements, but not > actually inserting them. Typed Racket's "optimisation coach" comes to mind > in ways we can present this information ("put a type hint at line 10, col > 20 to get full speed..."). > > Thanks, > Ambrose > > > On Thu, Aug 29, 2013 at 6:03 PM, Christian Sperandio < > christian...@gmail.com <javascript:>> wrote: > >> Ok... >> >> Another question, the checking is done only once (while compiling) ? Or, >> it's done while the runtime? >> >> >> >> 2013/8/29 Michael Klishin <michael....@gmail.com <javascript:>> >> >>> 2013/8/29 Christian Sperandio <christian...@gmail.com <javascript:>> >>> >>>> Is there any perf improvement to use static typing in Clojure? >>> >>> >>> core.typed is not a compiler, it's a type annotation/checker implemented >>> as a library. >>> >>> If you are familiar with Erlang, it is to Clojure what Dialyzer is to >>> Erlang. >>> -- >>> MK >>> >>> http://github.com/michaelklishin >>> http://twitter.com/michaelklishin >>> >>> -- >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clo...@googlegroups.com<javascript:> >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> To unsubscribe from this group, send email to >>> clojure+u...@googlegroups.com <javascript:> >>> For more options, visit this group at >>> http://groups.google.com/group/clojure?hl=en >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to clojure+u...@googlegroups.com <javascript:>. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> -- >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clo...@googlegroups.com<javascript:> >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+u...@googlegroups.com <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+u...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.