[racket-dev] strange top-level binding for module-defined identifiers

From: Sam Tobin-Hochstadt (samth at cs.indiana.edu)
Date: Thu Jul 24 16:08:59 EDT 2014

If you take this program (which is a lot like the implementation of
`racket/fixnum`):

#lang racket/base

(require '#%flfxnum
         racket/private/vector-wraps
         racket/unsafe/ops
         (for-syntax racket/base))

(define-vector-wraps "fxvector"
  "fixnum?" fixnum?
  fxvector? fxvector-length fxvector-ref fxvector-set! make-fxvector
  unsafe-fxvector-ref unsafe-fxvector-set! unsafe-fxvector-length
  in-fxvector*
  in-fxvector
  for/fxvector
  for*/fxvector
  fxvector-copy
  0)

And run it in the macro stepper with macro hiding off, at the end you
get a fully-expanded module where the first definition is
`:fXvector-gen`. However, if you click on this identifier, either in
the definition or in a subsequent use, it says "Apparent identifier
binding: none" (which means that `identifier-binding` returns #f,
which can be confirmed on the expanded syntax).

How can this happen? Is it a bug in something, or a special case that
I didn't expect?

Sam

Posted on the dev mailing list.