[racket] Advice on a macro for mutating structs

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Jul 28 14:43:50 EDT 2011

7 minutes ago, Matthias Felleisen wrote:
> 
> On Jul 28, 2011, at 2:10 PM, Tom McNulty wrote:
> 
> > I was hoping that I could locate the getter (and setter) with just
> > the field and structure type but that information doesn't seem to
> > be possible.

Ah, you're right.


> I don't understand your request but if you are giving me the
> structure name and the structure field, you can write a
> context-sensitive macro:

That's how Tom started, and I didn't follow the intention of using the
field name and suggested using the struct info.

But the real thing that you (Tom) are fighting with is trying to use
field names, where the struct info is disregarding that and keeps
around just the getter and setter names.  Looks to me like a better
approach would be to use the getter names instead -- possibly with a
macro that makes more convenient getters?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.