Closed dragonquest closed 5 years ago
I assume you've figured out the answer, but for the record, the implementation of load provided by repl.MakeLoad executes each loaded file in a "clean" environment that doesn't define sayHello. You can fork and modify MakeLoad to use whatever environment you like---perhaps the same environment that you use to execute the main script, prog1.txt.
I am intrigued by the string "glob" in your example. Are you by any chance building a tool to read Bazel BUILD files?
Hey @alandonovan Sort of, as a hobby project I want to see how much work it takes to implement the most simple functionatlities to have something which can build .NET projects from .csproj files. Generally I like bazel and it's syntax but I don't like java. Since bazel is mature and my tool won't be, I'm not sure if I will ever take it further. But starlark is awesome ;) Also, csproj contains all the needed .cs files so I find it kind of annoying to specify them again...
Whenever I want to call a predeclared function in a load()'ed module I get "myFunctionName() not found". Example is:
prog1.txt
(NOTE: I fail to format it properly but include.txt is in a separate file)
output
main.go
What am I doing wrong? Thank you very much.