RosettaCodeData/Task/Catamorphism/Nemerle/catamorphism.nemerle
2015-02-20 09:02:09 -05:00

2 lines
124 B
Text

def seq = [1, 4, 6, 3, 7];
def sum = seq.Fold(0, _ + _); // Fold takes an initial value and a function, here the + operator