[racket] syntax-parameter-value and splicing-syntax-paramterize

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sun Jan 13 16:26:25 EST 2013

Hi All,

The program below gives this error:
 .... collects/racket/stxparam-exptime.rkt:11:4:
syntax-parameter-value: contract violation
  expected: syntax-parameter?
  given: #f

Why?

/Jens Axel


#lang racket
(require racket/stxparam
         racket/splicing)

(define-syntax-parameter *types* 'foo)

(define-syntax (display-types stx)
  (displayln (syntax-parameter-value #'*types))
  #'(void))

(splicing-syntax-parameterize
 ([*types* 'baz])
 (let ()
   (display-types)
   (splicing-syntax-parameterize
    ([*types* 'bar])
    (display-types))
   (display-types)))

Posted on the users mailing list.