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
2cf76fae
Commit
2cf76fae
authored
27 years ago
by
dtc
Browse files
Options
Downloads
Patches
Plain Diff
Avoid unbound symbol value and function errors when copy-symbol is
copying the properties.
parent
3865141a
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/symbol.lisp
+11
-10
11 additions, 10 deletions
code/symbol.lisp
with
11 additions
and
10 deletions
code/symbol.lisp
+
11
−
10
View file @
2cf76fae
...
...
@@ -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/symbol.lisp,v 1.2
5
1998/03/
26 21:38:45 pw
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/symbol.lisp,v 1.2
6
1998/03/
30 03:25:01 dtc
Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -186,15 +186,16 @@
(
defun
copy-symbol
(
symbol
&optional
(
copy-props
nil
)
&aux
new-symbol
)
"Make and return a new uninterned symbol with the same print name
as SYMBOL. If COPY-PROPS is
null
, the new symbol is neither bound
nor fbound and
has
has no properties
.
Else, it has a copy of SYMBOL's
function, value and property list."
as SYMBOL. If COPY-PROPS is
false
, the new symbol is neither bound
nor fbound and has no properties
, else it has a copy of SYMBOL's
function, value and property list."
(
declare
(
type
symbol
symbol
))
(
setq
new-symbol
(
make-symbol
(
symbol-name
symbol
)))
(
when
copy-props
(
setf
(
symbol-value
new-symbol
)
(
symbol-value
symbol
)
(
symbol-plist
new-symbol
)
(
copy-list
(
symbol-plist
symbol
))
(
symbol-function
new-symbol
)(
symbol-function
symbol
)))
(
%set-symbol-value
new-symbol
(
%primitive
fast-symbol-value
symbol
))
(
setf
(
symbol-plist
new-symbol
)
(
copy-list
(
symbol-plist
symbol
)))
(
when
(
fboundp
symbol
)
(
setf
(
symbol-function
new-symbol
)
(
symbol-function
symbol
))))
new-symbol
)
(
proclaim
'
(
special
*keyword-package*
))
...
...
@@ -215,9 +216,9 @@
"Creates a new uninterned symbol whose name is a prefix string (defaults
to \"G\"), followed by a decimal number. Thing, when supplied, will
alter the prefix if it is a string, or be used for the decimal number
if it is a number, of this symbol.
The default value of the number is
the current value of *gensym-counter*
which is incremented each time
it is used."
if it is a number, of this symbol.
The default value of the number is
the current value of *gensym-counter*
which is incremented each time
it is used."
(
let
((
old
*gensym-counter*
))
(
unless
(
numberp
thing
)
(
let
((
new
(
etypecase
old
...
...
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