repo.or.cz
/
cslatevm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog
|
commit
| commitdiff |
tree
|
edit
|
fork
raw
|
patch
(parent:
20d2f7b
)
Added Method #for: which is an idiomatic alias for #do:.
author
Brian T. Rice
<briantrice@gmail.com>
Sun, 7 Mar 2010 19:09:26 +0000 (11:09 -0800)
committer
Brian T. Rice
<briantrice@gmail.com>
Sun, 7 Mar 2010 19:09:26 +0000 (11:09 -0800)
src/core/method.slate
patch
|
blob
|
blame
|
history
diff --git
a/src/core/method.slate
b/src/core/method.slate
index
2aeafff
..
0be2499
100644
(file)
--- a/
src/core/method.slate
+++ b/
src/core/method.slate
@@
-151,6
+151,10
@@
m@(Method traits) if: boolean
"Evaluates the block body if the given condition is True."
[boolean ifTrue: [m do]].
+m@(Method traits) for: src
+"Evaluates the block for each element of the Enumerable (Collection or Stream)."
+[src do: m].
+
count@(Integer traits) timesRepeat: block
"Execute the block the number of times of the count, answering Nil."
[