[Bese-devel] playing with forms

Matthew Danish mdanish at andrew.cmu.edu
Mon Jan 30 15:01:35 UTC 2006


(apologies if this goes out twice)

Been playing around with the form components.  The documentation isn't
very good and there are no real examples.  I've pieced together the
following code from guesses, and it seems to work, as a demo:

(defcomponent my-form (form-element)
  ((input1 :component (text-element) :accessor input1)
   (date :component (time-element) :accessor date)

   (completer :component (completing-text-element
                          :completions '("foo" "bar"))
              :accessor completer)))

(defaction submit ((f my-form))
  (call 'info-message :message (client-value (input1 f))))

However, besides the fact that I really don't know what I'm doing with
this, I noticed that whenever I update the my-form component with a new
slot, it seems to cause collisions with old instances.

Namely, trying to reload the form, even from the starting entry point,
causes all sorts of fun error msgs to pop up about obsolete instances of
MY-FORM causing trouble.

Now I don't see why they are sticking around, after all, if I start from
the entry point.  Shouldn't it be generating new objects then?

Also, whatever happened to update-instance-for-redefined-class?

(Using SBCL 0.9.9 x86 Linux, mod-lisp backend)

invalid structure layout:                                                                                                           
  A test for class                                                                                                                  
    IT.BESE.UCW:INDIRECT-VALUE                                                                                                      
  was passed the obsolete instance                                                                                                  
    #<HOTEL-MANAGEMENT-SYSTEM.FRONTEND::MY-FORM {B16B089}>
   [Condition of type SB-KERNEL:LAYOUT-INVALID]

Restarts:
  0: [SERVER-ERROR] Send the client an internal server error page.
  1: [GENERATE-BACKTRACE-FOR-EMACS] Generate a bug report in Emacs.
  2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "an httpd worker 2" {AE39E71}>)

  9: (ERROR SB-KERNEL:LAYOUT-INVALID)
 10: (SB-KERNEL::LAYOUT-INVALID-ERROR-HANDLER #<unavailable argument> #.(SB-SYS:INT-SAP #XB6ABA608) #<SB-ALIEN-INTERNALS:ALIEN-VALU$
 11: (SB-KERNEL:INTERNAL-ERROR #.(SB-SYS:INT-SAP #XB6ABA2DC) #<unavailable argument>)
 12: ("foreign function: call_into_lisp")
 13: ("foreign function: funcall2")
 14: ("foreign function: interrupt_internal_error")
 15: ("foreign function: sigtrap_handler")
 16: ((SB-PCL::FAST-METHOD SB-MOP:SLOT-VALUE-USING-CLASS (IT.BESE.UCW::INDIRECT-VALUE-MIXIN-CLASS T T)) #<unavailable argument> #<C$
 17: ((SB-PCL::FAST-METHOD SB-MOP:SLOT-BOUNDP-USING-CLASS (IT.BESE.UCW::INDIRECT-VALUE-MIXIN-CLASS T T)) #<unavailable argument> #S$
 18: ((LAMBDA NIL))
 19: ((SB-PCL::FAST-METHOD IT.BESE.UCW::SAVE-BACKTRACKED (IT.BESE.UCW::STANDARD-SESSION-FRAME)) #<unavailable argument> #<unavailab$
 20: ((LAMBDA (SB-PCL::.PV-CELL. SB-PCL::.NEXT-METHOD-CALL. SB-PCL::.ARG0. SB-PCL::.ARG1.)) #<unavailable argument> #<unavailable a$
 21: ((LAMBDA (SB-PCL::.PV-CELL. SB-PCL::.NEXT-METHOD-CALL. SB-PCL::.ARG0. SB-PCL::.ARG1.)) #<unavailable argument> #<unavailable a$
 22: ((LAMBDA (SB-PCL::.PV-CELL. SB-PCL::.NEXT-METHOD-CALL. SB-PCL::.ARG0. SB-PCL::.ARG1.)) #<unavailable argument> #<unavailable a$
 23: ((SB-PCL::FAST-METHOD IT.BESE.UCW::HANDLE-REQUEST (IT.BESE.UCW:STANDARD-SERVER IT.BESE.UCW:REQUEST IT.BESE.UCW:RESPONSE)) #<un$
 24: (IT.BESE.UCW::HTTPD-WORKER-LOOP/HANDLE #<IT.BESE.UCW::HTTPD-WORKER {AE39551}> #<IT.BESE.UCW:MULTITHREAD-MOD-LISP-BACKEND {AD27$
 25: (IT.BESE.UCW::HTTPD-WORKER-LOOP #<IT.BESE.UCW::HTTPD-WORKER {AE39551}>)

-- 
;; Matthew Danish -- user: mrd domain: cmu.edu
;; OpenPGP public key: C24B6010 on keyring.debian.org



More information about the bese-devel mailing list