> You could have a macro that took a filename as a parameter, read the file, 
> ran it through a parser of some sort, then used the parse tree to generate 
> Nim code which would be compiled into your program. It would be a lot more 
> work than just making a DSL with Nim syntax, but it's an option if you need 
> it. As Araq says though, Nim syntax is really flexible. The Nim code you pass 
> to a macro doesn't need to mean anything to the compiler, it just needs to be 
> parsable. That means that it's still whitespace sensitive, blocks still have 
> to start with :, your braces have to match up and things of that nature, but 
> apart from the basic structural elements the code can be whatever you like.

I wouldn't want to bump this topic again, but I have a question:

Can the code read be on the same .nim file instead of a separated file?

Reply via email to