Only use one variable to store the unification environment in MATCHING
authorpix@kepibu.org
local dateFri, 15 Jan 2010 08:49:26
dateFri, 15 Jan 2010 08:49:26
hash20100115084926-50f04-4940a9b3ec9eb3c41e38bd59c7922f6cff8e8380.gz
Only use one variable to store the unification environment in MATCHING

Because of the way MATCHING expands, and what UNIFY* returns, each
(setf #:env (unify* ...))
call will do one of two things: it will set #:env to NIL or it will set #:env to
an ENVIRONMENT structure.

If #:env is set to NIL--the same value it entered the (setf) with!--the COND
will continue on to the next clause.

If #:env is set to an ENVIRONMENT structure, none of the remaining (setf)
clauses will be evaluated.

Thus, because the variable will only ever be set to a non-nil value once, this
should be perfectly safe.
1 file(s) changed:
match-block.lisp +6 -11