Re: Translation from Common Lisp 1

2010-03-20 Thread alux
Hello Christophe, this one I like ;-) Thanks & regards, alux Christophe Grand schrieb: > If you really wan't to go that way you can also choose to remove the > namespaces: > (defn describe-path [[where what]] > (map (comp symbol name) `(there is a ~what going ~where from here.))) > > > On Fri,

Re: Translation from Common Lisp 1

2010-03-19 Thread Christophe Grand
If you really wan't to go that way you can also choose to remove the namespaces: (defn describe-path [[where what]] (map (comp symbol name) `(there is a ~what going ~where from here.))) On Fri, Mar 19, 2010 at 8:17 AM, alux wrote: > > >> But using symbols for something like this is a bit cont

Re: Translation from Common Lisp 1

2010-03-19 Thread alux
> >> But using symbols for something like this is a bit contrived anyway. Yes, But sometimes it needs contrived examples to get the message. Especially if you have misleading preconceptions. And to me, symbols had always been a way to refer to stuff. And only that. That had to be shaken an is now.

Re: Translation from Common Lisp 1

2010-03-19 Thread alux
David, thank you. Your answer seems to be nearest possible to the origninal spirit. Obviousely the way syntax-quote is resolved qualified with a namespace makes the easier way impossible. Regards, alux On 18 Mrz., 22:17, David Nolen wrote: > On Thu, Mar 18, 2010 at 4:25 PM, alux wrote: > > Hell

Re: Translation from Common Lisp 1

2010-03-18 Thread Richard Newman
But using symbols for something like this is a bit contrived anyway. Maybe, but I've seen it in other Common Lisp books/tutorials before. e.g. I'm sure PAIP was one of them. Part of the motivation is that CL symbols always compare with EQ and EQL, whilst strings are not required to do so:

Re: Translation from Common Lisp 1

2010-03-18 Thread Brian Schlining
> Yes, of course, thats what a sane person would do ;-) > > I mentioned in my later post, this usage of symbols as data is 1. non- > idiomatic but 2. really illuminating for somebody with Java > background. > Well, and its what this tutorial does. > > Nevertheless thank you for the answer! > > Ha,

Re: Translation from Common Lisp 1

2010-03-18 Thread Michael Wood
On 18 March 2010 23:40, Michael Gardner wrote: > On Mar 18, 2010, at 4:17 PM, David Nolen wrote: > >> On Thu, Mar 18, 2010 at 4:25 PM, alux wrote: >> Hello! >> >> I much enjoyed reading the tutorial http://www.lisperati.com/casting.html >> , mentioned by eyeris today. The most mind-extending thin

Re: Translation from Common Lisp 1

2010-03-18 Thread Michael Gardner
On Mar 18, 2010, at 4:17 PM, David Nolen wrote: > On Thu, Mar 18, 2010 at 4:25 PM, alux wrote: > Hello! > > I much enjoyed reading the tutorial http://www.lisperati.com/casting.html > , mentioned by eyeris today. The most mind-extending thing (to me, > having Java background) is the, admittedly

Re: Translation from Common Lisp 1

2010-03-18 Thread David Nolen
On Thu, Mar 18, 2010 at 4:25 PM, alux wrote: > Hello! > > I much enjoyed reading the tutorial http://www.lisperati.com/casting.html > , mentioned by eyeris today. The most mind-extending thing (to me, > having Java background) is the, admittedly non-idiomatic, use of > symbols as data. > > But I

Re: Translation from Common Lisp 1

2010-03-18 Thread alux
Hello Fons, (my former answer was to Brian) I tried this one, actually. But the result is really used as output of the adventure 'game' here. So the namespace prefix must not be there. Thank you for the answer, alux On 18 Mrz., 21:50, fons haffmans wrote: > I just did this : > > (defn describe

Re: Translation from Common Lisp 1

2010-03-18 Thread alux
Yes, of course, thats what a sane person would do ;-) I mentioned in my later post, this usage of symbols as data is 1. non- idiomatic but 2. really illuminating for somebody with Java background. Well, and its what this tutorial does. Nevertheless thank you for the answer! Kind regards, alux

Re: Translation from Common Lisp 1

2010-03-18 Thread fons haffmans
I just did this : (defn describe-path [path] `(there is a ,(second path) going ,(first path) from here.)) which gives me : (describe-path (list "left" "right")) (user/there user/is user/a (clojure.core/second user/path) user/going (clojure.core/first user/path) user/from here.) Sure, it prepe

Re: Translation from Common Lisp 1

2010-03-18 Thread Brian Schlining
> > But I have two translation problems, I want to pose before going to > sleep (its pitch dark in Europe :). First the easy one: > > Common Lisp > (defun describe-path (path) > `(there is a ,(second path) going ,(first path) from here.)) > > My Clojure version, I use a map: > (defn describe-path