http://www.w3.org/ns/prov#value | - George - nice example, but you could have done Ruby a litte better, and hense, more lisp-like with:def sum(ary)ary.inject { |total,i| total+1 }endthough I do not really like the name 'inject'. 'apply' is better, but I think there is a term closer to "sum, that does not mean mathimatical summation but more like apply block to each item with a running result.
|