Hello,

Carsten Dominik <[EMAIL PROTECTED]> writes:

> (defun my-wmean (values weights)
>  (let ((vsum 0) (wsum 0))
>    (while (and values weights)
>      (setq v (pop values) w (pop weights))
>      (unless (equal "" v)
>       (setq vsum (+ vsum (* (string-to-number w) (string-to-number
> v)))
>             wsum (+ wsum (string-to-number w)))))
>    (if (= vsum 0) "" (format "%.1f" (/ vsum wsum)))))

But in this case, there's no difference between one who didn't work and
one who just wasn't there: 0 0 and "empty" "empty" will have the same
"empty" mean, won't they ?

>> Finally, I wondered if it would be useful to make it built-in as
>> weighted means are somewhat popular in education.
>
> Well, I could do that, of course. But which version of this function?
> What ouput etc?
> I guess this would then be the original version, which returns a
> number, and which returns 0 if the student has done absolutely
> nothing....

Though it seems more of a rhetorical question, I would be tempted to
answer that any of them would be useful.
On the other hand, I can live with "my-wmean" in my .emacs.

Regards,

-- 
Nicolas Goaziou


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to