[Bese-devel] the limitations of the code within actions

henrik hjelte henrik at evahjelte.com
Thu Feb 2 08:57:18 UTC 2006


On ons, 2006-02-01 at 18:30 -0500, Matthew Danish wrote:
> I tried to use a HANDLER-CASE form within a defaction and it seems that
> Arnesi's library can't handle that (in this case it expanded to a
> MULTIPLE-VALUE-PROG1 which caused it to choke).  Is this a limitation I
> should expect, or is it a bug?
> 
Maybe Marco has a better answer, anyway here is mine.
This is an expected limitation. One work-around could maybe be to split
up the defaction form so it calls a helper method /function that
contains the handler case. 
The interpreter only walks the forms in the defaction form, so if you
put the code in a method or function instead you are back in plain Lisp.

/Henrik Hjelte

(defaction my-action ((c my-component))
 (handler-case
   (do-stuff)
   (error (e)
     ...)))

becomes:

(defaction my-action ((c my-component))
  (when (my-action-method c)
        (answer 'ok)))

(defmethod my-action
 (handler-case
   (do-stuff)
   ;; Note you can't call 'components or answer here
   (error (e)
     ...)))


    





More information about the bese-devel mailing list