arturo
arturo copied to clipboard
[VM/lib] Merge constants and builtin's?
[VM/lib] Merge constants and builtin's?
Do we really - really - need another "constant" type? I doubt it whether it makes any serious performance difference, with the only exception being constants like true
, false
, etc.
But then, it also over-complicates documentation generation for constants.
So, we should either make documentation possible for constants as well, or merge the two things into one concept
https://github.com/arturo-lang/arturo/blob/ce734e7a32c73173910cdf8f533f56be21febe3b/src/vm/lib.nim#L113
)
# TODO(VM/lib) Merge constants and builtin's?
# Do we really - really - need another "constant" type? I doubt it whether it makes any serious performance difference, with the only exception being constants like `true`, `false`, etc.
# But then, it also over-complicates documentation generation for constants.
# So, we should either make documentation possible for constants as well, or merge the two things into one concept
# labels: vm, library, enhancement, open discussion
template constant*(n: string, alias: SymbolKind, description: string, v: Value):untyped =
Syms[n] = (v)
Syms[n].info = "[" & static (instantiationInfo().filename).replace(".nim") & ":" & $(static (instantiationInfo().line)) & "] " & description
ndex e098b999e..4d261283b 100644
++ b/src/vm/package.nim
07c8d3ba9b413ceb346e0c3ce2d4dcf661f97847