Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
alexandria
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Momchil Ivanov
alexandria
Commits
cc46824b
Commit
cc46824b
authored
Mar 04, 2014
by
Attila Lendvai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace DELETE-FROM-PLIST implementation, shorter and faster.
Suggested by Stas Boukarev.
parent
048de2e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
13 deletions
+2
-13
lists.lisp
lists.lisp
+2
-13
No files found.
lists.lisp
View file @
cc46824b
...
...
@@ -279,19 +279,8 @@ not destructively modified. Keys are compared using EQ."
"Just like REMOVE-FROM-PLIST, but this version may destructively modify the
provided plist."
(
declare
(
optimize
speed
))
(
loop
with
head
=
plist
with
tail
=
nil
; a nil tail means an empty result so far
for
(
key
.
rest
)
on
plist
by
#'
cddr
do
(
assert
rest
()
"Expected a proper plist, got ~S"
plist
)
(
if
(
member
key
keys
:test
#'
eq
)
;; skip over this pair
(
symbol-macrolet
((
next
(
cdr
rest
)))
(
if
tail
(
setf
(
cdr
tail
)
next
)
(
setf
head
next
)))
;; keep this pair
(
setf
tail
rest
))
finally
(
return
head
)))
(
dolist
(
key
keys
plist
)
(
remf
plist
key
)))
(
define-modify-macro
remove-from-plistf
(
&rest
keys
)
remove-from-plist
"Modify macro for REMOVE-FROM-PLIST."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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