[racket] Structs and syntax-local-value ... how is the struct name overloaded?

From: Greg Hendershott (greghendershott at gmail.com)
Date: Mon Jan 20 16:40:56 EST 2014

>> and prop:procedure is how you make a procedure that can also be something
>> else.

One thing to keep in mind is that there is _some_ overhead. In my
recent experience, applying via prop:procedure took roughly 1.6X the
time as applying a plain procedure. (This with the variant of
prop:procedure where its value is an index to the field in the struct
holding the procedure.)

I don't know how much of the extra time is due to memory reference,
missing the optimizer, and/or other?

For many applications that doesn't matter, and it's worth it to have
`thing` self-evaluate to the info.

If/when it does matter, instead you could use a hashtable on the side,
mapping from the procedure to the info. Of course that way, you need
to use `(lookup thing)` to get the info.

Posted on the users mailing list.