[plt-dev] `unsafe-fl' and unboxing

From: Doug Williams (m.douglas.williams at gmail.com)
Date: Sun Oct 4 18:53:59 EDT 2009

> No! 'identifier?' does not check whether a syntax object represents a
> variable reference, given 1) identifier macros and 2) #%top transformers for
> unbound variables. If you really, really want to check if something is a
> variable reference, 'local-expand' it and look at the result.

Will I not always get an "unbound identifier in module" (or something
similar) with the offending variable explicitly in the message? That's as
good to me as any message I make up. If not, it would be worth the effort.

> But even if it is a variable reference, there's no guarantee that there
> isn't another thread holding a reference to it, waiting to change it from a
> real to, say a complex number right after the 'real?' check is done.

I'm sure one can always come up with pathological things that can be done.
Even if I do something to ensure that the test and binding are atomic, I not
sure it doesn't defeat the purpose of the macro - to protect unsafe code. I
would say don't use unsafe code on variables that are shared among

But thanks for the comments.

> Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20091004/2a08bb85/attachment.html>

Posted on the dev mailing list.