[racket-dev] Optional equality predicate for assoc and member

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Fri Apr 22 18:34:57 EDT 2011

Eli Barzilay wrote at 04/22/2011 05:09 PM:
> One way to make it fast is to have it bound to a macro so (member f l eq?) expands to a `memq', and when used as a function have it dispatch to `memq' if given `eq?'.

If someone really wanted to do that optimization in a macro (at first 
glance, seems a little unSchemely to me, and I think a compiler or JIT 
should be able do that optimization, anyway), I'd hope they'd pick a new 
name for the macro.  "member", "assoc", and friends of course have been 
procedures forever.


Posted on the dev mailing list.