<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Is there a functional "array-set" for math/array?<div><br></div><div>And if there isn’t, then would this be a good definition for it?:</div><div><div><font face="Courier New">(: array-set : (All (a) [(Array a) In-Indexes a -> (Array a)]))</font></div><div><font face="Courier New">(define (array-set arr update-pos val)</font></div><div><font face="Courier New"> ((inst build-array a)</font></div><div><font face="Courier New"> (array-shape arr)</font></div><div><font face="Courier New"> (lambda ([pos : Indexes])</font></div><div><font face="Courier New"> (cond [(equal? pos update-pos) val]</font></div><div><font face="Courier New"> [else (array-ref arr pos)]))))</font></div></div><div><br></div><div><br></div></body></html>