[plt-scheme] Null syntax / Conditional definition

From: Chihiro Kuraya (rxqvw at yahoo.co.jp)
Date: Sat Jun 18 08:39:23 EDT 2005


I have two questions about MzScheme syntax.

(1) Is it possible to define syntax or syntax-id
which disappears when expanded ?

[Example 1]
The expression
(string-append "pqr" ABC "xyz")
expands to
(string-append "pqr" "xyz")  

[Example 2]
The expression
(string-append "pqr" (ABC "xyz"))
expands to
(string-append "pqr")  

(2) Is it possible to switch syntax definition (or normal definition)
depending on some flags?

(if-defined WIN32
  (define ABC 123)
  (define-syntax XYZ ...))

(if-defined MACOSX
  (define ABC 567)
  (define-syntax XYZ ...))

Chihiro Kuraya
Save the earth

Posted on the users mailing list.