[plt-scheme] struct-type-info at expansion time

From: Bruce Hauman (bhauman at cs.wcu.edu)
Date: Thu Apr 24 13:51:06 EDT 2003

On Thu, 24 Apr 2003, Matthew Flatt wrote:

> At Thu, 24 Apr 2003 12:16:11 -0400 (EDT), Bruce Hauman wrote:
> > I am trying to access the super-type of a structure at
> > expansion time and drscheme is reporting that the struct-type-info
> > procedure is not bound in the module transformer environment.
> >
> > How can I get this information?
>
> Can you supply a small example?
>
> The following example compiles for me, illusrating that
> `struct-type-info' is in this particular module's transformer
> environment:
>
>  (module m mzscheme
>    (define-syntax x struct-type-info))
>
>
> Matthew
>
>
>

Sorry, I was mistaken.  It is bound.


  I am wondering how I can use the first
value in the list that I get when I syntax-local-value to the name of a
struct along with struct-type-info in order to get the struct-type
of a super-type:

(let-values (((n x y z q l super-type d)
              (struct-type-info (syntax-object->datum
                                 (list-ref
                                  (syntax-local-value
                                   struct-name
                                   failure-thunk) 0)))))
  super-type)

This doesn't work but I was hoping that I am missing a tiny piece of
esoteric knowledge that would make it work.

Bruce


Posted on the users mailing list.