[Cs254f11] Wow. Basic question

Lee Spector lspector at hampshire.edu
Wed Oct 26 06:25:26 EDT 2011


(def a '(1 2 3 4 5))

(def b '(i j l k m))

(map vector a b)

; ([1 i] [2 j] [3 l] [4 k] [5 m])

That what you wanted?

 -Lee


On Oct 25, 2011, at 11:00 PM, Wm. Josiah Erikson wrote:

> I must be up too late.
> 
> I have a list, a, and another list, b.
> 
> I want to make a new list of two-item vectors that is both lists put together, so that it will look like ([(nth a 1)(nth b 1)][(nth a 2)(nth b 2)][(nth a 3)(nth b 3)])
> 
> ...and so on. interleave doesn't quite do what I want. Maybe in the morning it will occur to me how to do this without a loop. If it's obvious to somebody else, will you help me out?
> 
> Thanks in advance,
> 
> -- 
> -----
> Wm. Josiah Erikson
> Network Engineer
> Hampshire College
> Amherst, MA 01002
> 
> _______________________________________________
> Cs254f11 mailing list
> Cs254f11 at lists.hampshire.edu
> https://lists.hampshire.edu/mailman/listinfo/cs254f11

--
Lee Spector, Professor of Computer Science
Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspector at hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438



More information about the Cs254f11 mailing list