guicho271828 / lisp-namespace

no more discussion on lisp-1 vs lisp-2. THIS IS LISP-N.
37 stars 5 forks source link

USE-VALUE does not work via repl. #20

Open hyotang666 opened 2 years ago

hyotang666 commented 2 years ago

Here is the session.

* (lispn:define-namespace test)

""
* (symbol-test 'no)

debugger invoked on a UNBOUND-TEST in thread
#<THREAD "main thread" RUNNING {10014F0073}>:
  Symbol NO is unbound in namespace TEST

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
  0: [USE-VALUE] USE-VALUE
  1: [ABORT    ] Exit debugger, returning to top level.

(SYMBOL-TEST NO NIL)
  source: (RESTART-CASE (ERROR 'UNBOUND-TEST :NAME SYMBOL)
            (USE-VALUE (LISP-NAMESPACE::DEFAULT)
              (SETF (SYMBOL-TEST SYMBOL) LISP-NAMESPACE::DEFAULT)))
0] 0

debugger invoked on a SB-INT:SIMPLE-PROGRAM-ERROR @5378BF11 in thread
#<THREAD "main thread" RUNNING {10014F0073}>:
  invalid number of arguments: 0

;;;; OR

(handler-bind ((unbound-test
                 (lambda (c)
                   (let ((restart (find-restart 'use-value c)))
                     (when restart
                       (invoke-restart-interactively restart))))))
  (symbol-test 'no))

It seems that use-value clause missing :interactive option.

https://github.com/guicho271828/lisp-namespace/blob/master/src/package.lisp#L116-L117

http://www.lispworks.com/documentation/HyperSpec/Body/m_rst_ca.htm

phoe commented 2 years ago

Fixed by #19