Added an implementation of 'elt' to ps-macro-lib.
[clinton/parenscript.git] / docs / introduction.lisp
index e9e5e32..b014ac0 100644 (file)
@@ -44,19 +44,19 @@ function foobar(a, b) {
 
 ;;; It also supports additional iteration constructs, relieving the
 ;;; programmer of the burden of iterating over arrays.
-;;; `for' loops can be written using the customary `DO' syntax.
+;;; `for' loops can be written using the customary `DO*' syntax.
 
 (ps
-  (do ((i 0 (incf i))
-       (j (aref arr i) (aref arr i)))
-      ((>= i 10))
+  (do* ((i 0 (incf i))
+        (j (aref arr i) (aref arr i)))
+       ((>= i 10))
     (alert (+ "i is " i " and j is " j))))
 
 ;; compiles to
 "
 for (var i = 0, j = arr[i]; i < 10; i = ++i, j = arr[i]) {
   alert('i is ' + i + ' and j is ' + j);
-}
+};
 "
 ;;; ParenScript uses the Lisp reader, allowing for reader macros. It
 ;;; also comes with its own macro environment, allowing host Lisp