<br>Hi guys. Parenscript rocks. I feel like I'm really rollerskating now..<br><br>There was a bug reported on <i>Tue Sep 30 21:28:05 UTC 2008 by</i> Daniel Gackle about the failure of &optional arguements. I just got bit by the bug, can we please get that one-liner pushed into the repository. Muchos gracais.<br>
<br>On a happier note here is a macro I wrote to enable tracing-ala-cl. Works with firebug. You'll need to (defvar *trace-level*). I don't do indentation but that would be an easy addition.<br><br>(defpsmacro console (&rest rest)<br>
`(console.log ,@rest))<br><br>(defpsmacro defun-trace (name args &rest body)<br> (let* ((sname (ps::symbol-to-js name))<br> (tname (ps-gensym name))<br> (arg-names (loop for arg in args<br> unless (eq arg '&optional)<br>
collect (if (consp arg) (car arg) arg)))<br> (argpairs<br> (loop for arg in arg-names<br> nconc (list (ps::symbol-to-js arg) arg))))<br> `(progn<br> (defun ,name ,arg-names<br>
(console *trace-level* ,sname ":" ,@argpairs)<br> (incf *trace-level*)<br> (let* ((rtn (,tname ,@arg-names)))<br> (decf *trace-level*)<br> (console *trace-level* ,sname "returned" rtn)<br>
(return rtn)))<br> (defun ,tname ,args<br> ,@body))))<br><br>Thanks much,<br>Will<br><br><br>