[plt-scheme] Test a numbers representation to see if it's complex?

From: Ryan Newton (newton at mit.edu)
Date: Mon Jun 4 17:14:37 EDT 2007

Yes, this is not normally a nice thing to do.  But I have a need to
distinguish 3.0 and 3.0+0.0i.  As far as I can tell, while PLT *could*
turn 3.0+0.0i into 3.0, but for whatever reason the complex
representation seems closed under PLT's arithmetic, which makes what I
want to do somewhat sane.

(For reference, I'm embedding a statically typed language in Scheme,
and I would like to sanity check the object representations
periodically.)

-Ryan


Posted on the users mailing list.