Cormorant icon indicating copy to clipboard operation
Cormorant copied to clipboard

Add support for #() macro

Open austinzheng opened this issue 10 years ago • 1 comments

Add support for the inline function reader macro (e.g. #(doSomething %0 %1)). Expanding this macro is relatively straightforward, with the caveat that the expander needs to know know many %n tokens there are (or if only % is used).

A good resource is: http://stackoverflow.com/questions/13204993/anonymous-function-shorthand

austinzheng avatar Jan 15 '15 17:01 austinzheng

Actually... %n tokens are 1-indexed, % is always %1, and however many tokens there are is determined by the highest n value. Finally, #() can't be nested.

austinzheng avatar Apr 04 '15 03:04 austinzheng