Hi all. I've got a bit of a silly question for you. In the grammar,
atomicExpression
includes a number of things that can be evaluated, like
literalConstant
and
functionLiteral
. Even the different
jump
structures (like
throw
and
return
) appear to technically evaluate to
Nothing
.
But the list also includes
loop
, which doesn't appear to be an expression. In fact, if you try to assign a
for
loop to a variable, the compiler says that "For is not an expression, and only expressions are allowed here."
So, I was wondering, why does
loop
show up as part of
atomicExpression
in the grammar? Is there some context in which loops
can be evaluated?