Details
Description
(This is a feature request based on input from Doug and Sorin from #boo. If you're not in #boo, you're just not in!)
Element wise operator syntax to allow for more compact generators (A) and for element-wise operations on two or more iterable items (B)
EXAMPLE A:
list = [1, 2, 3, 4, 5]
filtered = array(int, list[it > 3])
print filtered # " 4, 5 "
That is in comparison to the current generator syntax:
list = [1, 2, 3, 4, 5]
filtered = array(int, e for e in list if e > 3)
print filtered # "4, 5"
EXAMPLE B:
foo = [1, 2, 3, 4, 5]
bar = [1, 2, 3, 4, 5]
result = array(int, foo[it] * bar[it])
print result #1, 4, 8, 16, 25
Not sure I want to write the equivilent of what you have to do in Boo now.
Issue Links
| This issue depends upon: | ||||
| BOO-610 | Optional return on inline closures. |
|
|
|
Links to discussions about this:
http://groups.google.com/group/boolang/browse_frm/thread/2f86399922775133/6d2d0a4cd2381c95?q=element+wise&rnum=1&hl=en#6d2d0a4cd2381c95
http://article.gmane.org/gmane.comp.lang.boo.devel/654
http://article.gmane.org/gmane.comp.lang.boo.devel/657