Include mystery

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 evals the contents of the file (in global scope since it is a normal function). Similarly, include_string could be named eval_string.

1 Like