Arc Forumnew | comments | leaders | submitlogin
3 points by zck 2271 days ago | link | parent

They're very similar. Check out http://files.arcfn.com/doc/iteration.html#whilet for some better documentation, but it boils down to this:

  (whilet var test ...)
loops until (no (test)) is true -- until (test) returns 'nil. Each loop through, var is bound to the value of (test). On the other hand,

  (whiler var expr endval ...)
loops until (is (expr) endval) is true. Similarly, each loop through, var is bound to the value of (expr).

So every time you have a call to

  (whiler value (function) nil ...)
You can replace that with

  (whilet value (function) ...
An example of when you would want to use whiler is:

  (whiler input (readline) "quit" (do-stuff-with-input-from-user input))


1 point by jsgrahamus 2270 days ago | link

Good explanation. Thanks.

-----