[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Questions about specification and possible implementations



It is certainly alright to optimize BUILT-IN keyword functions, since "it is an
error" to redefine them; it is alright to "open code" CAR for the same reason.
If I were to put in code that tried to optimize ALL keyword functions, I would
transform your call

	(foo :bogus-key 1)

into something like

	(if (eq #'foo-intern-form '#<Function FOO-INTERNAL-FORM {75234}>)
	    (foo-internal-form 1)
	    (foo :bogus-key 1)),

where that quoted unreadable thing is what the caller thought FOO's
non-keywordized form was at the time of compilation.  This is a correct
transformation even in the case that you're worried about, and can be done
efficiently on all machines I can think of.  Those machines with hairy linkage
mechanisms could perhaps do it a wee bit more efficiently.

--Skef