Oups :) Should have read twice :)
> He did say, compile-time error. These errors are at run-time - that > is, the following is just as obviously bad, but generates no warning > until bar is called: > > (defn foo [x] 1) > > (defn bar [y] (foo y 1)) ;; compiles fine > > (bar 5) ;; throws runtime exception > > On Apr 21, 5:14 pm, Softaddicts <lprefonta...@softaddicts.ca> wrote: > > ???? > > > > user=> (defn a [x y] x) > > #'user/a > > user=> (a 1) > > java.lang.IllegalArgumentException: Wrong number of args passed to: user$a > > (NO_SOURCE_FILE:0) > > user=> (a 1 2) > > 1 > > user=> (a 1 2 3) > > java.lang.IllegalArgumentException: Wrong number of args passed to: user$a > > (NO_SOURCE_FILE:0) > > user=> > > > > user=> (defn b [x & ys] x) > > #'user/b > > user=> (b 1) > > 1 > > user=> (b 1 2) > > 1 > > user=> (b) > > java.lang.IllegalArgumentException: Wrong number of args passed to: user$b > > (NO_SOURCE_FILE:0) > > user=> > > > > Where's the missing arity validation you are referring to ? > > > > Luc > > > > > > > > > > > > > > > > > > > > > Looks interesting. > > > > > Personally I always thought clojure's handling of function arity is a > > > bit strange. I don't understand why calling a function like this > > > > > (defn testfn [one two] ...) > > > > > (test-fn 1) > > > > > is not at least a compiler warning, possibly with a switch for the > > > compiler for strict checking. I understand that it is not always > > > possible to perform this check, but why not do it when possible? It > > > would make clojure alot safer to use without a test suite covering > > > every code path. > > > > > On Apr 20, 8:50 pm, Ambrose Bonnaire-Sergeant > > > <abonnaireserge...@gmail.com> wrote: > > > > Hi, > > > > > > I know there are a few people interested in trying Typed Clojure, > > > > so I've cut an early alpha release to give a taste. > > > > > > These are *very* early days, but looking through the readme will > > > > give you some hints as to what works in this release. Don't > > > > expect too much. > > > > > >https://github.com/frenchy64/typed-clojure > > > > > > Please give it a whirl, feedback welcome! > > > > > > Thanks, > > > > Ambrose > > > > > -- > > > 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 > > > > -- > > Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail! > > -- > 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 > -- Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail! -- 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