[parenscript-devel] Importing ParenScript Macros
andy.arvid at gmail.com
Fri Jan 11 21:54:18 UTC 2013
1. there are lots of solutions. I have most of my macros is a separate
library called parenscript-extensions. If it is a "local" macro, I just
define it in the file it is used.
This is my solution:
(defun compile-site-paren-file (name &optional check-date)
(let ((inf (merge-pathnames (make-pathname :name name :type "paren")
(outf (merge-pathnames (make-pathname :name name :type "js")
(when (and (fad:file-exists-p inf)
(or (not check-date)
(not (fad:file-exists-p outf))
(> (file-write-date inf) (file-write-date outf))))
(with-open-file (in inf :direction :input)
(with-open-file (out outf :direction :output
(let ((*parenscript-stream* out))
Note: I use the paren extension for parenscript only files. The library fad
is http://weitz.de/cl-fad/. Though this does treat a whole directory it
could. I prefer to be more explicit in what I am compiling.
On Fri, Jan 11, 2013 at 11:41 AM, David Sargeant <david at dsargeant.com>wrote:
> I'm new to Common Lisp and ParenScript, so please forgive my questions if
> they are obvious.
> 1. What is the best way to import a file of ParenScript macros so that the
> macro calls in the file I'm compiling can be properly expanded?
> 2. Is there some way to watch a directory for changes to *.lisp files, and
> automatically compile to *.js files?
> Thanks for the help,
> parenscript-devel mailing list
> parenscript-devel at common-lisp.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the parenscript-devel