You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider an ES6 object literal with a method that has empty arguments
and an empty body:
{
d() { }
}
Before this commit, that would intuitively have been written as
(object ('d ()))
which failed because the ('d ()) list has 2 elements, which the logic
attempted to compile to an ordinary property instead of a method. It's
ambiguous with
{
d: null
}
if () were to compile to null. It currently compiles to nothing (#32),
but the argument stands.
This change hence introduces this syntax
(object (method 'd ()))
similarly to how getters and setters already allow empty bodies with
(object (get 'd ())
(set 'd ()))
I also moved the check for the initial "get" / "set" / "method" atom
above the args.length==2 check, to ensure it takes precedence.
In eslisp, you can use
()
in the(for () () ())
special form to create an infinite loopfor (;;) {}
But if you use
()
in an expression, it throws a compilation error, e.g.(+ 1 ()) -> BinaryExpression right member must be an expression node
.Typically
()
evaluates tonil
, so I'd expect the output to be1 + null
with no compiler error.It'd still need to keep current behavior in for-loops, since
for (;;) {}
is a different thing fromfor (null; null; null) {}
.Alternatively,
()
could always meannull
, and there would be another way of expressing empty expressions in for loops.The text was updated successfully, but these errors were encountered: