I write a lot of functions like (def f (x)
...)
where sometimes I'll be calling f with an object and sometimes with the id of an object; in the function I may need the obj (def f (x)
(let ob (obof x)
...))
or I may need the id (def f (x)
(let id (idof x)
...))
where obof passes through an object unchanged and converts an id to an object, and idof does the opposite.What if we had a syntax to convert function arguments: (def f ((c ob obof))
...)
Another example would be the testify functions; instead of (def mem (test seq)
(let f (testify test)
(reclist [if (f:car _) _] seq)))
mem could be (def mem ((c test testify) seq)
(reclist [if (test:car _) _] seq))
|