Static initialization of string cache? #48
Unanswered
rljacobson
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My language has loads of operators and keywords. Strewn throughout my code are things like
It's especially ugly for matching, because Rust wants the matched value to be (*waves hands*) statically known structures or variable bindings (patterns), so I have to use an if-guard:
Is it possible to have a statically initialized string cache, one for which the initial strings have
Symbol
s known at compile time, but which is still growable at run time? In other words, I want to do something likeor
where
interned!(…)
magically inserts a staticSymbol
value.Is this possible?
Beta Was this translation helpful? Give feedback.
All reactions