[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: Francisco Olarte <folarte@...>
- Date: Fri, 18 Jun 2021 09:30:32 +0200
Soni:
On Thu, Jun 17, 2021 at 11:57 PM Soni "They/Them" L. <fakedme@gmail.com> wrote:
> We guess there's no way to make safe self-referential functions in Lua?
> local function x <const>() end -- doesn't work
Only const self-referencial, but you are right. Const glitch apart,
3.4.11 does not list these syntax as valid.
I assume if The Team gets to it via some magic it can be made to work,
and documented in a couple lines. Meanwhile I think the same effect
can be achieved using a tmp ( local _f=function()..end; local f
<const> = _f ) which should only imply a little namespace pollution.
Francisco Olarte.