From: Clint Hyde
Subject: RE: Lisp considered unfinished
Date: 
Message-ID: <3rad6l$ii0@info-server.bbn.com>
In article <··········@camelot.ccs.neu.edu> ····@ccs.neu.edu (William D Clinger) writes:

--> I am posting this followup only to comp.lang.lisp.


--> Common Lisp has about as many reserved words as COBOL.  (This is the

not only is this unfair, it's wrong, and I know you know it, sir. CL
has NO reserved words, if you work in your own package. if you try to
SETQ or DEFUN a symbol in the (probably locked) CL package, at least
with Allegro you get an error about the package being locked, and a
proceed option to go ahead and do it anyway. this is certainly all *I*
need, because I ALWAYS work in my own packages (except for short bits of
code or experimental things in early development).

--> effect of CLtL2 p 260.)  Unlike COBOL, where the compiler reliably
--> complains if you misuse a reserved word, the effect of misusing a

I'm sure this was not universally true of COBOL compilers.

--> reserved word in Common Lisp is implementation-dependent, and you
--> might not even get a warning message.

does the ANSI std say anything about this?

--> Not all Lisps have this large a problem.  IEEE Scheme has only 19
--> reserved words.  With the R4RS macro system, Scheme has no reserved
--> words at all.

great. CL has a different focus and history from Scheme. as you know.

 -- clint

From: Barry Margolin
Subject: Re: Lisp considered unfinished
Date: 
Message-ID: <3ri601$3uj@tools.near.net>
In article <··········@info-server.bbn.com> Clint Hyde <·····@bbn.com> writes:
>In article <··········@camelot.ccs.neu.edu> ····@ccs.neu.edu (William D Clinger) writes:
>--> Common Lisp has about as many reserved words as COBOL.  (This is the
>not only is this unfair, it's wrong, and I know you know it, sir. CL
>has NO reserved words, if you work in your own package. 

That's true, but it's not easy to work in a package that doesn't :USE
COMMON-LISP.  You have to manually declare every CL function or global
variable that you expect to use, or use explicit package qualifiers.  If
one of your functions/variables happens to have the same name as a CL
function, and someone later writes code that expects this name to refer to
the CL version, you won't even get an error (except perhaps if the argument
lists are different lengths).

The main use for packages that don't inherit from COMMON-LISP is for the
public interface to a module, not the internal implementation of the
module.

>--> reserved word in Common Lisp is implementation-dependent, and you
>--> might not even get a warning message.
>
>does the ANSI std say anything about this?

