2 ms·
Interpolate method accesses callsite context to extract values of the variables named in template. How?
by scotty79 3y ago
Interpolate method accesses callsite context to extract values of the variables named in template. How?
- masklinn 3y agoI assume it just parses the string templates (at compile-time) and extracts the expressions being templated in, that's not exactly high-flying tech, cpython manages to do it.
- scotty79 3y agoOh, right. The values seem to come from the context of where template was parsed and are kept inside StringTemplate object (.values()).