<div dir="ltr"><div>> (define x (build-vector 4 (const (vector 1))))<br><br>> (vector-set! (vector-ref x 2) 0 5)<br><br></div><div>> x<br>'#(#(5) #(5) #(5) #(5))<br><br></div><div>-------- vs. --------------<br>
<br>> (define x (build-vector 4 (ë (x) (vector 1))))<br><br>> (vector-set! (vector-ref x 2) 0 5)<br><br>> x<br>'#(#(1) #(1) #(5) #(1))<br><br>---------------------------------------------------------------<br>
<br></div><div>Maybe I'm misunderstanding const, but to me it means "ignore arguments" as opposed to signifying shared-structure / immutability (like a "constant"). That's what #(1) is for. The top version should I believe constantly return a fresh (different) vector regardless of its arguments.<br>
<br></div><div>I'm on 5.3.4 due to Ubuntu, in case this was already found.<br></div></div>