Re: Translation from CL - "On Lisp" program

2010-04-16 Thread Per Vognsen
On Fri, Apr 16, 2010 at 12:41 PM, Aravindh Johendran wrote: > Sorry, I shoulda been clearer.  By similar functionality, i meant a 20- > q game with > 1) the network implemented as closures and There are various ways you can do this while separating concerns. If you don't mind specifying the quest

Re: Translation from CL - "On Lisp" program

2010-04-16 Thread Aravindh Johendran
Sorry, I shoulda been clearer. By similar functionality, i meant a 20- q game with 1) the network implemented as closures and 2) code that doesn't have to hold state in a global datastructure The question wasn't about the easiest way to implement the game. State is unavoidable in many circumstanc

Re: Translation from CL - "On Lisp" program

2010-04-15 Thread Per Vognsen
What do you mean by "similar functionality"? Without using mutable state, you won't be able to retain the defnode-style interface. But obviously a twenty-questions program like this is easy to implement in a purely functional way: (defn ask [questions node] (let [data (questions node)] (asse

Translation from CL - "On Lisp" program

2010-04-14 Thread Aravindh Johendran
Is there a way to write this in clojure without java's hashmaps or clojure's atom/ref/var-binding/etc? The program doesn't have to be an exact translation. I just want similar functionality. -- >From chapte