Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
alexandria
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Christophe Junke
alexandria
Commits
0c257112
Commit
0c257112
authored
15 years ago
by
François-René Rideau
Browse files
Options
Downloads
Patches
Plain Diff
reorder definitions to get rid of a warning about not inlining a forward reference
parent
1c66d691
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
sequences.lisp
+20
-20
20 additions, 20 deletions
sequences.lisp
with
20 additions
and
20 deletions
sequences.lisp
+
20
−
20
View file @
0c257112
...
...
@@ -5,6 +5,26 @@
;; macro, because inlining seems to cancel compiler macros (at least on SBCL).
(
declaim
(
inline
copy-sequence
sequence-of-length-p
))
(
defun
sequence-of-length-p
(
sequence
length
)
"Return true if SEQUENCE is a sequence of length LENGTH. Signals an error if
SEQUENCE is not a sequence. Returns FALSE for circular lists."
(
declare
(
type
array-index
length
)
(
inline
length
)
(
optimize
speed
))
(
etypecase
sequence
(
null
(
zerop
length
))
(
cons
(
let
((
n
(
1-
length
)))
(
unless
(
minusp
n
)
(
let
((
tail
(
nthcdr
n
sequence
)))
(
and
tail
(
null
(
cdr
tail
)))))))
(
vector
(
=
length
(
length
sequence
)))
(
sequence
(
=
length
(
length
sequence
)))))
(
defun
rotate-tail-to-head
(
sequence
n
)
(
declare
(
type
(
integer
1
)
n
))
(
if
(
listp
sequence
)
...
...
@@ -172,26 +192,6 @@ is a literal integer."
length
current
)))))))))))))
(
defun
sequence-of-length-p
(
sequence
length
)
"Return true if SEQUENCE is a sequence of length LENGTH. Signals an error if
SEQUENCE is not a sequence. Returns FALSE for circular lists."
(
declare
(
type
array-index
length
)
(
inline
length
)
(
optimize
speed
))
(
etypecase
sequence
(
null
(
zerop
length
))
(
cons
(
let
((
n
(
1-
length
)))
(
unless
(
minusp
n
)
(
let
((
tail
(
nthcdr
n
sequence
)))
(
and
tail
(
null
(
cdr
tail
)))))))
(
vector
(
=
length
(
length
sequence
)))
(
sequence
(
=
length
(
length
sequence
)))))
(
defun
copy-sequence
(
type
sequence
)
"Returns a fresh sequence of TYPE, which has the same elements as
SEQUENCE."
...
...
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