January 2020
Intermediate to advanced
532 pages
13h 31m
English
Generated functions are functions that are prefixed by @generated at the function definition. These functions can return expression objects, just like macros. For example, we can define the doubled function as follows:
@generated function doubled(x) return :( 2 * x )end
Let's quickly run a test and make sure that it works:

The code works beautifully, as expected.
So defining generated functions is quite similar to defining macros. In both cases, we can create an expression object and return it, and we can expect the expression to be evaluated properly.
We have not, however, exercised the full power of generated ...
Read now
Unlock full access