News for hackers. Stuff that matters.
Re:Magical, Mystical JavaScript Transducers by TeMPOraL on Saturday June 29, 2019 @04:26AM (#20311452)
Note that to make it correct Common Lisp, you'd write it like that:

  (defun avg-popularity (list)
    (loop 
       for item in list
       for pop = (popularity item)
       when (plusp pop)
       sum pop into s
       and
       count t into c
       finally (return (/ s c))))
Two changes: 1) making `pop' be a thing, and 2) `when' clause of loop only applies to the next clause by default (here, `sum pop into s'), you need to include `and' to chain it with the next one so that both are guarded by `when' condition.

There are no comments on this comment yet.