IRC channel logs

2025-08-07.log

back to list of logs

<lechner>old / dsmith / thanks!
<hadderly>Is the following line of code in the reference manual an error? (let ((frame (take (array-dimensions (car x)) frank))) This is part of the explanation for procedure array-slice-for-each. To my understanding, car cannot access arrays, and array-dimensions only accepts arrays, not lists, so substituting one for the other doesn't work. I've tried plugging in values to test it but get the corresponding wrong type error message.
<hadderly>Documentation at bottom: https://www.gnu.org/software/guile//manual/html_node/Arrays-as-arrays-of-arrays.html
<lechner>hadderly / i rarely use arrays but isn't the 'x' in that example a list given to apply? (apply array-slice-for-each frame-rank op x)
<lechner>there are a lot of x's in that section
<hadderly>lechner gave me the idea to try a list of an array for the argument using (list x), which worked. I was not aware the list procedure had this distinction. I receive other errors now though in the example code, but that's ok since I'm still trying to make sense of it.
<hadderly>,(c)
<hadderly>oops ignore my most recent post
<lloda>hadderly: i don't understand 'the list procedure had this distinction'. What distinction?
<lloda>array-slice-for-each takes any number of arrays. Like (array-slice-for-each frame-rank op a b c ...), then a b c ... are all arrays. Therefore in (apply array-slice-for-each frame-rank op x), x is a list of arrays. Therefore (car x) is an array
<hadderly>lloda: I meant that the list procedure will return a list of evaluated arguments, whereas a quoted list will just return the plain symbols. I was plugging in either a quoted list, or an array for (array-dimensions (car x)), so naturally it didn't work. The list procedure worked though because it returned a list containing an array that car could access.
<lloda>i c
<dthompson>goblins 0.16.0 is out! https://spritely.institute/news/spritely-goblins-v0-16-0-released.html
<sneek>wb dsmith
<dsmith>sneek, botsnack
<sneek>:)