Map/Select, Reduce/Aggregate Functionality
Posted: Tue Jan 15, 2013 7:02 am
My apologies if I've missed it in the documentation. I couldn't find any references to either map or reduce functionality. Is that something that is supported?
I tried using the C# approach:
However, I think that this would require an additional standard library extension method. Is that correct?
I'm very new to Cobra. So if I am missing something basic please be sure to let me know.
Thanks,
bp
I tried using the C# approach:
- Code: Select all
nums = List<of int>({1,2,3})
sum = nums.aggregate( do(a as int, b as int) = a + b)
print sum
However, I think that this would require an additional standard library extension method. Is that correct?
I'm very new to Cobra. So if I am missing something basic please be sure to let me know.
Thanks,
bp