question / comments about sublis



On 2/2/09, Barton Willis <willisb at unk.edu> wrote:

> Ignoring the sublis_apply_lambda option, it's possible to rewrite
>  sublis.lisp to call the CL function sublis. It takes about 10 lines of
>  code.

Does the 10 lines include whatever it takes to replicate the features of subst?
If so, I would say go ahead and change it.

>  As for substitution into conditionals, and etc, I think most of the
>  problems are due to the frailties of the conditional.

The branches of a conditional are simplified (but not evaluated)
and errors such as 1/0 and 0^0 are triggered in simplification.
So an error is to be expected from subst(x=0, if x>0 then 1/x else foo).

Maybe instead of substitution what is intended is evaluation in
an environment in which x is bound to 0; i.e.
either block([x : 0], if x > 0 then 1/x else foo)
or ev(if x > 0 then 1/x else foo, x=0).

>  And I think subst is supposed do what it is told:

Agreed.

best

Robert