Namespaces

adas.ana is a collection of general purpose macros with a focus on writing succint code. They are divided into 2 broad categories "anaphoric", and "quick".

While the anaphoras are inspired by the traditional lisp kind, popularized by Paul Graham's "On Lisp", they go much further. Most importantly the problem of nesting is solved by "letter doubling" and using context appropriate symbols instead of following the it tradition as you'll see in examples.

The "quick" macros are simply other general purpose macros which aren't anaphoric.

All the macros expand to code very similar (or identitcal) to that which you'd write by hand. This ensures you can use them without guilt or hesitation.

The library is VERY MUCH WORK IN PROGRESS, things will break and change. ~~Note that as of right now the symbols are replaced by copying in the expression it references, not by binding to a common variable. Hence not suitable for using with expressions that cause side-effects or involve a lot of computation. That will be changed soon~~ Fixed since "0.1.0", most special symbols bind by default where it makes sense now. Suffixing with ! (e.g. %test!) will clone the target expression. More docs coming soon.

If you have suggestions or existing macros that you think fit here please submit an issue or a PR. Anything that enables succint code and expands to reasonable code is fair game.

In acondaif, and awhen%test or %t gets replaced with the test form. %then gets replaced by the then form, and %else by the else form. If nested you can access the previous level by doubling the first letter of the symbol. For example %ttest would get you the previous test form, while %eeelse would get you the else form 2 levels up. In the aand and aor macros you can reference arguments by using a symbol of form *<num> where num is the 1-index of the argument. Previous levels are accessed by doubling the * character. So the second test form of an aand can by accessed with *2 and the third argument of the previous aand would be **3

This sounds much harder than it is to use. The examples should be self explanatory.

In clojure usually you'll use str to build simple strings. It makes for nasty looking code. Especially when you need to escape double quotes. We can use format but it's usually overkill. qstr like javascript's template strings lets you easily insert clojure values into strings. Being a macro, you don't suffer a runtime penalty vs. using str.