Loops/Continue: Difference between revisions
m
→{{header|Scheme}}: fix
Jazzedpineda (talk | contribs) (Omitted EasyLang) |
Simple9371 (talk | contribs) m (→{{header|Scheme}}: fix) |
||
Line 2,155:
=={{header|Scheme}}==
For R7RS Scheme. In this functional solution, there is no "continue". Instead, the "loop" function is directly called in the tail ([[Category:Recursion|tail recusrion]]).
{{incorrect|Scheme|}}
<syntaxhighlight lang="scheme">(
(define (loop-fn start end)
▲ (display i)
(cond ((zero? (modulo i 5))
(newline) (loop (+ 1 i)))
(else
(display ", ")
(loop (+ 1 i)))))))
(loop start))
(loop-fn 1 10)</syntaxhighlight>
=={{header|Scilab}}==
|