
| Key: |
BOO-466
|
| Type: |
New Feature
|
| Status: |
Open
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Arron Washington
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
Boo
Created: 31/Aug/05 03:16 PM
Updated: 20/May/08 09:09 AM
|
|
| Component/s: |
Compiler
|
| Affects Version/s: |
0.6
|
| Fix Version/s: |
0.8.3
|
|
(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.
|
|
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. |
Show » |
|
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