Arc Forumnew | comments | leaders | submitlogin
2 points by lojic 5917 days ago | link | parent

Would someone be so kind as to explain the following line (1007) from within the definition of copy in arc.arc from arc1.tar?

  (apply (fn args args) x)


7 points by shiro 5917 days ago | link

apply copies its argument list (guaranteed by Scheme spec). So this line lets the apply copy x, then passes it to a function that just returns the copied list. It may be faster than traversing the list in arc, for apply may be able to take advantage of underlying Scheme.

-----

2 points by akkartik 5917 days ago | link

Worth encapsulating in a macro perhaps?

  (copy x)

-----

1 point by lojic 5916 days ago | link

Cool - thx. Probably worth a small comment in the code.

-----