Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lisp syntax

21 views
Skip to first unread message

Oleg

unread,
May 26, 2002, 4:49:50 AM5/26/02
to
Hi

I'm wondering why CL syntax is more complex than Scheme syntax: e.g. there
are many different "defines" where Scheme has just one. Are the reasons for
this historical or practical?

Thanks

Oleg

Adam Warner

unread,
May 26, 2002, 7:50:50 AM5/26/02
to
On Sun, 26 May 2002 20:49:50 +1200, Oleg wrote:

> Hi
>
> I'm wondering why CL syntax is more complex than Scheme syntax: e.g.
> there are many different "defines" where Scheme has just one.

That's a poor example of more complex syntax Oleg. Lisp s-notation is just
as simple as Scheme. Both Lisp and Scheme have extremely simple syntax.

Familiarise yourself with some of the operators:
http://www.xanalys.com/software_tools/reference/HyperSpec/

For example read about the difference between defvar and defparameter:
http://www.xanalys.com/software_tools/reference/HyperSpec/Body/m_defpar.htm

... defparameter is useful in situations where loading or reloading the
definition would want to pick up a new value of the variable, while
defvar is used in situations where the old value would want to be
retained if the file were loaded or reloaded.

ANSI Common Lisp does have a large number of operators. But you don't have
to learn them straight away (and you can be productive just using a
subset). Most of them can be generated using the building blocks of the
language--and they would be indistinguishable from the built-in operators.
defvar and defparameter that I linked to above are an example of this.
They are macros. Just check out the link above.

With Scheme you may spend time creating functionality that is built into
Lisp.

> Are the reasons for this historical or practical?

Both. Lisp is a practical language and the numerous operators allow people
to work more productively. If functionality is built in you don't have to
spend time defining it yourself.

Lisp also has a long history and operators like `car' and `cdr' would
almost certainly not exist if the language was created today. You have the
choice to call them `first' and `rest' instead.

Regards,
Adam

Joe Marshall

unread,
May 26, 2002, 7:25:42 AM5/26/02
to

"Oleg" <oleg_i...@yahoo.com> wrote in message news:acq7ff$pt6$1...@newsmaster.cc.columbia.edu...

More namespaces.

Erik Naggum

unread,
May 26, 2002, 9:53:07 AM5/26/02
to
* Oleg <oleg_i...@yahoo.com>
[ trolling ]

Please, do not feed the trolls.
--
In a fight against something, the fight has value, victory has none.
In a fight for something, the fight is a loss, victory merely relief.

70 percent of American adults do not understand the scientific process.

Erik Naggum

unread,
May 26, 2002, 10:08:13 AM5/26/02
to
* Adam Warner

| That's a poor example of more complex syntax Oleg. Lisp s-notation is
| just as simple as Scheme. Both Lisp and Scheme have extremely simple
| syntax.

Not so. Scheme has no programmable reader. Common Lisp does.

Please do not feed the trolls, and more so not with bogus answers.

Eugene Zaikonnikov

unread,
May 26, 2002, 12:45:35 PM5/26/02
to
Hi,

Oleg <oleg_i...@yahoo.com> wrote in message
news:<acq7ff$pt6$1...@newsmaster.cc.columbia.edu>...

> I'm wondering why CL syntax is more complex than Scheme syntax: e.g. there

> are many different "defines" where Scheme has just one. Are the reasons for
> this historical or practical?

I think there are both.
First, there is an opinion that such a visible distinction between
definitions of certain kinds of objects makes code easier to read.
Then, it is quite hard to come up with a language which can embrace
all emerging, previously unthought paradigms without some interference
with existing constructions and semantics.
Scheme is not an exception here: consider that it has now DEFINE and
DEFINE-SYNTAX, and meditate over LENGTH and VECTOR-LENGTH.

--
Eugene.

Raymond Wiker

unread,
May 27, 2002, 2:07:45 AM5/27/02
to
vik...@funcall.org (Eugene Zaikonnikov) writes:

Consider also that scheme has at least two different
variations of "define" (depending on how you count).

--
Raymond Wiker Mail: Raymon...@fast.no
Senior Software Engineer Web: http://www.fast.no/
Fast Search & Transfer ASA Phone: +47 23 01 11 60
P.O. Box 1677 Vika Fax: +47 35 54 87 99
NO-0120 Oslo, NORWAY Mob: +47 48 01 11 60

Try FAST Search: http://alltheweb.com/

Marco Antoniotti

unread,
May 28, 2002, 1:16:56 PM5/28/02
to

Oleg <oleg_i...@yahoo.com> writes:

You must understand that Scheme is an extremely poor language
w.r.t. Common Lisp.

The difference between Scheme and Common Lisp is the following:

