[cl-walker-devel] [delico] Persistency with restart-case/handler-case/restart-bind/handler-bind

Attila Lendvai attila.lendvai at gmail.com
Wed May 12 17:51:46 UTC 2010


hi!


> I was trying to get persistent continuations using hu.dwim.delico,
> alas it turns out to be troublesome since SBCL internally uses
> closures to achieve this.


the problem is that restarts and condition handlers should be
reimplemented and CPS transformed by delico because in the current
setup it does not walk 'cl:signal and friends. and because of that we
leave the delimited continuation area when they are called from CPS
transformed code.

it would be nice to have the same condition system in walked and
non-walked code where conditions could enter and leave the delimited
continuation area intact.

as of the details of how to implement it... i don't have a worked out idea.

conditions instantiated inside the cc area by a CPS transformed
condition system implementation could leave the cc area on the top of
the stack (if it's growing downwards). the custom condition/cc
instances could contain the native conditions which would be re-thrown
into the lisp's condition system when leaving the top of the cc area.

as of native conditions thrown while outside the cc area on the bottom
of the stack... maybe we could install handlers around the native
calls leaving the cc area, then resignal stuff in the cc condition
system, then ... ... ... it is getting messy, or i just simply didn't
spend enough time refining the details.

the point is: either try not to use conditions and/or restarts inside
walked code, or alternatively work out the details of how to cross the
cc borders. we are not planning to work on this in the near future.


> Since most of the condition system commands are macros, I'd like to
> know whether it is possible to write custom macros for the walker
> which try not to depend on closures.


you can customize the walker in very flexible ways. e.g. using it to
compile a lisp dialect to javascript. examples here:

http://dwim.hu/darcsweb/darcsweb.cgi?r=HEAD%20hu.dwim.quasi-quote;a=headblob;f=/source/js/syntax.lisp

-- 
 attila




More information about the cl-walker-devel mailing list