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
eca422cf
Commit
eca422cf
authored
15 years ago
by
agoncharov
Browse files
Options
Downloads
Patches
Plain Diff
Changed the documentation string for the function `append', to better
reflect the standard and actual behavior.
parent
eec3de69
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/list.lisp
+14
-5
14 additions, 5 deletions
code/list.lisp
with
14 additions
and
5 deletions
code/list.lisp
+
14
−
5
View file @
eca422cf
...
...
@@ -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/list.lisp,v 1.3
5
200
5
/0
5
/1
0 17:58:06 rtoy
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/list.lisp,v 1.3
6
200
9
/0
7
/1
7 02:15:04 agoncharov
Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -255,9 +255,18 @@
;;; The remaining lists in the arguments are tacked to the end of the result
;;; using splice which cdr's down the end of the new list
(
defun
append
(
&rest
lists
)
"Construct a new list by concatenating the list arguments"
(
do
((
top
lists
(
cdr
top
)))
;;Cdr to first non-null list.
(
defun
append
(
&rest
args
)
"Usually, but not always, returns a new list that is the
concatenation of Args. Each Arg in Args must be a proper list except
the last one, which may be any object. The function is not
destructive: for all but the last Arg, its list structure is copied.
The last argument is not copied; it becomes the cdr of the final
dotted pair of the concatenation of the preceding lists, or is
returned directly if there are no preceding non-empty lists. In the
latter case, if the last Arg is not a list, the returned value is
not a list either."
(
do
((
top
args
(
cdr
top
)))
;;Cdr to first non-null list.
((
atom
top
)
'
())
(
cond
((
null
(
car
top
)))
; Nil -> Keep looping
((
not
(
consp
(
car
top
)))
; Non cons
...
...
@@ -276,7 +285,7 @@
(
not-proper-list-error
(
car
top
))))
(
setq
splice
(
cdr
(
rplacd
splice
(
cons
(
car
x
)
())
)))
)
(
do
((
y
(
cdr
top
)
(
cdr
y
)))
;;Copy rest of
list
s.
(
do
((
y
(
cdr
top
)
(
cdr
y
)))
;;
Copy rest of
arg
s.
((
atom
(
cdr
y
))
(
setq
splice
(
rplacd
splice
(
car
y
)))
result
)
...
...
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