lua-users home
lua-l archive

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

On 17/12/2018 06:35, Coda Highland wrote:
On Sun, Dec 16, 2018 at 1:50 PM Egor Skriptunoff
<> wrote:


What do you think about the following suggestion?

Let's introduce special "ignore me" symbol in Lua syntax.
(The description below assumes this symbol is the backtick)

I disagree with introducing special meaning to consecutive such
symbols. If they're supposed to be "ignore me" symbols then they
should be, y'know, ignored. Which means the second one should be
ignored the same as the first one.

As other posters have mentioned, it also makes a mess when you start
combining the various kinds, and while it's true that you just
"shouldn't do that" it also seems like something designed to improve
readability shouldn't be a tool to make it worse. We have line and
block comments for that, despite your assertion that you don't intend
it to be used that way.

If we want an annotation syntax, then we should ask for an annotation
syntax, and ideally it should resemble something that people already
recognize as an annotation syntax.

/s/ Adam

I largely agree with you.

There are two orthogonal problems here that are addressed which should be kept separated, IMO.

Annotations: although I don't feel the urge to have that feature in Lua, probably it would be handy, especially if Lua provided a standard mean to process them without additional tools.

Numeric optional separator: I crave this, together with a standard syntax for binary literals[1] . C++ addressed both needs with the syntax:


I'd prefer the underscore as a separator, though:



-- Lorenzo

[1] Yes, I know I could define something like this:

B'1100 1010'

but it wouldn't be standard, it will require runtime execution and it's extremely memory-wasteful (think of initialization of MCU code, for example).