Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita636ba0

Browse files
committed
more readme
1 parentf0de2da commita636ba0

File tree

1 file changed

+75
-17
lines changed

1 file changed

+75
-17
lines changed

‎README.md

Lines changed: 75 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,80 @@ parameters first, separated by commas, then we call the function.
108108

109109
This takes the 3 numbers, calls "+", which adds them all, then pipes that to out, which prints them.
110110

111+
###Looping
112+
113+
for each example
114+
115+
```
116+
[1,2,3] each
117+
out
118+
```
119+
120+
for loop example
121+
122+
```
123+
[1..5) each
124+
out
125+
```
126+
127+
turns into:
128+
129+
```
130+
for(var i = 1; i < 5; ++i)
131+
{
132+
out(i);
133+
}
134+
```
135+
136+
also async:
137+
138+
```
139+
[1,2,3] async.each
140+
out
141+
```
142+
143+
turns into:
144+
145+
```
146+
async.each([1,2,3],function(i,cb){
147+
out(i);
148+
return cb();
149+
});
150+
```
151+
152+
callbacks trigger at end of scope unless you take control of the callback object using @
153+
154+
```
155+
[1,2,3] *each
156+
'blah' @another_function
157+
```
158+
Using '@' either prefixed or before a function call adds the current callback to the params
159+
160+
in this case:
161+
162+
```
163+
async.each([1,2,3],function(i,cb){
164+
another_function('blah',cb);
165+
});
166+
167+
```
168+
169+
###Backcalls
170+
171+
```
172+
test
173+
blah
174+
```
175+
176+
This is equivalent to test(function(){ return blah(); })
177+
178+
```
179+
test ^
180+
blah
181+
```
182+
183+
This is also equivalent to test(function(){ return blah(); })
184+
111185
###Packing/Unpacking
112186

113187
iox is based around temporary variables being passed down "the stream". Generally these are single values or a list of values.
@@ -149,7 +223,7 @@ Functions in iox take any number of inputs and give any number of outputs.
149223
Here is a basic function declaration:
150224

151225
```
152-
message:
226+
defmessage
153227
"Hello there, ", _
154228
155229
# Usage:
@@ -207,22 +281,6 @@ alarm out # wake-up on event (availability of future 'alarm')
207281
a keypress
208282
'a pressed!' out
209283

210-
###Callbacks/Backcalls
211-
212-
```
213-
test
214-
blah
215-
```
216-
217-
This is equivalent to test(function(){ return blah(); })
218-
219-
```
220-
test ^
221-
blah
222-
```
223-
224-
This is also equivalent to test(function(){ return blah(); })
225-
226284
###What now?
227285

228286
Work in progress :)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp