From: SourceForge.net <no...@so...> - 2006-07-04 17:02:04
|
Bugs item #705734, was opened at 2003-03-18 10:42 Message generated for change (Comment added) made by robert_dodier You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=705734&group_id=4933 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: Lisp Core Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Stavros Macrakis (macrakis) Assigned to: Nobody/Anonymous (nobody) >Summary: [a,b,c][0] => "[" Initial Comment: [a,b,c][0] => "[" --- should be an error foo:[a,b,c]$ foo[0] => "[" --- same The subscript operator should select the nth element of a list-like object. It should NOT select the nth component of a structure -- that is what part/inpart is for. After all, (a+b)[0] is not "+". Similarly, [a,b][0] should not be "[", but an error. Currently, meval uses inpart for subscripting; this code needs to be corrected. 5.9.0, GCL, Windows ---------------------------------------------------------------------- >Comment By: Robert Dodier (robert_dodier) Date: 2006-07-04 11:02 Message: Logged In: YES user_id=501686 Following patch committed as r1.27 src/mlisp.lisp. This is in MAPPLY1. Now [a,b,c][0] => error message. Closing this report as fixed. diff -u -r1.26 mlisp.lisp --- mlisp.lisp 15 Feb 2006 16:44:29 -0000 1.26 +++ mlisp.lisp 4 Jul 2006 16:56:29 -0000 @@ -155,6 +155,8 @@ (if (not (or (= (length args) 1) (and (eq (caar fn) '$matrix) (= (length args) 2)))) (merror "Wrong number of indices:~%~M" (cons '(mlist) args))) + (if (memq 0 args) + (merror "No such ~M element: ~M~%" (if (eq (caar fn) 'mlist) "list" "matrix") `((mlist) ,@args))) (do ((args1 args (cdr args1))) ((null args1) (let (($piece $piece) ($partswitch 'mapply)) (apply #'$inpart (cons fn args)))) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=705734&group_id=4933 |