Απ: Re: Απ: Re: Customization of evaluation for a specific custom type of object



You are correct that persistence libraries might do what I need in a generic sense. But in order to actually gain something from this attempt of mine I would like to insist:

Why is it conceptually wrong to think of intercepting symbol evaluation and just before returning the resulting value, examine it, and if it is of type REFERENCE, replace the returning value by the result of evaluating (fetch)?

Where is the conceptual mistake?

Also I took a look in the source code of eval in sbcl (src/code/eval.lisp) and basically
it is a big case that essentialy is structured like this:

(typecase exp
(symbol
(ecase (info :variable :kind exp)
((:special :global :constant :unknown)
(symbol-value exp))
(:alien
(%simple-eval original-exp lexenv))))
(list
(... ALOT OF CODE...))
(t
exp))

which means that there is point in trying to go after my second version question. Conceptually isnt it like injecting in the above code a conditional statement on the results of (symbol-value exp) or (%simple-eval original-exp lexenv) that will check for the type and call fetch?

Thanks a lot.
.