[Gsll-devel] with-ode-integration macro problem on clisp

Mirko Vukovic mirko.vukovic at gmail.com
Sun Feb 1 00:06:30 UTC 2009


Liam,

The file `ode-example.lisp' could not compile on clisp+cygwin+windows.
 The error occurred in `integrate-vanderpol', which uses the
`with-ode-integration' macro.

I traced the problem to the symbol-macrolet generated macro
`make-next-step'.  It looks like the loop body cannot digest symbols
created with symbol-macrolet (again clisp only, not sbcl).

I was able to fix the problem by changing make-next-step into a
function via labels.

I am attaching a file that illustrates the problem, fix and
verification.  It has has several items:
1) illustration with a simple code on where clisp fails when loop uses
a symbol-macrolet based symbol
2) the modified with-ode-integration macro
3) a version of integrate-vanderpol based on the modified macro
4) an example of a test-suite where I compared the outputs of your
macro with the modified macro, using your examples of integrating
vanderpol.

This issue is not a major show-stopper for me, since I have a working
version now.  I can see why make-next-step should be defined as a
symbol-macro -- it is so simple.  On the other hand, strictly
visually, its appearance as a symbol in the body of the loop between
two forms is a bit jarring.  Also, make-next-step is an `internal'
symbol to the with-ode-integration macro, and maybe should not be
visible to the user.

But all of the above are really, minor, minor points, because the user
is free to write their own version of `with-ode-integration' :-)  The
major point is really that sooner or later someone else will try to
compile on clisp and hit the same problem.

Mirko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clisp-fix.lisp
Type: application/octet-stream
Size: 5866 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/gsll-devel/attachments/20090131/8e5ab0ea/attachment.obj>


More information about the gsll-devel mailing list