Re: Land of lisp to Clojure

2014-07-12 Thread Cecil Westerhof
2014-07-09 5:11 GMT+02:00 Timothy Baldridge : > Prefer vectors over quoted lists '(1 2) vs [1 2]. There's rarely a case > (outside of macros) that you want the former. > ​I did this mostly. The exception is: (def nodes { :living-room ['(You are in the living-room.) '(A

Re: Land of lisp to Clojure

2014-07-09 Thread John Mastro
Cecil Westerhof wrote: > I read a little about it. And no, I do not use dynamic binding. So I > probably should use atoms. Is there a convention how to name atoms? Nope, none that I've come across anyway. Dynamic variables can have very surprising effects if you're not aware you're dealing with t

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 10:38 GMT+02:00 Cecil Westerhof : > 2014-07-09 9:39 GMT+02:00 Cecil Westerhof : > > Or you could use a definition of look more like this, which uses println >> >>> to print each item on its own line (not sure if you wanted to retain the >>> parens or not, but both are easily doable). >>

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 9:39 GMT+02:00 Cecil Westerhof : > Or you could use a definition of look more like this, which uses println > >> to print each item on its own line (not sure if you wanted to retain the >> parens or not, but both are easily doable). >> >> (defn look [] >> (doseq [d [(describe-

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 5:30 GMT+02:00 John Mastro : > Cecil Westerhof wrote: > > - The book displays all the lines of a look on separate lines. In my > > case it is just one long line. Am I doing something wrong? > > No, you're not doing anything wrong. There's nothing in that data > structure which would in

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 5:11 GMT+02:00 Timothy Baldridge : > Prefer vectors over quoted lists '(1 2) vs [1 2]. There's rarely a case > (outside of macros) that you want the former. > > Instead of quoted lists of symbols: '(You cannot get that.) try strings > "You cannot get that" > ​That is what Conrad uses.

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 2:24 GMT+02:00 Bruce Wang : > You might want to check out this > https://github.com/quux00/land-of-lisp-in-clojure > ​I will look into it. But I learn most if I do it myself. ;-)​ -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups "Cloj

Re: Land of lisp to Clojure

2014-07-08 Thread John Mastro
Hi Cecil, Cecil Westerhof wrote: > - The book displays all the lines of a look on separate lines. In my > case it is just one long line. Am I doing something wrong? No, you're not doing anything wrong. There's nothing in that data structure which would inherently cause it to print on multiple li

Re: Land of lisp to Clojure

2014-07-08 Thread Timothy Baldridge
A few notes: Prefer vectors over quoted lists '(1 2) vs [1 2]. There's rarely a case (outside of macros) that you want the former. Instead of quoted lists of symbols: '(You cannot get that.) try strings "You cannot get that" Don't use defs inside defs. Instead move the defs to a global position

Re: Land of lisp to Clojure

2014-07-08 Thread Bruce Wang
Hi Cecil, You might want to check out this https://github.com/quux00/land-of-lisp-in-clojure Cheers, Bruce On Wed, Jul 9, 2014 at 9:49 AM, Cecil Westerhof wrote: > I received the book land of lisp as a gift. I am trying to translate it to > Clojure. In chapter 5 there is a text game engine. I

Land of lisp to Clojure

2014-07-08 Thread Cecil Westerhof
I received the book land of lisp as a gift. I am trying to translate it to Clojure. In chapter 5 there is a text game engine. In the attachment my translation. What do you think of it? There are a few problems. - The book displays all the lines of a look on separate lines. In my case it is just on