_hyperscript icon indicating copy to clipboard operation
_hyperscript copied to clipboard

[Request] provide an alternative statement separator (in addition to "then")

Open rozek opened this issue 3 years ago • 2 comments

I know that we may separate statements by means of then (not only) if they are on the same line.

But not always there is this logical consequence which is implied by this word, like in

  set x to 0 then set y to 0 then set z to 0

If we would have an alternative (e.g., ;) the above code would actually become more readable:

  set x to 0; set y to 0; set z to 0

rozek avatar Jul 29 '22 05:07 rozek

FWIW, you can put statements on the same line without any separator:

set x to 0    set y to 0    set z to 0
log x + y + z

I added some additional whitespace for readability.

We've resisted adding a semicolon terminator for a while because

  • hyperscript's ancestor HyperTalk doesn't have one
  • the semicolon is not used this way in natural languages

A dot statement terminator would be nice, but it would conflict with lots of things.

dz4k avatar Aug 03 '22 10:08 dz4k

Oh, that#s good to know - did I miss that in the docs? Or should you mention that more explicitly (I remember, that then was specified as "optional"...

rozek avatar Aug 03 '22 10:08 rozek