It doesn't much matter how you do an alist lookup for most programs. Go ahead and learn and teach whatever makes most sense.

But, for practical application, sometimes you have to implement, say, some large performance-sensitive graph algorithm, where even constant overhead factors can make a big practical difference, and then you're glad you're comfortable old-school pair wrangling. And instruction-shaving in inner loops. Then, you do end up taking advantage of behaviors like `member` returning a tail rather than a strict Boolean value. ("Isn't this a set membership predicate? What a strange historical artifact.")

Another useful reason `assoc` returned the list is not as useful now that Racket pairs are immutable, but before then, one very simple `set-cdr!` backpatch could save tons of expensive and complicated copying/transformation. (I do prefer the immutable pairs for most purposes, though; I'm not complaining,)

Neil V.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to