[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Local Variables
- From: Dirk Laurie <dirk.laurie@...>
- Date: Mon, 11 Aug 2014 14:06:08 +0200
2014-08-11 13:33 GMT+02:00 Axel Kittenberger <axkibe@gmail.com>:
>> Any language in which interactive use for tiny one-off jobs
>> is a design objective cannot afford to make undeclared
>> variables illegal. People just won't use it.
>
>
> This is the dichotomoy at its core. One group wants to write small
> scriptlets while the other writes large(r) software projects. One-off jobs
> is a very extreme example.
Well, I do both. I have a 1600-line Lua program with near the top:
local meta_ENV=getmetatable(_ENV)
setmetatable(_ENV,{__newindex = function (ENV,name,value)
logfile:write(where(2),"Assigning _ENV.",name,"\n")
rawset(ENV,name,value)
end})
and near the end,
setmetatable(_ENV,meta_ENV)
If there is anything whatsoever in `logfile`, I get worried.
Point is, Lua allows tricks like the above to those who
need them, when they need them, without inflicting them
on people who at that moment, don't.
- References:
- Local Variables, Mason Mackaman
- Re: Local Variables, Roberto Ierusalimschy
- Re: Local Variables, Steven Degutis
- Re: Local Variables, Axel Kittenberger
- Re: Local Variables, Tim Hill
- Re: Local Variables, Dirk Laurie
- Re: Local Variables, Dirk Laurie
- Re: Local Variables, Coroutines
- Re: Local Variables, Sean Conner
- Re: Local Variables, Dirk Laurie
- Re: Local Variables, Axel Kittenberger