average = list ->
  do = *divider *total list ->
    weight = 0 ..; items = list ..

    do ->
      weight += 1
      total += x * weight; divider += weight
      ' x -- detach items x _    

      if items -> iterate
      else leave
    ;
  ;

  divider, total = 0 ..

  if (list) -> - do *divider *total list

  if divider -> total / divider
  else 0
_
  list : _ : I|F : +-
;