[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Your WRITE macro and GRINDEF
- To: (BUG LISP) at MIT-MC, KLE at MIT-AI
- Subject: Your WRITE macro and GRINDEF
- From: HIC at MIT-MC (Howard I. Cannon)
- Date: Wed, 12 Jul 78 06:35:00 GMT
- Original-date: 12 JUL 1978 0235-EDT
The reason that GRINDEF fails after you use your write macro is that
leave OUTFILES bound to a list of a closed file object. The correct
thing to do is:
(defun write macro (n) ;(write <file> <s-exp>)
`((lambda (outfiles ^r ^w)
,(caddr n)
(close (car outfiles)))
(list (open ,(cadr n) 'out)) t t))
You should almost always lambda-bind ^W or ^R in a program (though
at top-level you usually setq them). This prevents screws like the one you
experience with GRINDEF. GRINDEF is wrong, though (JONL take note) as
it should only look at OUTFILES if ^R is non-NIL.
--Howard