home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / lisp / 2899 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.3 KB

  1. Xref: sparky comp.lang.lisp:2899 comp.lang.scheme:2603
  2. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!anarres.CS.Berkeley.EDU!bh
  3. From: bh@anarres.CS.Berkeley.EDU (Brian Harvey)
  4. Newsgroups: comp.lang.lisp,comp.lang.scheme
  5. Subject: Re: Quote syntax
  6. Date: 17 Nov 1992 22:48:21 GMT
  7. Organization: University of California, Berkeley
  8. Lines: 19
  9. Message-ID: <1ebsrlINNppi@agate.berkeley.edu>
  10. References: <Bxvq8r.E38@beach.csulb.edu>
  11. NNTP-Posting-Host: anarres.cs.berkeley.edu
  12.  
  13. werts@aardvark.cecs.csulb.edu (Michael Werts) writes:
  14. >In the design of Lisp was there a profound reason for using
  15. >    (QUOTE (+ 1 1)) or '(+ 1 1)
  16. >to inhibit evaluation instead of something like
  17. >    [+ 1 1] ?
  18.  
  19. Yes, the reason is that the Lisp notation allows a Lisp program to be
  20. readable as Lisp data.  That is, (quote (+ 1 1)) is just an ordinary
  21. Lisp list, so a Lisp program can read and manipulate it.  It's really
  22. the same reason that you say (f x) and not f(x) -- the Lisp way makes
  23. an expression readable as a list.
  24.  
  25. The notation '... is just an abbreviation for (quote ...) and is
  26. converted to the latter form when read.
  27.  
  28. It would have been possible, I suppose, to make [...] abbreviate
  29. quoting, but would [...] mean (quote (...)) or (quote ...)?  You
  30. want a uniform notation that can quote symbols as well as lists.
  31. If [+ 1 1] quotes (+ 1 1), how do you quote +?
  32.