From 4459b0b34f0d3c61647a5772bdb37e43d625e983 Mon Sep 17 00:00:00 2001 From: Hanshen Wang <19878148+HanshenWang@users.noreply.github.com> Date: Thu, 28 Oct 2021 00:35:54 -0400 Subject: [PATCH 1/4] Style: Whitespace formatting My Emacs is configured to automatically delete trailing whitespaces. --- src/clever.lisp | 1 - src/eval.lisp | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/clever.lisp b/src/clever.lisp index 291bf78..9f55913 100644 --- a/src/clever.lisp +++ b/src/clever.lisp @@ -169,4 +169,3 @@ ~%but loading source because it's newer.~%" (namestring obj?)) (load-it src?))))))))) - diff --git a/src/eval.lisp b/src/eval.lisp index 7566748..8772c79 100644 --- a/src/eval.lisp +++ b/src/eval.lisp @@ -25,7 +25,7 @@ (defun scheme-eval (form env) (eval (scheme-translator:translate form env))) - + ; Hack to get define-syntaxes communicated from .bin files to system ; in which .bin file is loaded. Calls to *define-syntax!* necessarily @@ -197,7 +197,7 @@ (*target-package* (scheme-translator:program-env-package env)) (*scheme-read* *scheme-read*)) ;Allow (setq *scheme-read* ...) (funcall fun env)))) - + ; TRANSLATE-FILE @@ -374,7 +374,7 @@ (system::listener-top-loop ; Seems to work better than system::%top-level ;; You could specify :PROMPT here (see LW:*PROMPT*) but the default is good. :eval-print-hook - #'(lambda (values) + #'(lambda (values) (let ((*print-case* :downcase)) (loop for (result . more) on values do (write-result result) @@ -456,4 +456,3 @@ (set-in-user-env 'scheme::pp #'pp) (set-in-user-env 'scheme::error #'scheme-error) (set-in-user-env 'scheme::benchmark-mode #'benchmark-mode)) - From 7c52949ccd84cc91945df59eeb7d66b66f1ea925 Mon Sep 17 00:00:00 2001 From: Hanshen Wang <19878148+HanshenWang@users.noreply.github.com> Date: Thu, 28 Oct 2021 00:37:16 -0400 Subject: [PATCH 2/4] Update SOURCE-FILE-TYPE and OBJECT-FILE-TYPE for Clozure Common Lisp Source file extensions and compiled file extensions have changed for CCL. CL-USER> (pathname-type (compile-file-pathname "clever.lisp")) "lx64fsl" CL-USER> (pathname-type "clever.lisp") "lisp" I think all the all caps ".LISP" is no longer the preferred style? N.B. the compiled file extension is prefixed with "lx64-" appropriately reflects my CPU architecture. --- src/clever.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clever.lisp b/src/clever.lisp index 9f55913..226f7ec 100644 --- a/src/clever.lisp +++ b/src/clever.lisp @@ -38,7 +38,7 @@ #+ABCL "lisp" #+(and :DEC :Ultrix) "lsp" #+:VMS "LSP" - #+:ccl "LISP" ;Coral + #+:ccl "lisp" ;Coral #+allegro "lisp" ;or cl ... hmm. "lisp" ;For Unix, Exploder, and anyone else )) @@ -53,7 +53,7 @@ #+(and :DEC :VMS) "FAS" #+Lucid (car lucid::*load-binary-pathname-types*) ;? #+KCL "o" - #+:ccl "FASL" ;Coral + #+:ccl "lx64fsl" ;Coral #+LispWorks "fsl" #+allegro "fasl" #+(and cmu hpux) "hpf" From 115cb8886468953f07b9e0ab2bb791a01eccb753 Mon Sep 17 00:00:00 2001 From: Hanshen Wang <19878148+HanshenWang@users.noreply.github.com> Date: Thu, 28 Oct 2021 00:45:28 -0400 Subject: [PATCH 3/4] Add SOURCE-FILE-TYPE and OBJECT-FILE-TYPE for Steel Bank Common Lisp Add new Source file extensions and compiled file extensions for SBCL. CL-USER> (pathname-type (compile-file-pathname "clever.lisp")) "fasl" CL-USER> (pathname-type "clever.lisp") "lisp" --- src/clever.lisp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/clever.lisp b/src/clever.lisp index 226f7ec..a78f9e5 100644 --- a/src/clever.lisp +++ b/src/clever.lisp @@ -40,6 +40,7 @@ #+:VMS "LSP" #+:ccl "lisp" ;Coral #+allegro "lisp" ;or cl ... hmm. + #+sbcl "lisp" "lisp" ;For Unix, Exploder, and anyone else )) @@ -58,6 +59,7 @@ #+allegro "fasl" #+(and cmu hpux) "hpf" #+abcl "abcl" + #+sbcl "fasl" )) ;(or) => nil otherwise (defvar *compile-if-necessary-p* nil) From fba732347ca6ba4d413d04ee39d05ad3a4c5ddc9 Mon Sep 17 00:00:00 2001 From: Hanshen Wang <19878148+HanshenWang@users.noreply.github.com> Date: Thu, 28 Oct 2021 00:47:14 -0400 Subject: [PATCH 4/4] Fix: *ROADBLOCK-TABLE* '#\# is not a dispatching macro character' This failure to successfully evaluate (setq *readtable* ps::roadblock-readtable) only occurs on SBCL (where the error is quoted in the commit title) and not CCL. I don't understand why. Perhaps we need to first call SET-DISPATCH-MACRO-CHARACTER for '#'. However the removal of '#' from the Non-constituents does allow the above sexp to eval properly. Version of SBCL used is 2.1.9. CL-USER> (setq *readtable* ps::roadblock-readtable) # CL-USER> (in-package :scheme) # SCHEME> (cons "banana" "split") ("banana" . "split") SCHEME> (list (list 1 2 3) 5 (list "a" "b" "c")) ((1 2 3) 5 ("a" "b" "c")) SCHEME> (symbol? 'Apple) COMMON-LISP:T SCHEME> (symbol? 10) PS:FALSE SCHEME> (define (make-stack) (let ((s '())) (define (push x) (set! s (cons x s))) (define (pop) (if (null? s) (error "Empty stack -- POP") (let ((top (car s))) (set! s (cdr s)) top))) (define (initialize) (set! s '()) 'done) (define (dispatch message) (cond ((eq? message 'push) push) ((eq? message 'pop) (pop)) ((eq? message 'initialize) (initialize)) (else (error "Unknown request -- STACK" message)))) dispatch)) ; ; caught COMMON-LISP:STYLE-WARNING: ; Call to PS:TRUEP could not be inlined because its source code was not saved. A ; global INLINE or SB-EXT:MAYBE-INLINE proclamation must be in effect to save ; function definitions for inlining. ; ; compilation unit finished ; caught 1 STYLE-WARNING condition MAKE-STACK defined. SCHEME> (let ((s (make-stack))) ((s 'push) 1) ((s 'push) 2) (s 'pop) (s 'pop)) 1 (1 bit, #x1, #o1, #b1) --- src/eval.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eval.lisp b/src/eval.lisp index 8772c79..e77634d 100644 --- a/src/eval.lisp +++ b/src/eval.lisp @@ -89,7 +89,7 @@ ;; Intentionally absent: right parenthesis, semicolon, whitespace '( ;; Non-constituents - "\"#'(,`" + "\"'(,`" ;; Constituents (more or less) ;; ;; Actually we don't want to hack these, since otherwise the