new string quotes macro
Posted: Tue Sep 21, 2004 2:13 pm
Hi all,
this is probably either stupidly easy or really hard/impossible to do, but in any case I am mid-way and a bit lost, so I will appreciate the help.
The case is that I dislike the [text][/text] things we have to use for >2kb strings (I guess this limitation for "" {} is a design tradeoff) because it's so unlispy...
so I decided to put the macros into work:
(define-macro (text)
(eval (join (list '[text] (args) '[/text]) " ")))
now you start to see my problem... the string is parsed before the (quote) can quote it...
Second try:
(define-macro (text)
(eval (join (list "[text]" (string (args)) "[/text]") " "))))
and this produces the funny result:
(text hello there dude!)
"[text] (hello there dude!) [/text]"
even playing around with (join (list (string (args) " "))) and so on works as badly as the previous solutions...
I wonder if using simply (string) would work... (tested it, and it doesn't exactly work... and I'm not sure it would work for >2kb args list...)
any ideas?
thank!
david
this is probably either stupidly easy or really hard/impossible to do, but in any case I am mid-way and a bit lost, so I will appreciate the help.
The case is that I dislike the [text][/text] things we have to use for >2kb strings (I guess this limitation for "" {} is a design tradeoff) because it's so unlispy...
so I decided to put the macros into work:
(define-macro (text)
(eval (join (list '[text] (args) '[/text]) " ")))
now you start to see my problem... the string is parsed before the (quote) can quote it...
Second try:
(define-macro (text)
(eval (join (list "[text]" (string (args)) "[/text]") " "))))
and this produces the funny result:
(text hello there dude!)
"[text] (hello there dude!) [/text]"
even playing around with (join (list (string (args) " "))) and so on works as badly as the previous solutions...
I wonder if using simply (string) would work... (tested it, and it doesn't exactly work... and I'm not sure it would work for >2kb args list...)
any ideas?
thank!
david