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

From: sam th (samth at ccs.neu.edu)
Date: Tue Feb 14 23:57:14 EST 2006

On Tue, Feb 14, 2006 at 05:33:24PM -0600, Robby Findler wrote:
> At Tue, 14 Feb 2006 18:17:23 -0500, Sam Tobin-Hochstadt wrote:
> > On Tue, 2006-02-14 at 17:02 -0600, Jacob Matthews wrote:
> > > Sam Tobin-Hochstadt wrote:
> > > 
> > > >I would like to perform functional update on arbitrary structures
> > > >(modulo inspectors) and thus I'd like to be able to construct instances
> > > >of a structure given the structure-type.
> > > >
> > > You know about copy-struct from (lib "struct.ss"), right?
> > 
> > Sadly, this requires static knowledge of what structure is being
> > updated, whereas I want to operate on arbitrary structures (that I have
> > no knowledge of statically).
> 
> If you can arrange to get control of the structure-type, why not also
> arrange to get hold of the maker?

You can get the structure-type for an arbitrary (struct) value with 
struct-info.  What I'm looking for is a similar way to get the maker, but 
I've been unable to find one.

sam th


Posted on the users mailing list.