Skip to content

Commit

Permalink
fix Fig. 6.22, replace undefined n with (vector-length A)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiek committed Oct 31, 2023
1 parent 32e7e8a commit b3ba329
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions book.tex
Original file line number Diff line number Diff line change
Expand Up @@ -14280,14 +14280,13 @@ \section{Challenge: Arrays}
\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))))
Expand Down

0 comments on commit b3ba329

Please sign in to comment.