Skip to content

Commit

Permalink
[ document each and while ]
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Rothstein committed Nov 11, 2010
1 parent 6be95cb commit 19f281a
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions public/index.html
Expand Up @@ -323,6 +323,37 @@ <h2>stuff</h2>
]]>
</script>

<script id="iteration-with-each"
data-title="Iteration with each"
language="sibilant/example">
<![CDATA[
; To iterate over an array, use the each
; macro.

(defvar list '(a b c d e))
(each (letter) list
(when (= "C" (letter.to-upper-case))
(console.log "this was a c"))
(console.log letter))

]]>
</script>

<script id="while"
data-title="While"
language="sibilant/example">
<![CDATA[
(defvar wall-bottle-count 99)

(defun take-one-down () (decr wall-bottle-count))

(while (> wall-bottle-count 0)
(defvar bottle (take-one-down))
(pass-around bottle))

]]>
</script>

<script id="chain"
data-title="Chaining function calls"
language="sibilant/example">
Expand Down Expand Up @@ -441,5 +472,7 @@ <h2>stuff</h2>
]]>
</script>



</body>
</html>

0 comments on commit 19f281a

Please sign in to comment.