Permalink
Browse files

readme changes to emphasise asynchronicity

  • Loading branch information...
refractalize committed Jul 15, 2011
1 parent b2b39da commit 57caa665fa138726ce86ef394ea80c53935c20ed
Showing with 109 additions and 13 deletions.
  1. +13 −5 README.md
  2. +96 −8 zo.tmproj
View
@@ -18,7 +18,9 @@ Zo is a asynchronous query language providing the usual functional programming l
zo([1, 2, 3])
.map(function (item, mapTo) {
- mapTo(item + 1);
+ process.nextTick(function () {
+ mapTo(item + 1);
+ });
})
.results(function (mappedItems) {
console.log(mappedItems);
@@ -30,7 +32,9 @@ Produces: `[ 2, 3, 4 ]`
zo([1, 2, 3])
.select(function (item, selectIf) {
- selectIf(item > 1);
+ process.nextTick(function () {
+ selectIf(item > 1);
+ });
})
.results(function (selectedItems) {
console.log(selectedItems);
@@ -42,7 +46,9 @@ Produces: `[ 2, 3 ]`
zo([1, 2, 3])
.reduce(0, function (sum, item, reduceInto) {
- reduceInto(sum + item);
+ process.nextTick(function () {
+ reduceInto(sum + item);
+ });
})
.results(function (sum) {
console.log(sum);
@@ -56,8 +62,10 @@ See also `reduceRight`, which is a synonym for `foldr`
zo([1, 2, 3])
.each(function (item, done) {
- console.log('item: ' + item);
- done();
+ process.nextTick(function () {
+ console.log('item: ' + item);
+ done();
+ });
})
.results(function (items) {
console.log('count: ' + items.length);
View
104 zo.tmproj
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>currentDocument</key>
- <string>.gitignore</string>
+ <string>specs.js</string>
<key>documents</key>
<array>
<dict>
@@ -20,9 +20,7 @@
<key>filename</key>
<string>.gitignore</string>
<key>lastUsed</key>
- <date>2011-04-11T21:21:11Z</date>
- <key>selected</key>
- <true/>
+ <date>2011-07-12T14:13:09Z</date>
</dict>
</array>
<key>fileHierarchyDrawerWidth</key>
@@ -71,19 +69,61 @@
<key>firstVisibleLine</key>
<integer>0</integer>
</dict>
+ <key>max.coffee</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>0</integer>
+ <key>line</key>
+ <integer>8</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
+ <key>max.js</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>0</integer>
+ <key>line</key>
+ <integer>13</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
+ <key>specs.js</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>0</integer>
+ <key>line</key>
+ <integer>0</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
<key>zo-function.js</key>
<dict>
<key>caret</key>
<dict>
<key>column</key>
- <integer>2</integer>
+ <integer>0</integer>
<key>line</key>
- <integer>104</integer>
+ <integer>44</integer>
</dict>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
- <integer>63</integer>
+ <integer>44</integer>
</dict>
<key>zo-require.ejs</key>
<dict>
@@ -99,6 +139,20 @@
<key>firstVisibleLine</key>
<integer>0</integer>
</dict>
+ <key>zo-require.js</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>24</integer>
+ <key>line</key>
+ <integer>16</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
<key>zo-web.ejs</key>
<dict>
<key>caret</key>
@@ -113,6 +167,20 @@
<key>firstVisibleLine</key>
<integer>0</integer>
</dict>
+ <key>zo-web.js</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>0</integer>
+ <key>line</key>
+ <integer>0</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
<key>zo.ejs</key>
<dict>
<key>caret</key>
@@ -127,20 +195,40 @@
<key>firstVisibleLine</key>
<integer>0</integer>
</dict>
+ <key>zo.js</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>0</integer>
+ <key>line</key>
+ <integer>38</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
</dict>
<key>openDocuments</key>
<array>
<string>zo-function.js</string>
+ <string>max.js</string>
+ <string>specs.js</string>
<string>Makefile</string>
<string>.gitignore</string>
+ <string>max.coffee</string>
<string>make.js</string>
<string>zo-require.ejs</string>
+ <string>zo-require.js</string>
<string>zo-web.ejs</string>
+ <string>zo-web.js</string>
<string>zo.ejs</string>
+ <string>zo.js</string>
</array>
<key>showFileHierarchyDrawer</key>
<true/>
<key>windowFrame</key>
- <string>{{67, 75}, {854, 803}}</string>
+ <string>{{516, 15}, {854, 803}}</string>
</dict>
</plist>

0 comments on commit 57caa66

Please sign in to comment.