Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!lll-lcc!well!jjacobs From: jjacobs@well.UUCP Newsgroups: comp.lang.lisp Subject: Against the TIde of Common LISP Message-ID: <2626@well.UUCP> Date: Sat, 21-Feb-87 22:14:49 EST Article-I.D.: well.2626 Posted: Sat Feb 21 22:14:49 1987 Date-Received: Sun, 22-Feb-87 10:43:52 EST References: <2624@well.UUCP> Reply-To: jjacobs@well.UUCP (Jeffrey Jacobs) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 34 In <6950002@hpfclp.HP.COM>, Chan Benson writes: >>B.S! All the compiled code for SET need do is check that the first argument >>be lexically equivalent to a lexically apparent variable and change >>the appropriate cell, stack location, or whatever. Easy for a compiler >>to do! >I don't see how it's possible to do this (excuse my potential ignorance). Let's take a simple example: (DEFUN FOO (X Y Z) (SET X (CONS Y Z))) The compiler would have to generate code that would effectively be equal to (COND ((EQ X 'X) (SETQ X (CONS Y Z))) ((EQ X 'Y) (SETQ Y (CONS Y Z))) ((EQ X 'Z) (SETQ Z (CONS Y Z))) (T (SET-SYMBOL-VALUE X (CONS Y Z))))) i.e. a hidden 'macro-expansion' at compile time. This should put to rest assertions that it "can't be done"; it's actually trivial. (Whether it's desireable or not is another discussion). Jeffrey M. Jacobs CONSART Systems Inc. Technical and Managerial Consultants P.O. Box 3016, Manhattan Beach, CA 90266 (213)376-3802 CIS:75076,2603 BIX:jeffjacobs USENET: jjacobs@well.UUCP