{ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-13 Thread dennis zhuang
Hi , i am pleased to introduce defun : a beautiful macro to define clojure functions with pattern match. Some examples: (defun say-hi ([:dennis] "Hi,good morning, dennis.") ([:catty] "Hi, catty, what time is it?") ([:green] "Hi,green, what a good day

Re: Schrodinger's cat in clojure?

2014-09-13 Thread cees van Kemenade
Thanks Stu & Lee, I will be more careful next time I order a cocktail in a bar. I wasn't aware that pr-str depended on *out*, as it could be implemented as a pure function, without this harmful mixing effect. I guess pr-str is used to get something in edn-shape without (yet) going to the none-

Designing API for a Markov Model

2014-09-13 Thread RJ Nowling
Hi all, I'm new to Clojure and implementing a Markov Model as part of a larger project. I'd like some advice on the API for a progress-state function. I see two possible options. In the first option, we always ask the user to provide and keep track of the MSM state themselves: (progress-stat

Re: jetty restart failing

2014-09-13 Thread Wilker
I forgot to post before, here is the actual error: BindException Address already in use sun.nio.ch.Net.bind0 (Net.java:-2) Also, adding a (Thread/sleep 1000) seems to increase the success rate, but would be nice to be able to really wait on Jetty to shutdown instead of using arbitrary sleep. Th

jetty restart failing

2014-09-13 Thread Wilker
Hi, I'm trying to apply the ideas from the component library: https://github.com/stuartsierra/component My problems is being about stop/start the Jetty server, for that purpose I created this component: (defrecord WebServer [app port join? jetty log] component/Lifecycle (start [c]

Re: Schrodinger's cat in clojure?

2014-09-13 Thread Lee Spector
A man walks into a bar and says "I used lazy evaluation and things were confusing." Bartender says "You might have mixed it with I/O, but then again maybe you're getting tripped up by other some other not-purely-functional aspect of your program or the JVM, like GC or thread transitions." Ok

Re: Schrodinger's cat in clojure?

2014-09-13 Thread Stuart Halloway
A man walks into a bar and says "I used lazy evaluation and things were confusing." Bartender says "You mixed it with I/O" without bothering to look at the code. :-) Your experiment uses pr-str, which uses a dynamically scoped resource *out* in order to create its result. Your observation uses p

Schrodinger's cat in clojure?

2014-09-13 Thread cees van Kemenade
By watching (println) the experiment we influence the outcome. Is the Schrodinger's cat present in Clojure? This example program that shows how printing a value can change the value under specific circumstances. It seems the case that it has to do with the lazy evaluation that happen in Clojure

Re: Is Transit / core.async suitable for remote function invocation?

2014-09-13 Thread Matthias Nehlsen
Sente works really well, I am using it in the Clojure rewrite of an application and I am using it to call functions on the server from the client by putting messages on core.async channels. I am even using it to get around the current limitation on the ClojureScript side that there's no *pprint

Re: (Request) Rich Hickey's EuroClojure 2014 slides

2014-09-13 Thread Andy L
Thank you. BTW, I really liked Clojure/West video editing style. Andy On Fri, Sep 12, 2014 at 8:55 AM, John Gabriele wrote: > A format I particularly like is when there's simply one video file where: > > * the main portion of the window shows the slides, > * a small thumbnail-size portion s