Newsgroups: comp.lang.lisp,comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!newsfeed.rice.edu!newspump.wustl.edu!news.ecn.bgu.edu!news.cse.psu.edu!rutgers.rutgers.edu!news.columbia.edu!panix!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!howland.erols.net!torn!kwon!watserv3.uwaterloo.ca!undergrad.math.uwaterloo.ca!not-for-mail
From: papresco@csclub.uwaterloo.ca (Paul Prescod)
Subject: Re: Fractal Programming, LISP and Scheme
Sender: news@undergrad.math.uwaterloo.ca (news spool owner)
Message-ID: <E69qH3.6M7@undergrad.math.uwaterloo.ca>
Date: Thu, 27 Feb 1997 15:46:15 GMT
X-Newsposter: Pnews 4.0-test50 (13 Dec 96)
References: <01bc13dc$cfaa2b20$0f02000a@gjchome.nis.newscorp.com> <5el0sh$d7g$1@news.hal-pc.org> <MPG.d78f19160e2c8dc9896e8@news.demon.co.uk> <5f1jr9$muq$1@news.hal-pc.org>
Nntp-Posting-Host: calum.csclub.uwaterloo.ca
Organization: University of Waterloo Computer Science Club
Lines: 47
Xref: glinda.oz.cs.cmu.edu comp.lang.lisp:25772 comp.lang.scheme:18960

In article <5f1jr9$muq$1@news.hal-pc.org>,
Jonathan Guthrie  <jguthrie@brokersys.com> wrote:
>Although you can do this in a so-called "Object Oriented" language, the
>languages in question can do it in a cleaner fashion.  That is because
>the natural way to extend a language is with function calls and LISP and
>its variants are built around function calls and things that look like
>them.  In C++ (unless you do lots of operator overloading, which has its
>own dangers) your "extensions" look different from the base language
>whereas in LISP, it looks the same.

You make it sound like this was an afterthought in C++, where it was 
actually central to the language design. I would not argue with you if
you said that it was a *failure* in C++, but clearly C++ was designed so
that you could extend it in ways that looked "natural" as if they were 
built-in.

I have heard people slam languages in the Pascal/Modula family for not 
attempting this (as if there were not enough things to slam Pascal/Modula
about!), but I am not yet convinced it really matters. By analogy: we have
argued that despite the fact that prefix will look non-obvious to most
people raised on infix mathematics, the learning curve to jump from infix
to prefix is small. Similarly, the leap from:

matrix1 = matrix2 + matrix3;

to 

matrix1.add( matrix2, matrix3) 

is pretty small. I can understand the perfectionist argument that if 
builtins can be manipulated with a particular syntax then extensions should
be manipulable with the same syntax, but sugar is sugar -- I don't consider
it a serious argument against a language. I don't think that the equivalent
Scheme built-in vs. extension are that much closer:

(define int1 (+ int2 int3))
(define matrix1 (matrix+ matrix2 matrix3))

You still have to learn the name and semantics of the "matrix+" operator. 
That's the time consuming part (in any language), not checking whether the 
syntax is infix or prefix, functional or operator-based. I suspect that the
real reason that Scheme and Lisp are nicely extensible languages are because
the *semantics* are more regular (e.g. "Who is responsible for this object?",
"When does this get destroyed?", "Is this a copy or the original object?").

 Paul Prescod

