[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Assigning to a constant variable with function definition syntax doesn't error
- From: Andrew Gierth <andrew@...>
- Date: Fri, 18 Jun 2021 11:26:53 +0100
>>>>> "Soni" == Soni \"They/Them\" L <fakedme@gmail.com> writes:
Soni> We guess there's no way to make safe self-referential functions
Soni> in Lua?
Soni> local function x <const>() end -- doesn't work
Arguably the best thing to do here would be to make "local function"
imply <const> automatically; if you want the name to be a mutable local
var, then you can use
local x
x = function() end
The implication that a local function is const might provide scope for
more optimizations...
--
Andrew.