Arc Forumnew | comments | leaders | submit | tel's commentslogin

These examples were poor, sorry. I'd only just started the tutorial and I didn't want to guess function names too much.

A slightly better, though still trivial, example:

   (map [+ 5] 
        (list (range -3 0)
              (range 1 3)
              (range 3 5)))
becomes

   (map (fn (nums) (apply + (cons 5 nums)))
        (list (range -3 0)
              (range 1 3)
              (range 3 5)))
Though, normally, you might write something akin to:

   (map (fn (nums) (+ 5 (apply + nums)))
        ...)
It's a lot like Zak's suggestion, just noting that sometimes n is infinite. Full partial application is really powerful -- especially with the general trend in Arc to have the final argument be the most dynamic one -- and I regret that I don't really have time at the moment to make an interesting example.

-----

2 points by Zak 6478 days ago | link

You're now taking a list of lists and trying to add a number to each list. That should fail - partial evaluation or no. There's no sane way for the first expression to translate in to the second.

-----

5 points by tel 6479 days ago | link | parent | on: Clarification about Character Sets

Seconding on the module system. It may not be the biggest concern of a young language, but it's a big part of the infrastructure that will let the language grow.

-----