[plt-scheme] random walk

Stephen Bloch sbloch at adelphi.edu
Fri May 29 12:27:58 EDT 2009


On May 29, 2009, at 11:08 AM, Marijn Schouten (hkBst) wrote:

> I'm trying to write a macro that writes a function that sums the L2- 
> lengths of
> all (random) walks of depth d on a square grid of dimension DIM.

I just wrote a FUNCTION to do this, with no macros involved, in  
Intermediate+Lambda language, and (not counting test cases) it came  
to about twenty lines shorter than the attempt at a macro.  It's  
probably less run-time-efficient, but this problem is inherently  
exponential in the depth anyway, so I'm not convinced that moving  
part of it to compile-time will have much effect on the run time.

Oh, and my "function" is actually five functions, each short enough  
to comprehend and test.

Stephen Bloch
sbloch at adelphi.edu



More information about the plt-scheme mailing list