while/  until loops for Racket
1 Example and usage
2 Reference
while
until
break
continue
8.14.0.1

while/until loops for Racket🔗ℹ

JavaCommons Technologies <javacommons@gmail.com>

 (require while-until) package: while-until

This basically provides while, until, break and continue.

    1 Example and usage

    2 Reference

1 Example and usage🔗ℹ

#lang racket/base
(require while-until)
 
(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)))
#lang racket/base
(require while-until)
(require pprint-all)
 
(define n 5)
(while (> n 0)
  (dump n)
  (set! n (- n 1))
  )
(define m 5)
(until (< m 1)
  (dump m)
  (set! m (- m 1))
  )

2 Reference🔗ℹ

syntax

(while test body ...)

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

syntax

(until test body ...)

Repeat the evaluation of the body so long as test is false.

syntax

(break)

Break out of the innermost loop.

syntax

(continue)

Restart the innermost loop.