On 2009-02-13 11:42 (+0100), Tony Mechelynck wrote:
> OTOH, Emacs uses Lisp, which is supposed to be a "standard" language,
> one you might "not have to learn" when you first meet Emacs because
> you might already know it, but in fact the subjective "ugliness" which
> I feel in Lisp's prefixed-Polish notation and its heavily nested
> parentheses is part of why I prefer Vim over Emacs.
But if we are more practical, Lisp is more powerful and elegant for
interactive programmable environments. One reason are exactly the nested
parentheses and other is the Lisp's nature of having data and code
completely the same thing. Here's an example. With languages like Vim
script there are two separate classes: commands and expressions. I think
most languages are like this. Commands do something and expressions
evaluate to something. In some situations only commands are allowed and
in some situations only expressions are allowed. In Lisp there are only
expressions; so called commands are also expressions. For example, with
Vim you can do
:s/foo/\=expression
And "expression" can be anything that Vim can evaluate, and that's a
powerful thing as we all know. Emacs' version of the same is using
\,expression
anywhere in a replace string. But as this is Lisp the expression can be
anything. Let's capitalize every word except certain articles:
Replace
\<\w+\>
with
\,(let ((case-fold-search nil)
(word \&))
(if (string-match "\\<\\(a\\|an\\|the\\)\\>" word)
(downcase word)
(capitalize word)))
This is a toy example and I know that this particular task can be
managed with Vim (even with fewer keystrokes). So please note that I'm
not talking about what an editor can or can not do as a whole. My point
is to demonstrate differences in languages, and in situations like this,
Vim script is nowhere as elegant as Emacs Lisp because the class of
expressions is fundamentally limited. To include commands in an
expression user has to wrap them inside a function and of course the
function must first be defined elsewhere. On the other hand, with Emacs,
user can take any Emacs Lisp code in the world and put it in the place
of any Lisp expression. Even functions can be defined in the place where
they are called (lambda functions).
I'm not arguing against anyone's preferences in programming languages
but I'm arguing that it's pretty much a fact that Lisp and those "ugly
parentheses" are extremely powerful in interactive programmable
environments such as advanced text editors.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---