It says that the consequences of trying to redefine the Common Lisp symbols
is undefined.  It doesn't require that the implementation report it.
-- 
Barry Margolin
BBN Planet Corporation, Cambridge, MA
······@{bbnplanet.com,near.net,nic.near.net}
Phone (617) 873-3126 - Fax (617) 873-5124
From: Richard Levitte
Subject: Re: Lisp considered unfinished
Date: 
Message-ID: <LEVITTE.95Jun17102940@eliza.e.kth.se>
In article <··········@info-server.bbn.com> Clint Hyde <·····@bbn.com> writes:

   In article <··········@camelot.ccs.neu.edu> ····@ccs.neu.edu (William D Clinger) writes:

   --> Common Lisp has about as many reserved words as COBOL.  (This is the

   not only is this unfair, it's wrong, and I know you know it, sir. CL
   has NO reserved words, if you work in your own package. if you try to

No reserved words?  Eh, it was a year I hacked CL last time, but back
then there was something called special-forms, and I doubt you can get
closer to reserved words than that.  On the other hand I have to agree
with you that comparing the amount of reserved words in COBOL (did I
see the figure 700 somewhere?) to the amount of special forms in CL
is pretty unfair.  The latter are easily counted.  I think I came down
to 29 last I checked...

--
+--------------------------------------------------------------------+
! Richard Levitte, GNU on VMS hacker  ! tel: +46-8-83 12 15          !
! S�dra L�nggatan 39, II              ! fax: none for the moment     !
! S-171 49  Solna                     ! Internet: ·······@e.kth.se   !
! SWEDEN                              !                              !
+-<a href="http://www.e.kth.se/~levitte/gnu/gnu.html">GNUish VMS</a>-+
From: Mike Thome
Subject: Re: Lisp considered unfinished
Date: 
Message-ID: <MTHOME.95Jun22085300@lambic.bbn.com>
In article ·······@e.kth.se (Richard Levitte) writes:
  In article Clint <·····@bbn.com> writes:
    In article ····@ccs.neu.edu (William D Clinger) writes:
       --> Common Lisp has about as many reserved words as COBOL. 

    not only is this unfair, it's wrong, and I know you know it, sir. CL
    has NO reserved words, if you work in your own package. if you try to

  No reserved words?
Nope - *no* reserved words...
 
  Eh, it was a year I hacked CL last time, but back
  then there was something called special-forms, and I doubt you can get
  closer to reserved words than that.  
In spite of the name, there is nothing special about the binding of
special-forms to symbols that would make them anything like reserved
words:  In all languages I know of, a "reserved word" is a token which
may be used exclusively in the way the language specification defines
(eg. "int", "if" or "return" in C) - you are not allowed to redefine
these, use them as variables, etc.  This is not a restriction that
applies to CommonLisp - all symbols may be redefined or rebound to
whatever you want whenever you want: you *do* have to be careful that
you do not change a binding which some other function (or Lisp itself)
depends on - but with care and your own package you can redefine (as I
have at various times) "if", "defmethod" even "setq".

cheers,
	-mik
--
Michael Thome (······@bbn.com, 617-873-1853)
http://www-openmap.bbn.com/users/mthome/
From: Harley Davis
Subject: Re: Lisp considered unfinished
Date: 
Message-ID: <DAVIS.95Jun22162051@passy.ilog.fr>
In article <····················@lambic.bbn.com> ······@lambic.bbn.com (Mike Thome) writes:

     No reserved words?
   Nope - *no* reserved words...

     Eh, it was a year I hacked CL last time, but back
     then there was something called special-forms, and I doubt you can get
     closer to reserved words than that.  

   In spite of the name, there is nothing special about the binding of
   special-forms to symbols that would make them anything like
   reserved words: In all languages I know of, a "reserved word" is a
   token which may be used exclusively in the way the language
   specification defines (eg. "int", "if" or "return" in C) - you are
   not allowed to redefine these, use them as variables, etc.  This is
   not a restriction that applies to CommonLisp - all symbols may be
   redefined or rebound to whatever you want whenever you want: you
   *do* have to be careful that you do not change a binding which some
   other function (or Lisp itself) depends on - but with care and your
   own package you can redefine (as I have at various times) "if",
   "defmethod" even "setq".

What happens in Common Lisp if you do this:

(flet ((cond (&rest args) (car args)))
  (cond 'im-a-function-now))

If this is an error, then I would call special forms pretty close to
reserved words.

-- Harley Davis
-- 

------------------------------------------------------------------------------
Harley Davis                            net: ·····@ilog.fr
Ilog S.A.                               tel: +33 1 46 63 66 66
2 Avenue Galli�ni, BP 85                fax: +33 1 46 63 15 82
94253 Gentilly Cedex, France            url: http://www.ilog.com/
From: Mike McDonald
Subject: Re: Lisp considered unfinished
Date: 
Message-ID: <3sci4r$ph5@fido.asd.sgi.com>
In article <···················@passy.ilog.fr>, ·····@ilog.fr (Harley
Davis) writes:
|> 
|> In article <····················@lambic.bbn.com>
|> ······@lambic.bbn.com (Mike Thome) writes:

|> What happens in Common Lisp if you do this:
|> 
|> (flet ((cond (&rest args) (car args)))
|>   (cond 'im-a-function-now))
|> 
|> If this is an error, then I would call special forms pretty close to
|> reserved words.
|> 
|> -- Harley Davis
|> -- 
|> 
|>
------------------------------------------------------------------------
-------
|> Harley Davis                            net: ·····@ilog.fr
|> Ilog S.A.                               tel: +33 1 46 63 66 66
|> 2 Avenue Galli�ni, BP 85                fax: +33 1 46 63 15 82
|> 94253 Gentilly Cedex, France            url: http://www.ilog.com/
|> 

titian=>lisp
CMU Common Lisp 17f, running on titian
Send bug reports and questions to your local CMU CL maintainer, or to
··········@cs.cmu.edu.
Loaded subsystems:
    Python 1.0, target SGI
    CLOS based on PCL version:  September 16 92 PCL (f)
    CLX X Library MIT R5.02
* (flet ((cond (&rest args) (car args)))
  (cond 'im-a-function-now))

IM-A-FUNCTION-NOW
* 


  Mike McDonald
  ·······@engr.sgi.com
From: Barry Margolin
Subject: Re: Lisp considered unfinished
Date: 
Message-ID: <3se0d0$3tp@tools.near.net>
In article <···················@passy.ilog.fr> ·····@ilog.fr (Harley Davis) writes:
>What happens in Common Lisp if you do this:
>
>(flet ((cond (&rest args) (car args)))
>  (cond 'im-a-function-now))
>
>If this is an error, then I would call special forms pretty close to
>reserved words.

You can't portably redefine any of the built-in functions, macros, or
special operators using DEFUN, FLET, or LABELS.  The reason for disallowing
DEFUN is that other functions in the implementation might depend on
implementation-specific features of their version of the function.  The
reason for disallowing FLET and LABELS is that the implementation's macros
in the body could pick up the redefinition, so they might operate
differently.

The people who say that there are no reserved words consistently mention
packages.  So while the symbol COMMON-LISP:COND is reserved, COND in
general is not.  Thus, you can do:

(defpackage my-package
  (:use) ; make it pristine
  (:import-from COMMON-LISP FLET CAR &REST)) ; but we need these

(in-package my-package)

(flet ((cond (&rest args) (car args)))
  (cond 'im-a-function-now))
-- 
Barry Margolin
BBN Planet Corporation, Cambridge, MA
······@{bbnplanet.com,near.net,nic.near.net}
Phone (617) 873-3126 - Fax (617) 873-5124