From: SourceForge.net <no...@so...> - 2011-12-05 11:40:20
|
Bugs item #3451264, was opened at 2011-12-05 03:40 Message generated for change (Tracker Item Submitted) made by litwr You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3451264&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: clisp Group: lisp error Status: Open Resolution: None Priority: 5 Private: No Submitted By: Vladimir Lidovski (litwr) Assigned to: Bruno Haible (haible) Summary: odd error with sort Initial Comment: It is about GNU CLISP strange behaviours. The version 2.33/2.48/2.49 were tested. Can anybody explain this oddness? (defun xsort (l) (sort l #'<)) ;XSORT (setq l '(3 1 2)) ;(3 1 2) (xsort l) ;(1 2 3) l ; surprize! (1 2 3) The ordinal lisp function XSORT takes its argument by value but the presence of SORT-function in its body converts argument to passed by reference! Are there any reasonable explanation? BTW the POP-function doesn't make surprize: (defun xpop (l) (pop l)) ;XPOP (setq l '(3 1 2)) ;(3 1 2) (xpop l) ;3 l ;(3 2 1) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3451264&group_id=1355 |