[plt-scheme] getting the constructor from a struct-type

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Feb 16 22:48:43 EST 2006

At Thu, 16 Feb 2006 22:41:27 -0500, Sam Tobin-Hochstadt wrote:
> I'm curious about two things:  first, might it be reasonable to extend
> the struct-type to contain the predicate and constructor, as it
> currently does for the accesssor etc? 

Code that already uses `struct-type-info' would break. And that code
(and yours) would break every time we want to add something new. For
that reason, I think it makes more sense to add functions.

> Second, did the code I wrote,
> which calls, either scheme_make_struct_instance or
> scheme_make_struct_values, properly respect inspectors?  Can you get
> around inspectors w/ the ffi?

As far as I can tell, it ignores inspectors.

You can certainly get around inspectors (or any other language-enforced
invariant) with the FFI.

Matthew



Posted on the users mailing list.