Hullo all,

I'm messing around with syntax properties to try to get a feel for them, but in 
one of my tests they aren't behaving the way I would expect them to.

In my example the output is #f 1 #f, when I would have thought it would be #f 1 
2. Why is the third result #f and not 2?


#lang racket

(define-syntax (annotate stx)
  (syntax-case stx ()
    [(_ val) ; read
     (or (syntax-property #'val 'annotation) #'#f)]
    [(_ val ann) ; write
     (syntax-property #'val 'annotation #'ann #t)]))

(annotate 4) ; -> #f

(annotate 1 6) ; -> 1

(annotate (annotate 4 2)) ; -> 2

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to