We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i think we should allow for some macro-like syntax that is evaluated at compile time to save runtime.
not sure how to implement this, though. i think that they should emit amber code that is inserted into the places where they are called. like this:
macro compile_env(var: Text): Text { return text_value(trust $\${var}$); } echo compile_env("LANG");
which will evaluate to something like this, assuming that LANG is en on compile time:
LANG
en
echo "en"
text_value() returned a text literal with the value of trust $\${var}$, which was evaluated on compile time
text_value()
trust $\${var}$
ref #436 , but this issue is for discussing the implementation of macros themselves, not the compile_env!() macro specifically
compile_env!()
The text was updated successfully, but these errors were encountered:
b1ek
No branches or pull requests
i think we should allow for some macro-like syntax that is evaluated at compile time to save runtime.
not sure how to implement this, though. i think that they should emit amber code that is inserted into the places where they are called. like this:
which will evaluate to something like this, assuming that
LANG
isen
on compile time:text_value()
returned a text literal with the value oftrust $\${var}$
, which was evaluated on compile timeref #436 , but this issue is for discussing the implementation of macros themselves, not the
compile_env!()
macro specificallyThe text was updated successfully, but these errors were encountered: