[racket] Pattern patching and structures

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Wed Nov 16 01:14:17 EST 2011

On 2011-11-16 13:56:31 +0800, José Lopes wrote:
> However, what I really wanted was to preserve the name of the local
> variable (e.g., brick) and find some other way to refer to the
> structure (e.g., struct:brick).

Sorry for misunderstanding your original e-mail. Since struct
communicates with match using a transformer binding (different from the
struct type), you can make your own syntax binding for it like so:

  (define-syntax brick-info (syntax-local-value #'brick))

and use "brick-info" (which is now bound to the struct-info for brick).


Posted on the users mailing list.