Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Spenser Truex
alexandria
Commits
8246037b
Commit
8246037b
authored
Dec 12, 2018
by
Philipp Marek
Browse files
Switch loop clause order, see issue 5.
parent
9b6a385a
Changes
1
Hide whitespace changes
Inline
Side-by-side
numbers.lisp
View file @
8246037b
...
...
@@ -61,9 +61,9 @@ Examples:
(iota 3 :start -1 :step -1/2) => (-1 -3/2 -2)
"
(
declare
(
type
(
integer
0
)
n
)
(
number
start
step
))
(
loop
repeat
n
;; KLUDGE: get numeric contagion right for the first element too
(
loop
;; KLUDGE: get numeric contagion right for the first element too
for
i
=
(
+
(
-
(
+
start
step
)
step
))
then
(
+
i
step
)
repeat
n
collect
i
))
(
declaim
(
inline
map-iota
))
...
...
@@ -80,9 +80,9 @@ Examples:
;;; 3.0
"
(
declare
(
type
(
integer
0
)
n
)
(
number
start
step
))
(
loop
repeat
n
;; KLUDGE: get numeric contagion right for the first element too
(
loop
;; KLUDGE: get numeric contagion right for the first element too
for
i
=
(
+
start
(
-
step
step
))
then
(
+
i
step
)
repeat
n
do
(
funcall
function
i
))
n
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment