Re: Clojure(Script) web apps in 2018

2018-09-20 Thread Matching Socks
Most of the choices are, or can be, wrappers around at least one battle-tested server - Jetty, Netty, Tomcat, etc. If you care, then decide that first. If you don't care, then how about Jetty. Next: if Jetty, then you will wind up in Pedestal sooner or later, so why not start there.

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

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

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

Still loving the lein-test-refresh

2018-09-20 Thread Alan Thompson
Just tried the test selector feature, which lets you use metadata to mark only some tests to be re-run when you are focusing on a specific part of the code. https://github.com/jakemcc/lein-test-refresh#built-in-test-narrowing-test-selector Loving it! Alan -- You received this message because

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. >

IF, WHEN or SOME

2018-09-20 Thread 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. #’user/some-numbers user=> (def evens? (partial (when (apply = (map even? some-numbers) #’user/evens? user=> (evens? (println “one”)) one