What is the meaning of the "magic" pragma in nim?

When you look at the code in the Nim project itself, I find that some prose, decorated with a "magic" error, missed the definition of proc ( example ). There is no document to explain the pragma, I think the proc definition is somewhere else and merges at compile time. But I can’t find the definition by searching the whole project.

Am I misunderstanding the "magic" pragma? What is the meaning of this? And how to use it?

+6
source share
1 answer

The {.magic.} used to define built-in operations and types, ie anything that requires compiler magic to work (hence the name). It is not intended for use outside system modules.

+4
source

All Articles