[plt-scheme] Structure constructor

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Jul 17 14:25:03 EDT 2006

On Mon, 2006-07-17 at 20:03 +0200, Jens Axel Søgaard wrote:

>>Hi all,
>>
>>What is the simplest way to go from a structure to its constructor?
>>The following seems to work, but I have a hunch there is a simpler
>>solution.
>>
>
>I think you want `struct-type-make-constructor'.  Then your function can
>be defined as:
>
>(define (struct-constructor s)
>  (define-values (sty _) (struct-info s))
>  (struct-type-make-constructor sty))
>
Thanks. I missed it because I were using v300 on my laptop. It seems 
struct-type-make-constructor were added after the v300 release.

-- 
Jens Axel Søgaard




Posted on the users mailing list.