[Feature] compile time macros
- Linguagem predominante
- Rust
- Estrelas
- 5.2k
- Forks
- 145
- Merge médio
- 5d 3h
- PRs com merge (30d)
- 7
Descrição
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:
```ab
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:
```ab
echo "en"
```
`text_value()` returned a text literal with the value of `trust $\${var}$`, which was evaluated on compile time
---
ref #436 , but this issue is for discussing the implementation of macros themselves, not the `compile_env!()` macro specifically
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.