In common-lisp, I want to implement a reference system like this:
Suppose I have:
(defclass reference () ((host) (port) (file)))
as well as me:
(defun fetch-remote-value (reference) ...)which retrieves and deserializes the lisp object.
How can I intervene in the evaluation process, since whenever a reference object is evaluated, the remote value is received and re-evaluated to obtain the final result?
EDIT:
A more detailed description of what I want to accomplish:
Using cl-store, I serialize lisp objects and send them to a remote file (or db or something else) to save. After successful storage, I save the host, port and file in the reference object. I would like, whenever eval is called in a reference object, it first extracts the object, and then calls eval on the received value. Since the link can also be serial numbers in other (parent) objects or aggregate types, I can get free recursive remote link resolution on the modifying Eval, so I donβt have to go through and solve the loaded child of the link itself.
EDIT: Since objects always evaluate themselves, my question is a bit erroneously posed. Essentially, I would like to do the following:
, , REFERENCE, , , (---)?