On Fri, 11 Nov 2016 at 16:24 Reza Naghibi <[email protected]> wrote:
> > variable uses out of order > > Right now this seems to be a limitation in the vcc. Im tempted to say this > would simply be irksome for the time being. I would have to research how > this could be addressed, but im feeling this fix is out of scope right now > (and can be fixed independently of this VIP). > Agreed that it it can be fixed independently, though I do think that the new object powers will make the problem more prevalent. > > uninitialised objects > > This is a very valid concern and good thing you brought this up. When I > first read it, I thought about how other languages tackle this, in > particular, Java and C. Both languages either error out or warn at compile > time about uninitialized variables. So I think we could use the same > approach. If you define a variable inside of a control statement (if/else), > then that's a compile error due to it possibly being uninitialized and > unsafe. So this definitely needs to be addressed and fixed. > We do not correctly handle object initialization inside of control statements today, so disallowing that at compile time seems like a natural first step. Though there are use cases where it would be nice to be able to do that, so having a plan for what it should be like down the line would help to make sure we don't get it wrong in the mean time. Martin
_______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
