lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, 5 Jun 2019 at 15:35, Coda Highland <chighland@gmail.com> wrote:
> It's not a problem when the proposed extension is around, but it does introduce inconsistencies with past versions of Lua, and there's still one grammatical ambiguity.
>
> local resource
> x = 3
>
> Am I declaring a resource named x with the value of 3, or am I declaring a variable named resource with no initial value, and then setting an existing variable named x to 3?

Here you are declaring a variable named resource just as you would in
existing versions of Lua. I don't see an ambiguity.

>
> Having some sort of signifier also greatly reduces the complexity of parsers and preprocessors, so I strongly oppose doing this without any sort of syntactic indication. I prefer @ over <> but there needs to be SOMETHING.

Okay that is a different concern. Making a resource declaration ugly
and therefore visible is not necessarily a bad thing.

local @resource x

Makes it very visible.

But overuse of @ in a program can make it very hard to read.
Imagine

local @constant ...
a few times.

Regards