-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: add code export and import #85
Comments
That's an interesting idea, thanks for the suggestion. I suspect I would not work on such a thing, but if you were willing to contribute I'd accept. There are probably questions to be asked first though, like how this would affect scoping. The simple approach, like C using "include" would be easy to add, and could be done at the lexer/parser level:
That works. But if you had an import like this:
Where "time.monkey" had:
Would that be called as And finally would you need to support some kind of search-path, as used in perl/python? |
The code below allows for monkey files to be imported, if you want play with or certainly improve.
It will be imported with with the imported file being within the env var INCLUDEPATH or in the directory /usr/local/include/monkey or current directory. The function would be called with package evaluator
|
Add some way to export or import codebases from other files for example
Export
Import
The text was updated successfully, but these errors were encountered: