-1

i need to take in an infinite list then when i do take 40 counter list will return a list of q1,q2,q3,q4 values in bracket or any form.

example of my code is

counter clock =
    let (q1,q2,w1,q3,w2,q4) = (flip clock clock, flip q1 q1, and_gate q1 q2, flip w1 w1, and_gate w1 q3, flip w2 w2) in (**q1,q2,q3,q4 - no sure about this part**)

how can i achieve this? Thanks

4

1 回答 1

1

我想你正在寻找zip4

counter clock =
    let q1 = flip clock clock
        q2 = flip q1 q1
        w1 = and_gate q1 q2
        q3 = flip w1 w1
        w2 = and_gate w1 q3
        q4 = flip w2 w2
    in zip4 q1 q2 q3 q4
于 2012-10-28T18:36:30.367 回答