[racket] Strange difference between (define (for-syntax)) and (define-for-syntax)

From: Dmitry Pavlov (dpavlov at ipa.nw.ru)
Date: Wed Aug 29 04:25:36 EDT 2012


I just came across a strange error:

#lang racket

;(require (for-syntax (only-in ffi/unsafe ctype-sizeof _pointer)))
(require-for-syntax (only-in ffi/unsafe ctype-sizeof _pointer))

(define-for-syntax (os-bitness)
   (let ((ptrsize (ctype-sizeof _pointer)))
     (case ptrsize
       ((4) 32)
       ((8) 64)
       (else (error (format "unexpected pointer size: ~a" ptrsize))))))

_pointer: unbound identifier in module (in phase 1, transformer 
environment) in: _pointer

When I put (require (for-syntax)) instead of (require-for-syntax),
the error is gone. Maybe Racket has a bug here?

I have Racket 5.3 on Debian.

Best regards,


Posted on the users mailing list.