ipso icon indicating copy to clipboard operation
ipso copied to clipboard

One-line whitespace-sensitive programs

Open LightAndLight opened this issue 3 years ago • 0 comments

Required for #209 to work well.

I should be able to write "block" expressions like comp and case on a single line.

Possible syntaxes:

  • comp { bind name <- readln; println "hi $name"; }
  • comp; bind name <- readln; println "hi $name"; end

Ruled out:

  • comp; bind name <- readln; println "hi $name"

    I think this style required too much lookahead to parse, e.g. in

    case x of; A -> comp; println "a1"; println "a2"; y -> println "b"
    

    y looks like a function call in a computation expression. The parser will only know it's in a pattern context by reaching ->, failing, then backtracking.

LightAndLight avatar Jul 26 '22 02:07 LightAndLight