Hello,

I am trying to use a struct that is both mutable, and has
prop:rename-transformer, to create a mutable rename transformer. I am
able to update the value in the struct, and that update gets reflected
properly when I do `syntax-local-value/immediate`, but
`syntax-local-value` seems to keep around the previous definition.

Is prop:rename-transformer or syntax-local-value supposed to cache its
result, or would this be a bug?

My code so far is here: http://pasterack.org/pastes/41342

```
#lang racket

(define-syntax string1 "hello")
(define-syntax string2 "world")

(begin-for-syntax
  (struct string-box (str)
    #:mutable
    #:property prop:rename-transformer
    (lambda (inst)
      (if (string-box-str inst)
          #'string1
          #'string2))))
(define-syntax (string-lookup stx)
  (syntax-case stx ()
    [(_ id)
     #`'#,(syntax-local-value #'id)]))
(define-syntax (string-set! stx)
  (syntax-case stx ()
    [(_ box value)
     (begin
       (define-values (x y) (syntax-local-value/immediate #'box))
       (set-string-box-str! x #'value)
       #'(void))]))

(define-syntax current-str (string-box #t))
(string-lookup current-str)
(string-set! current-str #f)
(string-lookup current-str)
```

Thank you for your help.

~Leif Andersen

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/CAAVaeEBxrRT1soNDP5xmrJnaYwfc49qUAN9P44qEqudggjUmgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to