home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / lisp / 3317 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1.7 KB

  1. Path: sparky!uunet!pipex!warwick!uknet!edcastle!aiai!jeff
  2. From: jeff@aiai.ed.ac.uk (Jeff Dalton)
  3. Newsgroups: comp.lang.lisp
  4. Subject: Re: SETF vs. SETQ
  5. Message-ID: <8227@skye.ed.ac.uk>
  6. Date: 21 Jan 93 19:45:54 GMT
  7. References: <HAL.93Jan13083812@monsun.si.no>
  8. Sender: news@aiai.ed.ac.uk
  9. Organization: AIAI, University of Edinburgh, Scotland
  10. Lines: 31
  11.  
  12. In article <HAL.93Jan13083812@monsun.si.no> hal@si.no (Hallvard Tretteberg) writes:
  13. >In article <1iupurINNih2@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
  14. >   No, there's only a MULTIPLE-VALUE-SETQ.
  15. >
  16. >   In hindsight, having separate SETQ and SETF was a bad design, IMHO.
  17. >
  18. >I agree. In a Lisp style guide I wrote the general rule was to use the
  19. >most specific construct when choosing among several alternative ways
  20. >of doing the same thing. But, when it came to SETF vs. SETQ I
  21. >recommended using SETF all the time.
  22.  
  23. I disagree with the most-specific rule in general, and I don't see
  24. anything wrong with using SETQ.  Does anyone seriously want to argue
  25. that SETQ is unclear, for instance?
  26.  
  27. >One argument for using SETQ could be that it is easier to spot which
  28. >uses are fast-simple-variable access, compared to
  29. >slow-complicated-slot access where SETF should be used. But with
  30. >SYMBOL-MACROLET you can be fooled by an innocent SETQ, because it, as
  31. >I understand, is treated like a SETF.
  32.  
  33. You can be fooled by an innocent (SETF <symbol> ...) as well.
  34.  
  35. >One thing that annoys me is that one can't use #'(setf
  36. >struct-slot-reader) because struct-slot setters can be implemented as
  37. >setf-macros and not as methods. 
  38.  
  39. That annoys me too, but struct-slot setters should be functions
  40. (not methods) just like struct-slot readers are.
  41.  
  42. -- jd
  43.