Why not redefine function Afficher? Have one file in which Afficher has the original functionality, and another file were it instead produces this bockly XML ? Then you write your simple program in a third file, and depending on which of the other two files you (load), it runs or it produces XML.
Would that be an idea? > On Mon, Jul 28, 2014 at 9:11 PM, Tomas Hlavaty <t...@logand.com> wrote: >> >> I can't make sense of what you are trying to achieve. Why do you want >> to use transient symbols? Why not use normal interned symbols? How >> does your use case differ? Do you have a simple example? > > Suppose you embed a DSL in Picolisp, like this: > (de Afficher (msg) > (println msg)) > Where «Afficher» is the French for «Display». > Now here is a simple program: > (Afficher "Hello!") > When run it with the definition above, the message "Hello!" is displayed. > > Now I want to export the program to XML to build a blocks configuration > for Blockly. An example built (then tweaked by hand) with: > https://blockly-demo.appspot.com/static/apps/code/index.html > <block type="Afficher"> > <value name="TEXT"> > <block type="text"> > <field name="TEXT">Hello!</field> > </block> > </value> > </block> > > Consider that Afficher is not the only command of the language. > There is a kind of «concatenate», a «read»⦠> The Lisp syntax is marvellous because the data I need to translate (the > program) is also source code (well, it was since the beginning!). > All I need is to reprogram my DSL like this: > (de Afficher (msg) > (pack > "<block type=\"Afficher\"><value name=\"TEXT\">" > msg > "</value></block>")) > > But I need transient symbols to spontaneously have the value: > <block type="text"><field name="TEXT">*****</field></block> > Where ***** is the name of the transient symbol. > I could assign each transient the right value, but a bit of magic > would save time. > > Is it better? > > > chri > > -- > > http://profgra.org/lycee/ (site pro) > http://delicious.com/profgraorg (liens, favoris) > https://twitter.com/profgraorg > http://microalg.info > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe > -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe