Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (def prime?
- (fn [x]
- (loop [y 2]
- (if (< y x)
- (if (== (mod x y) 0)
- false
- (recur (inc y)))
- true))))
- (def primes
- (fn [max]
- (take-while (fn [x] (< x max))
- (filter prime? (iterate inc 0)))))
- When I try and paste (primes) as is, it cut off at the middle of take while, but if I paste it as one line it properly reads it as a whole block of code
- Pasting with newlines:
- user=>
- (def primes
- (fn [max]
- (take-while (fn [x] (< x max))
- user=> (filter prime? (itereate inc 0)))))
- CompilerException java.lang.RuntimeException: Unable to resolve symbol: itereate in this context, compiling:(NO_SOURCE_PATH:64:32)
- Pasting without newlines:
- user=> (def primes (fn [max] (take-while (fn [x] (< x max))(filter prime? (iterate inc 0)))))
- #'user/primes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement