[racket] Can impersonator be a cache?

From: Roman Klochkov (kalimehtar at mail.ru)
Date: Fri Aug 15 06:42:09 EDT 2014

 I have
(struct object (a b c))
(struct reference (id data))

Let `ref' -- an instance of `reference'.

I want, that (object-a ref) call my own (ref-get object-a ref)

(define (ref-get accessor ref)
  (unless (weak-box-value (ref-data ref))
     (set-ref-data! ref (make-weak-box (load-data (ref-id ref)))))
  (accessor (weak-box-value (ref-data ref))))

Is it possible? 
I found `impersonate-struct', but it is not struct itself (no `id' field). 
I can add `prop:impersonator-of',. but how to redirect accessors?

-- 
Roman Klochkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140815/0fed8fb1/attachment-0001.html>

Posted on the users mailing list.