This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Generalized set!


>>>>> "Jim" == Jim Blandy <jimb@red-bean.com> writes:

    Jim> *I* have to decide???  Ugh.

    Jim> I looked at Common Lisp, and I was not disappointed.
    Jim> define-setf-method is utterly baroque.  The closest thing to
    Jim> our situation is the simple form of defsetf, which passes the
    Jim> rhs last.  (This has probably already been mentioned.)

*sigh* :)  I don't blame you for hating defsetf or define-setf-method,
 but one of the things a cursory reading of the standard doesn't tell
 you is that in fact *neither* are used in practice.

(defun (setf foo) (value ...)
		   ^^^^^
  ...)

or

(defmethod (setf foo) (value ...)
  ...)

are how things are used in practice, and it's hard to beat this
notation, at least in CL.

As for the rest, you've probably already heard the arguments many
times before and I won't go over them.  However, if it does end up RHS
last and you have to provide adapters for e.g. vector-set! and
string-set! I for one will be exclusively using the adapters just so
that I can fit keywords and optional arguments into my set! forms
without unbelievable pain.
-- 
Graham Hughes <ghughes@cs.ucsb.edu>
PGP Fingerprint: 36 15 AD 83 6D 2F D8 DE  EC 87 86 8A A2 79 E7 E6
((lambda (foo) (foo foo)) (lambda (foo) (foo foo)))