On Thursday, February 19, 2015 at 9:54:21 AM UTC-5, Tassilo Horn wrote:
>
> Cecil Westerhof <cldwes...@gmail.com <javascript:>> writes: 
>
> Hi! 
>
> > At the moment the following: 
> > (lucky-numbers 10000001) 
> > gives: 
> > AssertionError Assert failed: (<= upto (* 10 1000 1000)) 
> user/lucky-numbers 
> > 
> > But I would like the following to be executed: 
> > (lucky-numbers :no-max-check 10000001) 
> > 
> > ​How would I implement that? 
>
> Just make an optional argument, e.g., 
>
> (defn lucky-numbers 
>  ([upto] 
>   (lucky-numbers false upto)) 
>  ([no-max-check upto] 
>   {:pre [(if no-max-check true (<= upto (* 10 1000 1000)))]} 
>   ;; code as before 
>   )) 
>

Why not (or no-max-check (<= upto (* 10 1000 1000)))? 

-- 
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/d/optout.

Reply via email to