3 ms·
I meant as _implementing_ an editor, like Paredit. If you're implementing Paredit, you need to find the parens in order to manipulate the current node. I just m
by chrisdone 14y ago
I meant as _implementing_ an editor, like Paredit. If you're implementing Paredit, you need to find the parens in order to manipulate the current node. I just meant it's slightly easier to write such an editor. (∩▂∩) At least, I think it would be. I haven't tried!
- tych0 14y agoWouldn't it be easier to use some kind of formal grammar and a parser instead of the stack based thing you describe? In that case, lisp is probably one of the easiest languages to parse since it is all parenthesized s-expressions and not whitespace dependent at all.
- chrisdone 14y agoSure, it's fairly easy to parse. I think probably there is a speed hit (Emacs Lisp code is very slow—though you can call out to an external C library (I've tried it), for which ECL could be maybe used), but quite possibly it's just that, for Lisp, Paredit is mostly sufficient. I think the only case where it breaks down/has trouble is reader macros. I think it can consult SBCL somewhat upon encountering them, not entirely sure.
- hga 14y agoI have tried, and it's very easy (Goldhill's editor back in 1984); can't say for other languages, though.