From: Joseph Abrahamson Date: 2006-05-21T15:03:22+09:00 Subject: Re: rubynuby - confused by method name "inject" In Common Lisp there is the reduce function. I think that name appropriately qualifies the action involved. (reduce (function +) (list 1 2 3 4 5 6)) (1..6).inject(0) {|c,v| c + v} Also: yes, the "E" in math is a Sigma or summation. I wouldn't say they're quite the same since summnation always involves summing whereas inject/reduce are more abstract and multipurpose. Ex: (reduce (function *) (list 1 2 3 4 5 6)) (1..6).ineject(1) {|c,v| c * v} These both act more like a factorial than a sum. -- Posted via http://www.ruby-forum.com/.