#how to do a comptime access of a `pub` function declaration by its name (`[]const u8`)
1 messages · Page 1 of 1 (latest)
Thanks, that works.
I assumed it woudn't, because the documentation suggests it must have an instance of a struct to work:
Apparently, hasDecl also works. But access has to be done using field.
Works on both fields and declarations.
it's essentially equivalent to the dot syntax (super.sub), no matter in what form (that is, equivalent to theDOT IDENTIFIERchoice of theSuffixOpnonterminal defined in the grammar)
got it
@hasDecl will only return a boolean, not the item itself
debatable choice, "parse, don't validate" - but that's a discussion for another day
I don't always want to parse.