D
Doug H
For what it's worth, some of us proposed the same thing for the boo
language [1]. Also groovy has this feature [2]. (might be worth
putting in proposal that two other ruby & python inspired languages use
or want to use this, as well as AliceML)
Pnuts also has a related feature [3]:
print myitems[it % 2 == 0]
Essentially you can pass a boolean expression or a closure to an
indexer. Above would return all even items. I'm not proposing it for
ruby, just mentioning. "it" is very powerful.
Comega (or c-omega from microsoft) also has this feature [4]
1.
http://groups.google.com/group/boolang/browse_frm/thread/52d619066407bfe/082fc0286faec24c
2. http://groovy.codehaus.org/Closures
3. http://pnuts.org/snapshot/latest/doc/lang.html
4. http://research.microsoft.com/Comega/
language [1]. Also groovy has this feature [2]. (might be worth
putting in proposal that two other ruby & python inspired languages use
or want to use this, as well as AliceML)
Pnuts also has a related feature [3]:
print myitems[it % 2 == 0]
Essentially you can pass a boolean expression or a closure to an
indexer. Above would return all even items. I'm not proposing it for
ruby, just mentioning. "it" is very powerful.
Comega (or c-omega from microsoft) also has this feature [4]
1.
http://groups.google.com/group/boolang/browse_frm/thread/52d619066407bfe/082fc0286faec24c
2. http://groovy.codehaus.org/Closures
3. http://pnuts.org/snapshot/latest/doc/lang.html
4. http://research.microsoft.com/Comega/