Newsgroups: comp.lang.misc
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!rice!news!gateley
From: gateley@rice.edu (John Gateley)
Subject: Re: scheme [Re: What does an anti-perl look like]
In-Reply-To: sw@smds.UUCP's message of 24 Jun 91 13:49:22 GMT
Message-ID: <GATELEY.91Jun25134644@gefion.rice.edu>
Sender: news@rice.edu (News)
Organization: Rice University
References: <ROCKWELL.91Jun15015154@socrates.umd.edu> <2714@amix.commodore.com>
	<GATELEY.91Jun22001123@gefion.rice.edu> <583@smds.UUCP>
Date: 25 Jun 91 13:46:44

In article <583@smds.UUCP> sw@smds.UUCP (Stephen E. Witham) writes:

   In article <GATELEY.91Jun22001123@gefion.rice.edu>, gateley@rice.edu (John Gateley) writes:
   > ...You can write "the
   > magical power of lisp" into a C style language if you choose, or you
   > can write a more restrictive version of "lisp" which is basically
   > equivalent to C but uses prefix notation. So what - its only
   > syntax.

   "It's only syntax?"  (When you say "more restrictive," you imply more than
   syntax, but...)  Do you mean that syntax is unimportant, or do you
   mean that changing the syntax of Scheme would be easy, or what?

I mean that syntax is relatively unimportant. My personal preference
if for the prefix notation of scheme, but many people don't like it.
What is important about a language though, is the ease with which you
can express algorithms and ideas. This has very little to do with
syntax, unless you choose a completely confusing syntax. Perhaps the
scheme-syntax bashers are claiming that its syntax is completely
confusing. If so, I have to disagree, it's very simple, easy to learn,
and there are lots of tools available to help with those nasty little
parenthesis. 

   If you say syntax is unimportant, then you're pretty much ignoring 
   the main issue here.  Scheme with a different syntax is a nice idea,
   but it would be a different language, as far as this discussion goes.

I disagree with this statement, but ...

   If you say changing Scheme to look like C would be easy, that's only
   half true.  I've seen a description of an Algolish, infix-notation front 
   end for Lisp, and it looked great, and I'm sure that at a certain level,
   it's a trivial thing to do, but there are problems, like, how do you 
   define new operators,

You don't - scheme doesn't have operators! (cheap answer, I know).
However, it should be fairly easy to come up with some technique. Ada
has the capability of defining new infix operators, doesn't it?

   and how do you define macros,

Say foo is a macro, then foo(argument, ... , argument) would be an
invocation of the macro. The parser would have to have a table for
macro definitions, but this wouldn't be hard. See the answer to the
next question for the rest of the answer to this.

   how do you write
   programs that write programs,

This is the trickiest of the questions you pose. There are cheap
answers: have an intermediate language for these programs which look
like scheme, or just have the program writing program output a text
string. A better idea might be to provide a library with program
constructing functions. Remember, any program writing program must
send its output through eval (or be a macro) and so the parser will
be run on the resulting program as well.

   and how do you put lambda expressions in
   the middle of expressions.

Whats wrong with saying function (arg ...) { exp ... } a la C? Since
Scheme is expression oriented, these guys can appear anywhere. Perhaps
I missed something here?

   All of these add little chunks of 
   complexity, and little chunks of complexity count.

However, all these little chunks of complexity are already present in
some form in more standard (syntactically) langauges. If you choose
the more complex syntax then you have to pay the price.

John
gateley@rice.edu

--
"I've thought the thoughts of little children and the thoughts of men
 I've thought the thoughts of stupid people who have never been
 so much in love as they should be and got confused too easily
 to fall in love again." The Residents and Renaldo and the Loaf
