|
|
|
|
|
by c3d
843 days ago
|
|
You can do exactly that, and this is how this is defined in the built-in library https://github.com/c3d/xl/blob/fast/src/builtins.xl#L222 How it works is what I tried to document in the document above. The trick is to have some fixed semantics on how rewrites are done, but a lot of freedom in how this is implemented. And this is far from perfect ATM. For example, if you write "X is 2", this can be implemented as a constant, as a function returning a constant, or as a macro. However, if you write "X is seconds" in Tao3D, where "seconds" returns the current number of seconds in the clock, then it can no longer be a constant value. You still can use macro replacement (or inlining) or turn it into a function. More details here: https://xlr.sourceforge.io/#compiling-xl |
|