On 2015-01-04, Pascal J. Bourguignon <
p...@informatimago.com> wrote:
> Mike <
mi...@mikee.ath.cx> writes:
>
>> On 2015-01-04, Raymond Wiker <
rwi...@gmail.com> wrote:
>>> Mike <
mi...@mikee.ath.cx> writes:
>>>
>>> [ WJ garbage snipped ]
>>>
>>>>
>>>> I didn't see the orignal thread. Why would this not work?
>>>>
>>>> (defun avg (values)
>>>> (/ (+ avg) (length values)))
>>>>
>>>> Mike
>>>
>>> Because it is incorrect?
>>>
>>> Note that even if you fix the obvious problem with your code, you still
>>> end up with something that traverses the list twice.
>>>
>>>
>>
>> Duh. :)
>> I was typing and not thinking about what I was typing. True, the list is looked at twice.
>> Premature optimization?
>>
>> (defun avg (values)
>> (/ (+ values) (length values)))
>
> Still not thinking.
>
> values is a list. What would + a list be?
>
This time I typed the defun into clisp. I have: