Arc Forumnew | comments | leaders | submitlogin
9 points by almkglor 5840 days ago | link | parent

  (apply map + your-expression)


3 points by bOR_ 5840 days ago | link

  (apply map + (map vals:craa!eltm:car (observecone craa!pos (list 0 359) craa!range)))
  (122 31 0)
Thanks! I'll digest what things you can do with the apply map combination in my sleep, but it seems quite handy.

-----

2 points by absz 5840 days ago | link

The apply function takes a function, any number of arguments, and a list, to wit (apply f x0 x1 x2 ... xN args). This is the same as (f x0 x1 x2 ... xN args.0 args.1 args.2 ... args.M). This allows you to construct argument lists at runtime, which can come in very handy.

-----

2 points by jmatt 5840 days ago | link

almkglor nailed it.

That's elegant and simple.

-----