Author: Yves Cloutier Date: To: txr-users@kylheku.com Subject: Using Lisp Modules
Hello list,
I would like to know if it's possible to "import" code or modules into TXR Lisp.
What I mean is, in Scheme I can do the following:
(require myfunctions)
Where myfunctions is an external module in which I have defined some functions.
In my project I have some simple markup language I have defined which translated itself very nicely to lisp code. For example:
<bold<text>
<smallcaps<text>
<up 3<text>
Which converted into LISP would look something like:
(bold "text")
(smallcaps "text")
(up 3 "text")
Or as nested inline commands:
<size +2, bold, up 3<text>
=> (size +2 (bold (up 3 "text")))
The idea is to generate output from the input, for example, could be Groff, LaTex, HTML, etc...
Initially I thought of using the pattern matching feature of TXR to define tokens, match them and do something accordingly. But Now I'm sort of cluing in to the brilliance of LISP languages that code is data and data is code paradigm, and that instead, I could just translate my input text file into LISP form and just do a (eval ) which just executes the entire document as a LISP program!
So my question is if I can define TXR LISP functions like (bold arg), (size arg1 arg2) and "import" them into a TXR prorgam?