I must confess to being tripped up by misunderstanding exactly what include
does. Indeed, I think it is a common misconception.
I can’t help but feel that it is partly due to the name include
which might be associated with pre-processor directives in other languages. And it is commonly used for the same or similar functionality.
For me the name eval_file
would help remind me that it is a normal function executed at run time and which eval
s the contents of the file (in global scope since it is a normal function). Similarly, include_string
could be named eval_string
.