[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

restart-case, restart-bind (MCL 2.0b1p2)



Thanks for the advice that got RESTART-CASE working in MCL 2.0b1p2.
I put (defconstant ccl::$v_istruct 44) in my init.Lisp.
Incidently, I thought, "why not just load lispequ.lisp at init
time, to avoid other potential problems," but this results in
other unbound variable errors (at least $T_VECTOR and $T_LFUN)
that I was unable to track down.  If anyone has any insight into
this I'd appreciate hearing it.

However, I still can't get RESTART-BIND working.  There aren't many
examples in CLtL2, but as far as I can tell this should cause a
break, providing the option of a "Print Hello" restart:
[Please let me know if this is just a syntax error! I've tried
all variants that seemed consistent with CLtL2.]

? (restart-bind ((nil #'(lambda () (print "Hello"))
                      :report-function
                      #'(lambda (stream)
                          (format stream "Print Hello"))))
    (break))
;Compiler warnings :
;   Unknown declaration (DYNAMIC-EXTENT
                         (#:NIL
                          (CCL::%CONS-RESTART NIL NIL NIL NIL NIL))), in an anonymous lambda form.
;   Undefined function #:NIL, in an anonymous lambda form.
;   Unused lexical variable #:NIL, in an anonymous lambda form.
> Error: Undefined function #:NIL called with arguments (#<RESTART NIL
>                                                                   #x304A19>) .
> While executing: #<Anonymous Function #x3041B6>
> Type Command-/ to continue, Command-. to abort.
> If continued: Retry applying #:NIL to (#<RESTART NIL #x304A19>).
See the Restarts menu item for further choices.
1 > 

The macroexpansion of this looks funky; maybe this'll help in the diagnosis:

? (macroexpand
   '(restart-bind ((nil #'(lambda () (print "Hello"))
                        :report-function
                        #'(lambda (stream)
                            (format stream "Print Hello"))))
      (break)))
(LET* ((#:NIL (CCL::%CONS-RESTART NIL NIL NIL NIL NIL)))
  (DECLARE (DYNAMIC-EXTENT (#:NIL (CCL::%CONS-RESTART NIL NIL NIL NIL NIL))))
  (LET* ((#:G208
          (LIST (CCL::MAKE-RESTART (#:NIL (CCL::%CONS-RESTART NIL NIL NIL NIL NIL))
                                   'NIL
                                   #'(LAMBDA NIL (PRINT "Hello"))
                                   :REPORT-FUNCTION
                                   #'(LAMBDA (STREAM) (FORMAT STREAM "Print Hello")))))
         (CCL::%RESTARTS% (CONS #:G208 CCL::%RESTARTS%)))
    (DECLARE (DYNAMIC-EXTENT #:G208 CCL::%RESTARTS%)) (PROGN (BREAK))))
T
?

Again, thanks for any advice you can provide! 

 -Lee (spector@cs.umd.edu)