3 ms·
Given the rule: expr := 'if' expr 'then' expr 'else' expr An expression may start with a sequence 'if if if if ...' of arbitrary length (and will contain t
by victorNicollet 8y ago
Given the rule:
expr := 'if' expr 'then' expr 'else' expr
An expression may start with a sequence 'if if if if ...' of arbitrary length (and will contain that same number of 'then' and 'else' keywords, although not as a sequence).
- FBT 8y agoA simpler variation of the same concept is to use the fact that for every expression `expr`, `do expr` is a valid expression, allowing you to start a sequence with any number of `do`s. But the challenge as I see it is to stack as many distinct keywords in a row. In javascript you can do the same thing with `await`: for every expression `expr`, `await expr` is a valid expression, so you can start with a sequence of any number of `await`s. That's great, but ultimately not a challenge: the real puzzle is in stacking as many unique keywords as possible.