Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
f176bcf0
Commit
f176bcf0
authored
22 years ago
by
toy
Browse files
Options
Downloads
Patches
Plain Diff
PSETQ was not handling symbol macros. Use PSETF to implement PSETQ.
(From SBCL.)
parent
58555a17
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/macros.lisp
+15
-10
15 additions, 10 deletions
code/macros.lisp
with
15 additions
and
10 deletions
code/macros.lisp
+
15
−
10
View file @
f176bcf0
...
...
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.8
3
2002/11/22 1
5:43
:0
9
toy Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.8
4
2002/11/22 1
8:12
:0
3
toy Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -1603,15 +1603,20 @@
;;;; Miscellaneous macros:
(
defmacro
psetq
(
&rest
pairs
)
(
do
((
lets
nil
)
(
setqs
nil
)
(
pairs
pairs
(
cddr
pairs
)))
((
atom
(
cdr
pairs
))
`
(
let
,
(
nreverse
lets
)
(
setq
,@
(
nreverse
setqs
))
nil
))
(
let
((
gen
(
gensym
)))
(
push
`
(
,
gen
,
(
cadr
pairs
))
lets
)
(
push
(
car
pairs
)
setqs
)
(
push
gen
setqs
))))
"PSETQ {var value}*
Set the variables to the values, like SETQ, except that assignments
happen in parallel, i.e. no assignments take place until all the
forms have been evaluated."
;; Given the possibility of symbol-macros, we delegate to PSETF
;; which knows how to deal with them, after checking that syntax is
;; compatible with PSETQ.
(
do
((
pair
pairs
(
cddr
pair
)))
((
endp
pair
)
`
(
psetf
,@
pairs
))
(
unless
(
symbolp
(
car
pair
))
(
error
'simple-program-error
:format-control
"variable ~S in PSETQ is not a SYMBOL"
:format-arguments
(
list
(
car
pair
))))))
;;; LAMBDA -- from the ANSI spec.
;;;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment