Open landism opened 4 years ago
In general, programming languages try to avoid the behavior you want here, because it means that adding any new symbol to the global scope would be a breaking change (since any script that defined that symbol would now be an error)
Yeah, that's a good reason not to use that solution to this problem. I guess most languages deal with this by not having a global scope, but that feels too heavy-weight for Tilt.
i do think we need to push for / invest in better tooling around starlark, so you can debug things like this, use an ide to jump to the definition, etc
e.g.:
yields:
Error: invalid call of non-function (string)
which could be really hard to debug! especially if someone makes use of this to, e.g., reassign a function to a wrapper of that function with slightly modified behavior, and then someone else tries to debug it without realizing it's been modified.
It'd be nice if trying to assign to "sync" in the first place generated an error.