Loops/Continue: Difference between revisions

m
(Omitted EasyLang)
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">(defineimport (loopscheme ibase)
(displayscheme iwrite))
(if (> i 10) 'done
 
(begin
(define (loop-fn start end)
(display i)
(conddefine ((zero? (moduloloop i 5))
(newline)if (loop> (+i 1end) i)))#f
(else (display ", ")begin
(loop (+ 1display i)))))))</syntaxhighlight>
(cond ((zero? (modulo i 5))
(newline) (loop (+ 1 i)))
(else
(display ", ")
(loop (+ 1 i)))))))
(loop start))
 
(loop-fn 1 10)</syntaxhighlight>
 
=={{header|Scilab}}==
535

edits