Common Lisp uses (roughly) `defun' and `defvar' where Scheme uses
`define'.

Scheme does not have a countepart for

defstruct (no structures/records in Scheme R^nRS)
defclass (no object system in Scheme)
defmacro (well, it does, but it is not `define' anymore)
defgeneric (no notion of generic functions in Scheme)
defmethod (no notion of OO in Scheme)
... and so on and on and on....

Cheers

--
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488
719 Broadway 12th Floor fax +1 - 212 - 995 4122
New York, NY 10003, USA http://bioinformatics.cat.nyu.edu
"Hello New York! We'll do what we can!"
Bill Murray in `Ghostbusters'.

Joe Marshall

unread,
May 28, 2002, 2:35:29 PM5/28/02
to

"Marco Antoniotti" <mar...@cs.nyu.edu> wrote in message news:y6celfw...@octagon.mrl.nyu.edu...

>
> Oleg <oleg_i...@yahoo.com> writes:
>
> > Hi
> >
> > I'm wondering why CL syntax is more complex than Scheme syntax: e.g. there
> > are many different "defines" where Scheme has just one. Are the reasons for
> > this historical or practical?
>
> You must understand that Scheme is an extremely poor language
> w.r.t. Common Lisp.
>
> The difference between Scheme and Common Lisp is the following:
>
> Common Lisp uses (roughly) `defun' and `defvar' where Scheme uses
> `define'.
>
> Scheme does not have a countepart for
>
> defstruct (no structures/records in Scheme R^nRS)
> defclass (no object system in Scheme)
> defmacro (well, it does, but it is not `define' anymore)
> defgeneric (no notion of generic functions in Scheme)
> defmethod (no notion of OO in Scheme)
> ... and so on and on and on....
>

MIT Scheme has all of these, but it is not `standard'.

Christopher Browne

unread,
May 28, 2002, 4:55:25 PM5/28/02
to
The world rejoiced as "Joe Marshall" <prunes...@attbi.com> wrote:
> "Marco Antoniotti" <mar...@cs.nyu.edu> wrote in message news:y6celfw...@octagon.mrl.nyu.edu...
>>
>> Oleg <oleg_i...@yahoo.com> writes:
>>
>> > Hi
>> >
>> > I'm wondering why CL syntax is more complex than Scheme syntax: e.g. there
>> > are many different "defines" where Scheme has just one. Are the reasons for
>> > this historical or practical?
>>
>> You must understand that Scheme is an extremely poor language
>> w.r.t. Common Lisp.

"Impoverished" is probably a more precise word for this...

>> The difference between Scheme and Common Lisp is the following:
>>
>> Common Lisp uses (roughly) `defun' and `defvar' where Scheme uses
>> `define'.
>>
>> Scheme does not have a countepart for
>>
>> defstruct (no structures/records in Scheme R^nRS)
>> defclass (no object system in Scheme)
>> defmacro (well, it does, but it is not `define' anymore)
>> defgeneric (no notion of generic functions in Scheme)
>> defmethod (no notion of OO in Scheme)
>> ... and so on and on and on....
>>
>
> MIT Scheme has all of these, but it is not `standard'.

There are SRFI specifications for a number of thse.

And there are a number of Schemes using the CLOS-like "Meroon" object
system.
--
(concatenate 'string "cbbrowne" "@acm.org")
http://www3.sympatico.ca/cbbrowne/linux.html
"I've seen a look in dogs' eyes, a quickly vanishing look of amazed
contempt, and I am convinced that basically dogs think humans are
nuts." -- John Steinbeck

Frank A. Adrian

unread,
May 29, 2002, 1:20:01 AM5/29/02
to
Christopher Browne wrote:
> And there are a number of Schemes using the CLOS-like "Meroon" object
> system.`

I just took a look at its home page. It has improved considerably since
its first version. It's still only single inheritance, though, but the
minimal MOP included might let one extend that. The MOP also seems a bit
under-powered. Also, it does seem odd that, with Scheme's insistance on a
single namespace, the Class and GF/method namespaces were separated from
the system nmespace. Finally, the whole instantiation issue seems overly
complex.

If one fixed these issues, it might make sense to add this to Scheme (but,
if you did the whole job right, you'd just have the original Dylan :-).

faa

Joe Marshall

unread,
May 29, 2002, 11:00:26 AM5/29/02
to

"Frank A. Adrian" <fad...@ancar.org> wrote in message news:6yZI8.150$pX1.2...@news.uswest.net...

The SOS (Scheme Object System) in MIT Scheme was based on
Gregor Kiczales's Tiny CLOS v 1.2 It has multiple inheritance
and the class and GF/method namespaces are the same as the system
namespace. The `instance-constructor' procedure is analagous to make-instance
and the initialize-instance generic procedure is analagous to
shared-initialize. You can run arbitrary code to
compute the effective method of a generic function.

Unfortunately there's virtually no MOP. Nonetheless it is step in
the right direction.

0 new messages