Here's a rookie question that stems from HtDP 29.3.2.

The idea is to test an expression a number of times while timing it and
compare to another version of the same function.  The expression finds a
route in a vector (graph) from node 0 to node 4.  The way I would do this in
C/Python is with a while loop, while the counter is not zero execute the
expression (ignore return value), and wrap it in the timer.  In Racket I
came up with:

(time (for-each
       (lambda (dest) (find-route 0 dest Graph))
       (make-list 1000 4)))

It seems unnecessarily tricky, but I couldn't think of a better way.  Am I
missing a piece?  Does it only seem tricky because Racket is my first
functional language.

aTdHvAaNnKcSe

^ actually unnecessarily tricky

Luke
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to