@@ 40,7 40,7 @@
;; VALUES with no arguments instead of just NIL to truly omit any expression.
(values))
-(defun enable-commented-sexps (&optional (copy-readtable t))
+(defmacro enable-commented-sexps (&optional (copy-readtable t))
"Enable the #; reader macro character to comment a full s-expression. If COPY-READTABLE is T,
then *READTABLE* will be copied with COPY-READTABLE before adding the reader macro.
@@ 48,8 48,8 @@ When enabled, prefixing any form (s-expression or atom) with #; will comment it
form must be valid according to the reader (albiet with *READ-SUPPRESS* true), but is otherwise not
parsed in any way."
`(eval-when (:compile-toplevel :load-toplevel :execute)
- (when copy-readtable
- (setf *readtable* (copy-readtable)))
+ ,(when copy-readtable
+ '(setf *readtable* (copy-readtable)))
(set-dispatch-macro-character #\# #\; #'commented-sexp-reader)))
#|
@@ 267,13 267,15 @@ new syntax."
`(progn
(enable-commented-sexps ,copy-readtable)
;; handle if SHORTHAND-LAMBDAS isn't loaded
- ,(when (find-package ,(string '#:nytpu.lisp-utils.shorthand-lambdas))
+ ,(when (find-package (string '#:nytpu.lisp-utils.shorthand-lambdas))
;; no COPY-READTABLE because ENABLE-COMMENTED-SEXPS already copied it once, no need to do it
;; again
- `(,(find-symbol ,(string '#:enable-shorthand-lambdas)
- ,(string '#:nytpu.lisp-utils.shorthand-lambdas))
+ `(,(find-symbol (string '#:enable-shorthand-lambdas)
+ (string '#:nytpu.lisp-utils.shorthand-lambdas))
nil))))
+(macroexpand-1 '(enable-syntaxes))
+
(defmacro togglef (&rest places)
"Given a list of places, expand to a SETF form consisting of each place being set to (NOT place)."
@@ 115,8 115,8 @@ Examples:
(^(list $ $ 'c $ $2 $1) 'a 'b 'd)
; → (a b c d b a)"
`(eval-when (:compile-toplevel :load-toplevel :execute)
- (when copy-readtable
- (setf *readtable* (copy-readtable)))
+ ,(when copy-readtable
+ '(setf *readtable* (copy-readtable)))
(set-macro-character #\^ #'shorthand-lambda-reader)))
#|