Re: IF, WHEN or SOME

2018-09-20 Thread Carlo Zancanaro
Hey Stephen, On Fri, Sep 21 2018, Stephen Feyrer wrote: user=> (def some-numbers ‘(2 4 6 8)) #This is my value to test later. #’user/some-numbers At this point we have some-numbers = '(2 4 6 8) user=> (def evens? (partial (when (apply = (map even? some-numbers) #’user/evens? Let's w

Re: IF, WHEN or SOME

2018-09-20 Thread Paul Rutledge
I haven't used them much myself but the idea of "reified control flow" is called a continuation . Some other lisps implement continuations, Clojure does not. I'm sure there's plenty of material out there about why Clojure/Rich did not provide continua

Re: IF, WHEN or SOME

2018-09-20 Thread Alan Thompson
Should have been:(evens? nil) On Thu, Sep 20, 2018 at 1:47 PM Alan Thompson wrote: > `println` always returns `nil`. So it prints "one", returns `nil`, and > you try to execute the form: > > (nil) => NullPointerException > > > user=> (evens? (println “one”)) > one > NullPointerException

Re: IF, WHEN or SOME

2018-09-20 Thread Alan Thompson
`println` always returns `nil`. So it prints "one", returns `nil`, and you try to execute the form: (nil) => NullPointerException user=> (evens? (println “one”)) one NullPointerException user/eval239 (NO_SOURCE_FILE:74) On Thu, Sep 20, 2018 at 9:06 AM Orestis Markou wrote: > evens? is no

Re: IF, WHEN or SOME

2018-09-20 Thread Orestis Markou
evens? is not a macro, therefore when you do (evens? (println “one”)), the println will be evaluated first, and its return value, nil, gets passed into the evens function. 20 Σεπ 2018, 5:44 μμ, ο χρήστης «Stephen Feyrer » έγραψε: > Hi, > > I have just been playing around with this idea and

Re: IF, WHEN or SOME

2018-09-20 Thread Orestis Markou
In addition, when is a macro, so I don’t think you can call partial on it :) 20 Σεπ 2018, 5:44 μμ, ο χρήστης «Stephen Feyrer » έγραψε: > Hi, > > I have just been playing around with this idea and I got something. > > user=> (def some-numbers ‘(2 4 6 8)) #This is my value to test later. > #’us

Re: IF, WHEN or SOME

2017-12-11 Thread Stephen Feyrer
Hi Tim, Thank you. -- Kind regards Stephen. On 11 December 2017 at 23:58, Timothy Baldridge wrote: > I talked a bit about this in my video on Boolean Blindness: https://www. > youtube.com/watch?v=K1LaaJMscCc > > Might be worth a watch. > > On Mon, Dec 11, 2017 at 4:56 PM, Stephen Feyrer > w

Re: IF, WHEN or SOME

2017-12-11 Thread Timothy Baldridge
I talked a bit about this in my video on Boolean Blindness: https://www.youtube.com/watch?v=K1LaaJMscCc Might be worth a watch. On Mon, Dec 11, 2017 at 4:56 PM, Stephen Feyrer wrote: > Hi there, > > I have been trying to shake this thought for a while now. Essentially, my > thought was if you