[racket] idiomatic and fast

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Sat Apr 28 17:11:03 EDT 2012

My opinion is to start by *not* using "for"-something forms.  I'd 
suggest starting with named-"let" or recursive named procedures, and 
going from there.  I think you'll find yourself wanting "set!" less once 
you kick "for"-something to the curb.

I think that "for"-something forms are for people who already know how 
to do it backwards and forwards (that's a significant pun) without the 
"for"-something forms, and know when using "for"-something is OK (i.e., 
when "for"-something" is making something more readable without 
preventing you from seeing a better solution),

(Some student should try making a video-game-like leveling and unlocking 
system for DrRacket.  This would be for people who are learning Racket 
without working through HtDP: they have a big language and don't know 
which features are best to learn first, nor when they've learned them 
well.  So, with the unlocking system, they'd have to slay a lot of 
little orc problems with named-"let" before they get to wield 
"for/list", and they unlock "set!" only after defeating a big boss of a 
problem pure-functionally.  I am half-joking, but it could be a fun, 
semi-viable project.)

Neil V.

-- 
http://www.neilvandyke.org/


Posted on the users mailing list.