<div class="gmail_quote">Hi Joe,<br><br>On Mon, Mar 26, 2012 at 21:22, Joe Gilray <span dir="ltr">&lt;<a href="mailto:jgilray@gmail.com">jgilray@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Pierpaolo,<div><br></div><div>Yes, I could read the data into a list and then create an array from it:</div><div><br></div><div><div>(array-ref (apply array (shape 0 3 0 3) &#39;(1 2 3 4 5 6 7 8 9)) 2 2)</div><div>9</div>


<div><br></div><div>But, I don&#39;t seem to be able to do the same from a vector:</div><div><br></div><div><div>(array-ref (apply array (shape 0 3 0 3) #(1 2 3 4 5 6 7 8 9)) 2 1)</div><div>apply: expects type &lt;proper list&gt; as 3rd argument, given: &#39;#<a href="tel:%281%202%203%204%205%206%207%208%209" value="+48123456789" target="_blank">(1 2 3 4 5 6 7 8 9</a>); other arguments were: #&lt;procedure:array&gt; #&lt;array:srfi-9-record-type-descriptor&gt;</div>

<span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888"><div><br><br></div></font></span></div></blockquote><div><br><br>It&#39;s late night here and I didn&#39;t look at the docs, but from the error message it seems that you cannot pass a vector to the array constructor.<br>

With a vector at hand, we can use vector-&gt;list to do the appropriate conversion:<br><br>(array-ref (apply array (shape 0 3 0 3) (vector-&gt;list #(1 2 3 4 5 6 7 8 9))) 2 1)<br><br><br>On racket.exe:<br><br>Welcome to Racket v5.2.1.<br>

&gt; (require srfi/25)<br>&gt; (array-ref (apply array (shape 0 3 0 3) (vector-&gt;list #(1 2 3 4 5 6 7 8 9))) 2 1)<br>8<br><br><br><br></div></div>[]&#39;s<br><br>Rodolfo<br>