I thought it was possible to destructure a list in for, but I've been 
searching/experimenting for a while without success. I noticed this example 
in the docs:

(for ([(i j) #hash(("a" . 1) ("b" . 20))])
    (display (list i j)))

So, I assumed I could do this:

(for ([(i j) '(("a" 1) ("b" 20))])
    (display (list i j)))

But that doesn't work. I'm trying to avoid something as verbose as:

(for ([(pair) '(("a" 1) ("b" 20))])
     (match-let ([(list i j) pair])
       (display (list i j))))

Why do elements of a Hash provide 2 values to for, where a 2-tuple list 
does not? Is there a more direct way to destructure a list in for?


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 racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to