Search
22:13:24
jmercouris
is there a way to do (loop for item in list collect ...) and have the index of "item"?
22:14:29
phoe
jmercouris: (loop for i from 0 for item in list ...)
22:16:02
jmercouris
I was thinking about having multiple "do" clauses to increment some integer
22:16:08
jmercouris
seems I was on the completely wrong track of thinking
22:16:40
phoe
jmercouris: you don't want an index of "item"
22:16:51
phoe
you want a number that is initially 0 and then increases by 1 on each iteration
22:17:02
jmercouris
I realize that's what your soultion is doing yes
22:17:04
phoe
that also happens to be the index of "item"
22:17:32
jmercouris
I visualized (loop for item in list do .... do incf i)
22:18:07
jmercouris
I still barely understand the loop macro
22:21:32
comborico1611
Where has stacksmith gone?
22:28:28
pjb
phoe: no, that's the point, there is no "the" index of item! There are several indices of item!
22:28:57
pjb
(loop with list = '(1 2 1 2 3 4 1 2 3 4) for item in list collect (positions item list)) #| --> ((0 2 6) (1 3 7) (0 2 6) (1 3 7) (4 8) (5 9) (0 2 6) (1 3 7) (4 8) (5 9)) |#
22:30:13
pjb
jmercouris: you can do (loop with i = -1 for item in list do (incf i) do …)
22:30:22
pjb
but this is exactly what for i from 0 does.
22:30:42
jmercouris
pjb: yeah, that's what I had in mind, it just didn't seem that smart
22:30:49
jmercouris
I figured there must be a better way
22:31:06
pjb
the most probable, is that it wouldn't make any difference in the generated code.
22:31:17
jmercouris
yeah, but it would look dumb
22:31:23
jmercouris
and that's enough for me :d
22:31:35
jmercouris
s/:d/:D - sorry sticky shift key
1:45:31
johnvonneumann
** NICK Guest1113
2:34:20
vtomole
stylewarning: Hey, you online?
2:42:33
stylewarning
vtomole: a bit!
2:42:42
stylewarning
Finishing a nice Italian meal
2:44:57
vtomole
Good :). I really enjoyed the paper, will have to study the code a bit longer though specifically %apply-nQ-gate
2:45:17
stylewarning
That’s the hardest part.
2:46:19
vtomole
From the paper "Since qubits live in a two-dimensional space " should it be "Since a qubit lives in a two-dimensional space"?
2:47:03
vtomole
Actually, that sentence is fine. It says the same thing i think..
2:52:14
vtomole
What is the performance comparison of implementing linear alg operations instead of handing them over to BLAS?
2:57:28
defunkydrummer
stylewarning: bon appètit
2:59:37
stylewarning
vtomole: it depends on a lot of factors
3:02:04
vtomole
BLAS is generally preferred in production. Right?
3:47:03
vtomole
stylewarning: Looking for feedback on the new pull request: https://github.com/tarballs-are-good/quantum-interpreter/pull/1/commits
5:20:48
beach
Good morning everyone!
5:59:09
samebchase1
** NICK samebchase
7:31:58
ebzzry
What is a good MP library?