>>>>> "GB" == Graham Barr <[EMAIL PROTECTED]> writes:

GB> On Thu, Aug 10, 2000 at 07:22:21PM -0400, Chaim Frenkel wrote:
>> Okay, then for
>> 
>> reduce &avg $identity, @list
>> 
>> What should $identity be?

GB> I would like to see what &avg would be, given that each time it
GB> would be passed the previous result (or the first element) and
GB> the next element.

GB> So without using an external variable to keep count of how many
GB> elements had been processed so far it could not be done. So you
GB> would probably do it like

See, Damian's answer to this question. (A cute curry where the
class carried the count and the deref carried the current sum.)

<chaim>
-- 
Chaim Frenkel                                        Nonlinear Knowledge, Inc.
[EMAIL PROTECTED]                                               +1-718-236-0183

Reply via email to