[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
DELETE, SORT, ADJUST-ARRAY considered harmful
- To: email@example.com
- Subject: DELETE, SORT, ADJUST-ARRAY considered harmful
- From: Guy Steele <firstname.lastname@example.org>
- Date: Sat, 25 Apr 87 02:25:34 EST
Here is an idea that is only two-thirds whimsical: since 90% of all
people who use DELETE, SORT, etc. lose because they fail to put a setq
around it (as in (SETQ X (DELETE ITEM X)), etc.), why not make it
impossible for them to lose? Remove these primitives from the language,
and introduce their inverses as SETF places. For example, instead of
writing (SORT BREAKFAST) or (SETF X (SORT BREAKFAST)), write
(SETF (SCRAMBLE X) BREAKFAST)
; that is, the variable X is changed so as to make the value of
BREAKFAST a scrambled version of it. SCRAMBLE would not be a function
itself; you could use it only within a SETF, thereby guaranteeing you
don't lose. Similarly (SETF (UNDELETE ITEM Z) Z),
(SETF (UNADJUST-ARRAY Z) Z), and so on.
Well, maybe the proposed syntax stinks, but perhaps some way of
idiot-proofing destructive operations should nevertheless be found.
--Yours for a safer language,
P.S. I thought you'd never ask: haven't you ever had
scrambled X for breakfast?