Arc Forumnew | comments | leaders | submitlogin
1 point by eds 6114 days ago | link | parent

I took a shot at writing an indentation based syntax a while ago. You don't technically need the colons, although that makes it difficult to introduce new parens mid-line.

http://arclanguage.org/item?id=1917

I like the idea of indentation based syntax, but the colon solution looks like only half a solution. You only remove half the delimiting characters, and the ones you remove are the ones that are the easiest to type when you have a good editor. (In fact, some editors even add them for you.) Considering that I prefer parens to colons as delimiters, I would currently prefer to stay with s-expressions.

And as much as I might like indentation based expressions, kennytilton has a good point about editing code. In indentation based syntaxes, you have to redo the indentation manually (or rely on an editor to guess), whereas in traditional lisp you can just hit the auto indent key (since indentation can be determined programmatically).



1 point by applepie 6114 days ago | link

The colon proposal attempts to be orthogonal to traditional s-expression notation (every s-expression in traditional notation keeps reading the same as always, no matter how it is formatted).

> I like the idea of indentation based syntax, but the colon solution looks like only half a solution

Well, if we want to read s-exprs, _somehow_ the programmer must hint the reader about where the parens go.

I don't want the reader to guess what I mean, or juggle with whitespaces.

I think the colon notation is more visually appealing than "just parens", and doesn't hurt programmers who don't want to use it.

-----

2 points by cadaver 6114 days ago | link

Since, as I've pointed out, the editor can handle the parens for you completely and unabiguously, even without any special commands, you could simply turn-off, parens that exist in addition to indentation, make them invisible.

If you then additionally make the editor display the opening parenthesis as a colon then, voila, you have the visually pleasing colon syntax.

In such a mode you'd always have to be indentation perfect, but just as with colon syntax, you can simply switch to a more traditional editing mode.

-----