Oh, I had forgotten half-written mail to my drafts folder. My answer is
coming a little late.


On 2009-02-16 12:54 (+0800), pansz wrote:

> Teemu Likonen 写道:
>> 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.
>
> Lua has the design philosophy like lisp but with different syntax,
> i.e. Lua is a true function-programing language without the heavy
> nested parentheses.
>
> Since it is extremely easy to embed Lua into any program I think Lua
> is better than Lisp in such case.

There is still a big advantages with parentheses: the code is easy to
parse for a machine. I mentioned replace strings previously. In Emacs
user can have \,expression forms anywhere in replace strings. As Lisp
code is already structured as clear hierarchical units (that is, nested
parentheses) there is no need to separately mark where the expression
ends. In some other language user could use quotes to mark the code
part, something like this:

    \,"for i in range(1,10) | ... | endfor"

But if the expression happens to contain those expression markers
(double quotes in this example) then there must to be a meta character
for escaping them (like "\"). More trouble. Such interactively used code
snippets would have a kind of different syntax then. Code can't be
directly copied and pasted from elsewhere.

With parentheses or similar structural markers it is also extremely
trivial to evaluate code interactively. There are things like C-x C-e in
Emacs to evaluate the expression that is preceding the cursor and C-M-x
to evaluate the current top-level form unit in the buffer. Without
parentheses user needs to mark (like Vim's visual mode) the code part
which she wants to evaluate. Not too difficult but not as convenient
either.

Emacs Lisp is definitely not the best thing in the world but in general
it's really hard to beat Lisp when building a flexible environment which
can be modified interactively and customized heavily.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to