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,
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
> >> 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.
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
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:
> 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,
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
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
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
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
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
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
>
> 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
13 matches
Mail list logo