Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 708 Bytes

File metadata and controls

21 lines (17 loc) · 708 Bytes

apply

apply <function>, <arguments>, read as “map the function <function> to arguments <arguments>”, applies the given function to each expression in the list of expressions given. If multiple lists are given, multiple arguments are passed to the function. The arity of the function should match the amount of lists given to apply.

apply foo, ("bar", "baz", 69);
;; EQUIVALENT
foo "bar";
foo "baz";
foo 69;
apply foo, ("bar", "baz", 69), ("goo", `0`, 0x420);
;; EQUIVALENT
foo "bar", "goo";
foo "baz", `0`;
foo 69, 0x420;

This allows you to write simpler functions and still use them as if they take variadic arguments.