2013年7月9日 星期二

Using SBCL to run PAIP

PAIP source code and usage is from
http://www.norvig.com/paip/README.html

in SBCL command line
* (load "auxfns.lisp")
        having a debugger message:
            debugger invoked on a SB-SYS:INTERACTIVE-INTERRUPT in thread
        select 2
            2: [UNLOCK-PACKAGE] Unlock the package.

*(requires "examples")
        having a debugger message:
            debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread
            #<THREAD "initial thread" RUNNING {1002998E73}>:
            failed to find the WRITE-DATE of /home/user/test/paip/bin/examples.bin:

revise the file "auxfns.lisp" as follows
in Line 87:
;Replace 
;(defun load-paip-file (file)
;  "Load the binary file if it exists and is newer, else load the source."
;  (let* ((src (paip-pathname file :lisp))
;  (src-date (file-write-date src))
;  (bin (paip-pathname file :binary))
;  (bin-date (file-write-date bin)))
;    (load (if (and (probe-file bin) src-date bin-date (>= bin-date src-date))
;       bin
;     src))))
;with:
(defun load-paip-file (file)
    "Load the binary file if it exists and is newer, else load the source."
        (load (paip-pathname file :lisp)))

reload "auxfns.lisp" and then try again

* (requires "examples")
* (do-example :all)    ;do all examples
* (do-example 1)       ;do first example
* (do-example '(1 2))  ;do first and second example


the solution reference from 
http://compgroups.net/comp.lang.lisp/paip-auxfns.lisp-continuable-error/697367