adrian-thurston / colm

The Colm Programming Language
MIT License
164 stars 31 forks source link

bare sends have to go #121

Open adrian-thurston opened 4 years ago

adrian-thurston commented 4 years ago

Supporting bare sends is just too risky. Already encountered a case where I did not notice the warning of the ambiguity I had written because there were other warnings present that I was willing to ignore. Also it makes unfair assumptions about whitespace. Perhaps someone wants to write the following, in which case the ambiguity detection cannot work. Finally, an ambiguity in a core area of the language is just not so nice of a design.

send _
"thing to send

One of the main advantages of bare sends is that it reduces program lines when there are many multi-line sends. For example

send _
    "line 1
    "line 2

It's nice to be able to eliminate the send _ line altogether. If we add a shorthand syntax for send _ we can sneak it in on the first line, assuming all the lines are aligned with one level of indentation.

<<  "line 1
    "line 2

or

<-  "line 1
    "line 2

An arrow looks nicer, but << is faster to type.