|
Am 10.03.2016 um 11:42 schrieb Soni L.:
There was many suggestions for language enhancements but it seems dificult to enhance this simple and neat language. This with-thing is one of the few ideas that make sense while trying to keep lua simple and clean.On 10/03/16 05:09 AM, Thijs Schreijer wrote:This can be implemented with .name as being a global access. But you'll need to end your lines with a ;.I never thought I'd say this, but I like the way Visual Basic 6 does it:While reading up the thread, I had the same thought. I also like that about VB.with foo .x = 1 .y = some_local_var end with I don't remember the exact syntax, but the important part is you stillincluded the dot from foo.x, so that distinguished properties from othervariables in outer scopes.Thijse.g. do local _ENV = something; .a = 1; .b = 2; end
Right now we can code somthing in lua that looks similar to a while statement. (We discusses this some time ago about a case statement.)
From my point of view a while statement make sense to calculate a value (a table reference) once and use it many times to save run time. Also the lua source code may become easier to read in some cases. The need to use ";" between statements is no drawback i think. I use this already all the time. (old pascal coder habit) To use whitespaces betwen statements is the one and only lua syntax i dont like.
Ulrich.