Arc Forumnew | comments | leaders | submitlogin
1 point by absz 6135 days ago | link | parent

Hmmm, I see what you mean. On the other hand, one might also often do something like (keep even mylist), which doesn't have that problem and does, I think, read better. One good option might be to provide both forms (map and fmap (f for flip or function), for instance)--map would be used where the list was longer, and fmap where the function was. You could even maintain the n-arity of map by doing

  (def map (xs arg . args)
    (withs (args (cons arg args)
            f    (last args)
            lsts (firstn (- (len args) 1) args))
      #;(...)))
To be clear, I think that providing both is better, or at least providing flip by default in arc.arc. But it's worth thinking about.