Yes, I thought I was catching the right error, but later realized that I was being too militant assuming that a proper function has no "closure". Obviously there is, and the default closure has all the globals.
However, I think using globals in a function can be surprising for a user that assumes no side effect, so I could "downgrade" the lint message level from ERROR to FYI. What do you think? Tony On Tuesday, June 10, 2014 10:22:42 AM UTC-4, Stefan Karpinski wrote: > > This is really nice work. In the future, I'd really like to move bits of > TypeCheck and this sort of linting into base Julia, maybe invoked with a -w > flag. > > Regarding this: > > Using globals in function without declaring them (This one isn't an error, >> but I personally prefer explicit declaration of globals dependency inside >> functions for readability.) > > > I'm not sure how you're dealing with this, but this would, as stated, warn > every time you call a function the way I'm reading it. Are you specifically > not warning for globals that are used as call heads? I certainly wouldn't > want to have to declare as global every function I'm going to use. > > > On Tue, Jun 10, 2014 at 7:18 AM, Tony Fong <[email protected] > <javascript:>> wrote: > >> It's a great idea! I'll look into it. Thanks for the pointer. >> >> >> On Tuesday, June 10, 2014 5:50:27 AM UTC-4, René Donner wrote: >>> >>> I don't know how feasible it is, but a (perhaps optional) inclusion of >>> the functionality in https://github.com/astrieanna/TypeCheck.jl would >>> be great! >>> >>> >>> >
