From: SourceForge.net <no...@so...> - 2006-03-29 15:03:59
|
Bugs item #1460701, was opened at 2006-03-29 09:30 Message generated for change (Comment added) made by sds You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1460701&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: doc Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Ronald BG. (ronald_bg) >Assigned to: Sam Steingold (sds) Summary: Mistake in LISP tutorial Initial Comment: I think I have found a mistake in the LISP tutorial included with GNU CLISP distributions: Excerpt from line 711-722 of the tutorial: ------------------------------------------------------------------------------- > (setf a (make-array 1)) ;setf on a variable is equivalent to setq #(NIL) > (push 5 (aref a 1)) ;push can act like setf ;??? (5) > (pop (aref a 1)) ;so can pop 5 > (setf (aref a 1) 5) 5 > (incf (aref a 1)) ;incf reads from a place, increments, 6 ;and writes back > (aref a 1) 6 ------------------------------------------------------------------------------- I think all the "(aref a 1)" forms above are wrong: Because we created array with one element, the only valid array index is zero; accessing index 1 (with the form "(aref a 1)") will result in an error. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2006-03-29 10:03 Message: Logged In: YES user_id=5735 thank you for your bug report. the bug has been fixed in the CVS tree. you can either wait for the next release (recommended) or check out the current CVS tree (see http://clisp.cons.org) and build CLISP from the sources (be advised that between releases the CVS tree is very unstable and may not even build on your platform). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1460701&group_id=1355 |