[plt-scheme] (typeof obj)

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Mon Jun 11 11:13:16 EDT 2007

On 6/11/07, Robert Nikander <nikander at nc.rr.com> wrote:
>
> On Jun 11, 2007, at 10:13 AM, Robby Findler wrote:
> >
> > Structs are the way to add new types to mzscheme :)
>
> Ah, I get it...  I was assuming that C-level extensions could define
> new "primitive" non-struct types.  So if there is a small list of
> type predicates that covers all possible values, I guess `run-time-
> type' is not necessary like in some other languages.
>
> But I then have the same question about structs -- how do I get the
> struct type info from a struct value.  But for that, I have yet to
> consult the help desk...

Some combination of the information provided by struct-info and
struct-type-info is probably what you are looking for.  For an example
of how to use them, you could look at the "equiv.plt" package in
PLaneT, which I wrote to perform automatic structural comparison of
structs.

-- 
Carl Eastlund


Posted on the users mailing list.