Arc Forumnew | comments | leaders | submitlogin
And old and unpromising experiment in making indentation significant
19 points by pg 3592 days ago | 6 comments
At one point about a year ago I experimented with making indentation significant. I gave up because it was turning into a nasty mess. One thing I learned in the process is that things that in my opinion make Lisp good (the fact that there are no statements, and that anything can go anywhere) make it much harder to represent code unambiguously without parentheses.

If anyone wants to experiment with it, the code is at http://www.archub.org/noparen.arc . It's old and may have suffered from bit decay.



5 points by almkglor 3592 days ago | link

How about examples-of-use, and in particular, examples-of-why-it's-bad-to-use?

-----

3 points by ryantmulligan 3591 days ago | link

http://www.arclanguage.org/item?id=1964

-----

2 points by eds 3591 days ago | link

Think about the traditional lisp printer and pretty printer. It's just that in this case pretty might potentially mean that certain parentheses could be omitted if indentation could still make the meaning clear.

So you might potentially have a printer that wouldn't attempt to remove parentheses, and a pretty printer that would do so to an extent.

As for the reader, if parentheses were optional but still allowed in normal s-expressions, then you could probably get away with using the same reader for normal and indented input.

-----

1 point by ryantmulligan 3590 days ago | link

sounds like a lot of work, but more importantly I feel that the reader and printer would lack internal consistency. That is, it would be harder for programmers to wrap their head around the reader/printer concept.

-----

2 points by jgrahamc 3591 days ago | link

Speaking as someone who's done a lot with GNU Make... don't make indentation significant!

-----

2 points by lisper 3586 days ago | link

And speaking as someone who is actually a Python fan, I agree: making indentation significant is a big mistake IMHO. Parens are a feature, not a bug.

-----