In addition to @Hlaaftana's answer, if you don't need the data at compile time,
you can do this to get it at runtime:
import std/tables
import macros
import print
type
Metadata = object
name: string
id: BiggestInt
var ALL_METADATA* = in
Cool, thanks, makes sense, and it worked!
I think the new behavior is correct here. `const ALL_METADATA = allInfo`
evaluates before any changes to `allInfo`, so the value of ALL_METADATA is
locked in.
You can use something like
template saveMetadata() =
const ALL_METADATA {.inject.} = allInfo
Run
and c
Not quite sure where to go with this, and whether it's something I'm doing
wrong, or some behavior that changed in the new (rc) version, so figured I'd
give the forum a shot.
I'm trying to register some types and associated metadata during compile time,
and that worked fine in 1.6.8. I also see