Arc Forumnew | comments | leaders | submitlogin
1 point by simonb 6172 days ago | link | parent

A tail recursive map1:

  (def map1 (f xs (o acc))
    (if (no xs) 
        acc
        (map1 f (cdr xs) (cons (f (car xs)) acc))))
Inspired by andf and orf (one predicate applied many operands):

  (def orl (f)
    (fn xs (some f xs)))

  (def andl (f)
    (fn xs (all f xs)))
It would be interesting to see which is the more common case and change built-in predicates to except multiple operands accordingly.