Browse Source

fix Fig. 6.22, replace undefined n with (vector-length A)

Jeremy G. Siek 1 year ago
parent
commit
b3ba32920f
1 changed files with 1 additions and 2 deletions
  1. 1 2
      book.tex

+ 1 - 2
book.tex

@@ -14280,14 +14280,13 @@ inner product of two arrays (figure~\ref{fig:inner_product}).
 \begin{figure}[tp]
 \begin{tcolorbox}[colback=white]  
 {\if\edition\racketEd
-% TODO: remove the function from the following example, like the python version -Jeremy    
 \begin{lstlisting}
 (let ([A (make-vector 2 2)])
 (let ([B (make-vector 2 3)])
 (let ([i 0])
 (let ([prod 0])
 (begin
-  (while (< i n)
+  (while (< i (vector-length A))
     (begin
       (set! prod (+ prod (* (vector-ref A i)
                             (vector-ref B i))))