Go to the first, previous, next, last section, table of contents.


Looping Structures

Jade's version of Lisp has only one structure for looping -- a while loop similar to those found in most programming languages.

Special Form: while condition body-forms...
The condition form is evaluated. If it is non-nil an implicit progn is performed on the body-forms and the whole thing is repeated again.

This continues until the condition form evaluates to nil. The value of any while structure is nil.

while can be recursively defined in terms of when:

(while c b ...)
==
(when c (progn b ... (while c b ...)))
;; Step through a list x
(while x
  ;; Do something with the current element, (car x)
  (setq x (cdr x)))


Go to the first, previous, next, last section, table of contents.