1 Example and usage
while
break
continue
Version: 5.2.0.901

While loops for Racket

This basically provides while, break and continue.

1 Example and usage

 (require (planet dyoo/while-loop:1:=1))

#lang racket/base
(require (planet dyoo/while-loop))
 
(while (not (string=? (read-line)
                      "quit"))
  (printf "quit?  "))
 
(while #t
  (define input (read-line))
  (unless (regexp-match #px"please" input)
    (printf "You didn't say please\n")
    (continue))
  (when (regexp-match #px"quit" input)
    (break)))

(while test body ...)
Repeat the evaluation of the body so long as test is true.

(break)
Break out of the innermost loop.

(continue)
Restart the innermost loop.