Author: Christophe Theron
Date: 21:53:15 02/23/04
Go up one level in this thread
On February 23, 2004 at 17:55:41, Gareth McCaughan wrote:
>On February 23, 2004 at 13:52:47, Christophe Theron wrote:
>
>> From what I see, LISP has a basic "(operator arg arg arg...)" structure
>> (correct me if I'm wrong, the last time I looked at LISP was 15 or 20 years
>> ago).
>...
>> But there is something that I find very inelegant: if one is ready to
>> give up on the more standard "operator(arg,arg...)" or "arg1 operator arg2"
>> (like in "a+b"), then it is possible to do it without the parenthesis!
>
>Yes. But then you lose some useful things.
>
> - You can no longer have optional arguments or keyword arguments.
> (Well, more or less. You can do, e.g., something similar to C's
> "printf", where one parameter determines how many others to
> pop off the stack.)
It is not a problem in Forth to have a variable list of arguments, because you
have all the tools you need to manage the stack. Forth is all about the stack.
> - The structure of the code is no longer there. You can reconstruct
> it, but it isn't *there* in the list structure.
You use identation for that. You would ident a LISP program anyway, wouldn't
you?
> That makes writing
> macros much, much harder. Macros are one of the major reasons
> why Lisp is cool.
In Forth, any object is a macro, in a sense.
If LISP is cool because it has macros, I guess Forth is even cooler! :)
>For me, the tradeoff is strongly in favour of keeping the parentheses.
>My text editor helps me keep them balanced, and I don't find that they
>get in the way of my comprehension.
That is possible, but I do have to deal with parenthesis in C as well. We use
much less of them but sometimes it's not easy to manage at all. So I would not
want to have to stuff every instruction inside parenthesis...
Christophe
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.