[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SETF madness :-)
- To: common-lisp@SU-AI
- Subject: SETF madness :-)
- From: Guy.Steele@CMU-CS-A
- Date: Fri, 07 Oct 1983 08:00:00 -0000
Who needs UNREAD-CHAR? Just (SETF (READ-CHAR stream) char) and
then (READ-CHAR stream) will return the char.
Who needs RENAME-FILE? Just (SETF (TRUENAME stream) newname) ...
Who needs DELETE-FILE? Just (MAKUNBOUND (TRUENAME stream)) ...
(Clearly we need MAKUNBOUNDF.)
And, of course, if you need to make the sun stand still for a while,
you do (LET ((NOW (GET-UNIVERSAL-TIME)))
(LOOP (SETF (GET-UNIVERSAL-TIME) NOW)))
until you hit ^G.
Who needs CHAR-UPCASE? Just put the character into the variable X,
and then do (SETF (UPPER-CASE-P X) T). Presto change-o!
What some implementations call KWOTE [ (DEFUN KWOTE (X) (LIST 'QUOTE X)) ]
can be done as (SETF (EVAL X) Y) <=> (SETQ X (KWOTE Y)).
Finally, who needs PARSE-INTEGER??? If X is a string, and you want to
know what it means as an octal integer, just say
(SETF (FORMAT NIL "~O" VAL) X)