question on 10.9

23 views
Skip to first unread message

Eric Pederson

unread,
Jan 4, 2013, 11:40:43 PM1/4/13
to fp...@googlegroups.com
In the function:

(def result
        (with-monad error-monad
              (domonad [big-number (factorial -1)
                        even-bigger (* 2 big-number)]
                        (repeat :a even-bigger))))

Is :a correct?

If I use a legit number as an argument to factorial then there is no result.

Thanks,

Eric Pederson

unread,
Jan 5, 2013, 11:49:00 AM1/5/13
to fp...@googlegroups.com
Actually after resetting my Light Table repl it gives me the error:

java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.Number


-- Eric


--
You received this message because you are subscribed to the Google Groups "fp-oo" group.
To post to this group, send email to fp...@googlegroups.com.
To unsubscribe from this group, send email to fp-oo+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/fp-oo/-/ziOP7YgunEUJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Brian Marick

unread,
Jan 7, 2013, 2:55:27 PM1/7/13
to fp...@googlegroups.com
It should be `(repeat even-bigger :a)`, so that you get something like this:

user=> (repeat 333 :a)
(:a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a :a)
user=>

Sorry about that.
> --
> You received this message because you are subscribed to the Google Groups "fp-oo" group.
> To post to this group, send email to fp...@googlegroups.com.
> To unsubscribe from this group, send email to fp-oo+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msg/fp-oo/-/ziOP7YgunEUJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--------
Occasional consulting on programming technique
Contract programming in Ruby and Clojure
Latest book: /Functional Programming for the Object-Oriented Programmer/
https://leanpub.com/fp-oo

Reply all
Reply to author
Forward
0 new messages