Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Losh
iterate
Commits
13280f92
Commit
13280f92
authored
Apr 26, 2007
by
Attila Lendvai
Browse files
Clean up #L stuff, do not leave #L enabled after loading iterate
darcs-hash:04807aabc6fcb4a46710b88c4c4009cf70f75506
parent
235756c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
iterate.lisp
View file @
13280f92
...
...
@@ -461,11 +461,9 @@
;;; e.g. #L(list !2 !3 !5) is equivalent to:
;;; (lambda (!1 !2 !3 !4 !5) (declare (ignore !1 !4)) (list !2 !3 !5))
(
eval-when
(
:compile-toplevel
:load-toplevel
:execute
)
(
defvar
*old-sharpL-func*
(
get-dispatch-macro-character
#\#
#\L
))
(
eval-when
(
:compile-toplevel
)
(
defun
sharp
L
-reader
(
stream
subchar
n-args
)
(
defun
sharp
-l
-reader
(
stream
subchar
n-args
)
(
declare
(
ignore
subchar
))
(
let*
((
form
(
read
stream
t
nil
t
))
(
bang-vars
(
sort
(
bang-vars
form
)
#'
<
:key
#'
bang-var-num
))
...
...
@@ -490,8 +488,6 @@
(
if
decl
(
list
decl
form
)
(
list
form
))))
(
subbed-body
(
sublis
(
pairlis
bvars
args
)
body
)))
`
#'
(
lambda
,
args
,.
subbed-body
))))
(
set-dispatch-macro-character
#\#
#\L
#'
sharpL-reader
)
(
defun
make-bang-var
(
n
)
(
intern
(
format
nil
"!~d"
n
)))
...
...
@@ -520,7 +516,24 @@
(
error
"#L: ~a is not a valid variable specifier"
sym
)
num
)))
)
;end eval-when
(
defun
enable-sharp-l-reader
()
(
set-dispatch-macro-character
#\#
#\L
#'
sharp-l-reader
))
;; According to CLHS, *readtable* must be rebound when compiling
;; so we are free to reassign it to a copy and modify that copy.
(
setf
*readtable*
(
copy-readtable
*readtable*
))
(
enable-sharp-l-reader
)
)
; end eval-when
#|
;; Optionally set up Slime so that C-c C-c works with #L
#+#.(cl:when (cl:find-package "SWANK") '(:and))
(unless (assoc "ITERATE" swank:*readtable-alist* :test #'string=)
(bind ((*readtable* (copy-readtable *readtable*)))
(enable-sharp-l-reader)
(push (cons "ITERATE" *readtable*) swank:*readtable-alist*)))
;|#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; The ITERATE macro.
...
...
@@ -3580,10 +3593,6 @@ e.g. (DSETQ (VALUES (a . b) nil c) form)"
|#
(
eval-when
(
:compile-toplevel
:load-toplevel
:execute
)
(
when
(
and
(
boundp
'*old-sharpL-func*
)
*old-sharpL-func*
)
(
set-dispatch-macro-character
#\#
#\L
*old-sharpL-func*
)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Junk.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment