Hi Kriangkrai,
>> But what if we want to mix it with expressions?
>>
>> (let (Clr "#EEE" Cls "xxx")
>> (pack {$<html><body style=3D"background-color:$} Clr {$">
>> <div class=3D"$} Cls {$">
>> </div>
>> </body></html>$} ))
I would suggest:
(de style Lst
(let S NIL
(while Lst
(let (K (pop 'Lst) V (eval (pop 'Lst) 1))
(when V
(push 'S (pack K ":" V)) ) ) )
(glue ";" (flip S)) ) )
(let (Clr "#EEE" Cls "xxx")
(out "t.html"
(<xml> NIL
(<xml> html
(<xml> body style (style 'background-color Clr)
(<xml> div class Cls) ) ) ) ) )
which should be bullet-proof regarding escaping, closing tags
properly...
Cheers,
Tomas
--
UNSUBSCRIBE: mailto:[email protected]?subject=unsubscribe