Hacker News new | past | comments | ask | show | jobs | submit login

There probably is something to the point that whitespace languages need more context to know what is going on? Moving code, in particular, is a bit more tedious with it. That said, I'm curious why anyone would think it can't be just as "mechanical."



Languages where blocks are indicated by indentation are not context-free (you have to keep the current and previous line indentation level as state). Everything about them is more tedious because you can't do structured editing.


You color them with virtual parentheses and then handle everything else sanely. Parinfer is a good example of how that logic looks.


Apologies if I was unclear, but this is what I meant. In whitespace languages, you have to see the context.

That said, you can probably make dinner structural editing work roughly the same. Might benefit from highlighting to indicate current scope.


Do you mean highlighting like this? https://www.draketo.de/software/wisp-mode-highlighting-seman...

Many parts of structural editing (but not all) become simple indentation shifting with indentation-sensitive languages.


I think so, yes.

And I know many become an indentation shift. This can be a lot more intrusive then just moving a paren. I personally find it harder to match indentation shifts. (Excepting simple one liners, of course.)


I usually do the alignment with tab: my Emacs wisp-mode knows the indentation levels in use in the file, so it’s just shift-tab to go back to the previous scope and tab to nest more deeply.

One observation I made is that wrapping an expression around several lines is often less intrusive, because I can simply insert a line before the block that uses only half the indentation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: