You can subscribe to this list here.
2002 |
Jan
|
Feb
(6) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: SourceForge.net <no...@so...> - 2008-09-30 07:09:57
|
Bugs item #2137670, was opened at 2008-09-30 09:09 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=2137670&group_id=3235 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: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Michael Weber (wleahcim) Assigned to: Nobody/Anonymous (nobody) Summary: COLLECT-FIRST optimization bug Initial Comment: COLLECT-FIRST sometimes returns the last element: (let ((nums (scan-range :below 4))) (values (collect-first nums) (collect (subseries nums 0)))) => 3, (0 1 2 3) Macroexpanding the form shows that there is a test missing: #:LL-1945 (SETQ NUMS (+ NUMS (SERIES::COERCE-MAYBE-FOLD 1 'NUMBER))) (IF (NOT (< NUMS 4)) (GO SERIES::END)) ;; MISSING: (IF #:TERMINATED-1944 (GO #:CC-1943)) (SETQ #:ITEM-1929 NUMS) #:BB-1942 (SETQ #:TERMINATED-1944 T) #:CC-1943 (INCF #:INDEX-1938) Note that the following versions work: (let ((nums (scan-range :below 4))) (values (collect-first nums) (collect nums))) => 0, (0 1 2 3) (let ((nums (scan-range :below 4))) (values (collect-first nums) (subseries nums 0))) ; return series, i.e., no optimization => 0, #Z(0 1 2 3) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=2137670&group_id=3235 |
From: SourceForge.net <no...@so...> - 2008-09-24 18:07:21
|
Bugs item #2126870, was opened at 2008-09-24 18:07 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=2126870&group_id=3235 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: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Unknown keyword arg :START for SCAN-RANGE Initial Comment: SERIES 2.2.9 in CMUCL 19d. Attempt to use :start with scan-range resulted in the error message ; Error: (during macroexpansion) ; Unknown keyword: :START both when compiling a test program and when loading the program source. Doing (describe 'series:scan-range) printed out SCAN-RANGE is an external symbol in the SERIES package. Function: #<Function SCAN-RANGE {584F4689}> Function arguments: (&key (from 0) (by 1) (upto nil) (below nil) (downto nil) (above nil) (length nil) (type 'number)) Function documentation: (scan-range &key (:start 0) (:by 1) (:type 'number):upto :below :downto :above :length) The "function arguments" listing does not show the :start keyword arg even though the docstring does. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=2126870&group_id=3235 |
From: Raymond T. <to...@rt...> - 2003-09-26 19:21:54
|
>>>>> "David" == David Golden <dav...@oc...> writes: David> Hi, David> The "Download" link on the http://series.sourceforge.net/ front page David> is broken. This is unfortunate, as the series.sourceforge.net front page David> is where a lot of sites pointing to the series package say to go. David> It is currently: David> https://sourceforge.net/project/filelist.php?group_id=3235 David> It should be: David> https://sourceforge.net/project/showfiles.php?group_id=3235 This should be fixed now. Thanks for the report! Ray |
From: David G. <dav...@oc...> - 2003-09-14 10:30:33
|
Hi, The "Download" link on the http://series.sourceforge.net/ front page is broken. This is unfortunate, as the series.sourceforge.net front page is where a lot of sites pointing to the series package say to go. It is currently: https://sourceforge.net/project/filelist.php?group_id=3235 It should be: https://sourceforge.net/project/showfiles.php?group_id=3235 |
From: Raymond T. <to...@rt...> - 2003-05-19 17:38:59
|
>>>>> "Alexey" == Alexey Dejneka <ade...@co...> writes: Alexey> Hello, Alexey> Last week I saw two requests for the topic on #lisp, so: Alexey> The main problem is th absence of COMPILER-LET in SBCL, though it is Alexey> easy to implement: [snip] Will this (compiler-let) become a part of SBCL? Alexey> With the above definition for the C-L and the attached patch for Alexey> SERIES, all 561 tests have been passed. Thanks for the patches. I'll add these to series. Alexey> P.S. Is (SCAN '(QUOTE A)) supposed to cause an error? I don't think so. But it does cause an error for me on cmucl. I think it's the stuff that Ferdinand added so that scan would try to figure out what kind of object was being scanned. (scan 'list '(quote a)) works, which should be a series whose elements are 'quote and 'a. Ray |
From: <no...@so...> - 2002-12-11 04:10:46
|
Bugs item #498418, was opened at 2002-01-01 22:55 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=498418&group_id=3235 Category: None Group: None Status: Closed Resolution: None Priority: 5 Submitted By: Rahul Jain (rjain) Assigned to: Nobody/Anonymous (nobody) Summary: cmucl doesn't like dumping functions Initial Comment: I get the following error: (COLLECT-MAX LENGTH) --> COMMON-LISP:FUNCALL ==> #<Function #:COLLECT-MAX-0 {48223241}> Error: Cannot dump objects of type (FUNCTION (T &OPTIONAL T T) T) into fasl files. using debian unstable's cmucl and series packages. ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2002-12-10 23:03 Message: Logged In: YES user_id=28849 For the record a function like this tickles the bug: (defun try-it (n) (let* ((foo (scan-range :upto n)) (bar (choose foo)) (baz (mapping ((foo foo) (bar bar)) (+ foo bar)))) (collect-max baz))) I think I have this fixed now so that we don't try to dump these functions anymore. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=498418&group_id=3235 |
From: <no...@so...> - 2002-12-11 04:09:33
|
Bugs item #498418, was opened at 2002-01-01 22:55 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=498418&group_id=3235 Category: None Group: None Status: Closed Resolution: None Priority: 5 Submitted By: Rahul Jain (rjain) Assigned to: Nobody/Anonymous (nobody) Summary: cmucl doesn't like dumping functions Initial Comment: I get the following error: (COLLECT-MAX LENGTH) --> COMMON-LISP:FUNCALL ==> #<Function #:COLLECT-MAX-0 {48223241}> Error: Cannot dump objects of type (FUNCTION (T &OPTIONAL T T) T) into fasl files. using debian unstable's cmucl and series packages. ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2002-12-10 23:03 Message: Logged In: YES user_id=28849 For the record a function like this tickles the bug: (defun try-it (n) (let* ((foo (scan-range :upto n)) (bar (choose foo)) (baz (mapping ((foo foo) (bar bar)) (+ foo bar)))) (collect-max baz))) I think I have this fixed now so that we don't try to dump these functions anymore. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=498418&group_id=3235 |
From: <no...@so...> - 2002-12-11 04:03:57
|
Bugs item #498418, was opened at 2002-01-01 22:55 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=498418&group_id=3235 Category: None Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Rahul Jain (rjain) Assigned to: Nobody/Anonymous (nobody) Summary: cmucl doesn't like dumping functions Initial Comment: I get the following error: (COLLECT-MAX LENGTH) --> COMMON-LISP:FUNCALL ==> #<Function #:COLLECT-MAX-0 {48223241}> Error: Cannot dump objects of type (FUNCTION (T &OPTIONAL T T) T) into fasl files. using debian unstable's cmucl and series packages. ---------------------------------------------------------------------- Comment By: Raymond Toy (rtoy) Date: 2002-12-10 23:03 Message: Logged In: YES user_id=28849 For the record a function like this tickles the bug: (defun try-it (n) (let* ((foo (scan-range :upto n)) (bar (choose foo)) (baz (mapping ((foo foo) (bar bar)) (+ foo bar)))) (collect-max baz))) I think I have this fixed now so that we don't try to dump these functions anymore. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=498418&group_id=3235 |
From: <no...@so...> - 2002-12-11 04:03:30
|
Bugs item #498418, was opened at 2002-01-01 22:55 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=498418&group_id=3235 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rahul Jain (rjain) Assigned to: Nobody/Anonymous (nobody) Summary: cmucl doesn't like dumping functions Initial Comment: I get the following error: (COLLECT-MAX LENGTH) --> COMMON-LISP:FUNCALL ==> #<Function #:COLLECT-MAX-0 {48223241}> Error: Cannot dump objects of type (FUNCTION (T &OPTIONAL T T) T) into fasl files. using debian unstable's cmucl and series packages. ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2002-12-10 23:03 Message: Logged In: YES user_id=28849 For the record a function like this tickles the bug: (defun try-it (n) (let* ((foo (scan-range :upto n)) (bar (choose foo)) (baz (mapping ((foo foo) (bar bar)) (+ foo bar)))) (collect-max baz))) I think I have this fixed now so that we don't try to dump these functions anymore. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=498418&group_id=3235 |
From: <no...@so...> - 2002-12-10 18:01:18
|
Bugs item #516952, was opened at 2002-02-13 08:10 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=516952&group_id=3235 Category: None Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Jörg Höhle (hoehle) Assigned to: Nobody/Anonymous (nobody) Summary: only optimized split-if works Initial Comment: a completes series expression is optimized and produces correct output, the intermediates however do not: I expect two series values returned from split-if. [252]> (collect (split-if (scan '(1 2 1 2 3)) (lambda (item) (evenp item)))) (2 2); fine [253]> (split-if (scan '(1 2 1 2 3)) (lambda (item) (print item) (evenp item))) (1 (1 2 1 2 3) NIL -1 T) *** - argument to EVENP should be an integer: (1 (1 2 1 2 3) NIL -1 T) 1. Break [254]> (collect (uniq4 (scan '(1 2 3 4 2 3 6 4 2 7))) ) ;fine 1 [...] 7 (1 2 3 4 6 7) 1. Break [254]> [255]> (uniq4 (scan '(1 2 3 4 2 3 6 4 2 7))) ; item is passed broken values? (1 (1 2 3 4 2 3 6 4 2 7) NIL -1 T) (2 (2 3 4 2 3 6 4 2 7) NIL -1 T) (3 (3 4 2 3 6 4 2 7) NIL -1 T) (4 (4 2 3 6 4 2 7) NIL -1 T) (2 (2 3 6 4 2 7) NIL -1 T) (3 (3 6 4 2 7) NIL -1 T) (6 (6 4 2 7) NIL -1 T) (4 (4 2 7) NIL -1 T) (2 (2 7) NIL -1 T) (7 (7) NIL -1 T) #Z(1 2 3 4 2 3 6 4 2 7) ; #Z() Results of promote-series and/or alter-fn seem involved: (split-if (scan '(1 2 1 2 3)) (lambda (item) (print item) t)) ;incorrect item (split-if #z(1 2 1 2 3) (lambda (item) (print item) t)) ; works Using series-2.2.5 with CLISP-2.27-win32 on MS-Windows-2k. Thanks for your effort, Jörg Höhle (defmacro uniq4 (items &key (key '#'identity) (test '#'eql) &allow-other-keys) (let ((table (gensym "TABLE-")) (item (gensym "ITEM-")) (elt (gensym "ELT-"))) `(let ((,table (make-hash-table :test ,test))) (split-if ,items (lambda (,item &aux (,elt (funcall ,key ,item))) (print ,item) (unless (gethash ,elt ,table) (setf (gethash ,elt ,table) t))))))) ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2002-12-10 13:01 Message: Logged In: YES user_id=28849 A fix for this has been applied. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=103235&aid=516952&group_id=3235 |
From: <no...@so...> - 2002-02-24 23:02:45
|
Bugs item #519015, was opened at 2002-02-18 01:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=519015&group_id=3235 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jörg Höhle (hoehle) Assigned to: Nobody/Anonymous (nobody) Summary: LAMBDA () transformation bug Initial Comment: I believe Series doesn't code-walk or transform properly in the case below where I use LAMBDA both as macro (equivalent to #'(lambda ...)) and in a ((lambda (x) ...) y) form. Maybe it's a bug in CLISP? I was trying to write a UNIQ filter as a macro (I cannot use a function because &rest or &key wouldn't work). BTW, some unique/remove-duplicates functionality might be worth including in the series package, since it's already hidden in parts of it: SCAN-PLIST and SCAN-ALIST remove duplicates. That's why (scan-alist l) is not equivalent to (chunk 2 2 (scan l)). The code is appended as a notice to this bug report because Sourceforge doesn't preserve formatting in the main text. Series 2.2.5, clisp-2.27-win32 on MS-Windos-2k Thanks for your help, Jörg Höhle. ---------------------------------------------------------------------- Comment By: Rahul Jain (rjain) Date: 2002-02-24 15:02 Message: Logged In: YES user_id=246924 it seems that the macroexpansion in SERIES doesn't recognize (lambda...) as a function form, but only recognizes (function...) as a function form. ---------------------------------------------------------------------- Comment By: Jörg Höhle (hoehle) Date: 2002-02-18 01:27 Message: Logged In: YES user_id=377168 (defmacro uniq4 (items &key (key '#'identity) (test '#'eql) &allow-other-keys) ;;TODO evaluation order & eval-once ;;TODO &rest and apply #'make-hash-table to other keys (let ((seen (gensym "SEEN-")) (item (gensym "ITEM-")) ) `(let ((,seen (make-hash-table :test ,test))) (split-if ,items (lambda (,item) ;doesn't work ;; the ((lambda ..) .) trick doesn't capture the variable elt ((lambda (elt) (unless (gethash elt ,seen) (setf (gethash elt ,seen) t))) (funcall ,key ,item))))))) [427]> (setq series:*series-expression-cache* t) ; don't get in my way T [428]> (uniq4 #z(1 2 3 4 2 3 6 4 2 7)) ; works without surprises #Z(1 2 3 4 6 7) ; #Z(2 3 4 2) [429]> (collect (uniq4 #z(1 2 3 4 2 3 6 4 2 7)) ) *** - EVAL: variable #:ITEM-41976 has no value > backtrace-1 [...] EVAL frame for form (COMMON-LISP:LET* ((#:SEEN-41975 (MAKE-HASH-TABLE :TEST #'EQL)) (ELT (COMMON-LISP:FUNCALL #'IDENTITY #:ITEM-41976))) ; ^^ this was incorrectly moved up to the level of the hash table. ; There of course, ITEM(-41976) is not yet defined. (COMMON-LISP:LET (#:OUT-41989) (SETQ #:OUT-41989 (IF (NOT (GETHASH ELT #:SEEN-41975)) (PROGN (SETF (GETHASH ELT #:SEEN-41975) T)))) (COMMON-LISP:LET (#:OUT-41991) (SETQ #:OUT-41991 (LAMBDA (#:ITEM-41976) #:OUT-41989)) ; ^^ item-41976 is defined here (COMMON-LISP:LET (#:LISTPTR-41984 #:ELEMENTS-41985 (#:LASTCONS-41973 (LIST NIL)) #:LST-41974) (DECLARE (TYPE LIST #:LISTPTR-41984) (TYPE CONS #:LASTCONS-41973) (TYPE LIST #:LST-41974)) (SETQ #:LISTPTR-41984 '(1 2 3 4 2 3 6 4 2 7)) (SETQ #:LST-41974 #:LASTCONS-41973) (TAGBODY #:LL-41992 (IF (ENDP #:LISTPTR-41984) (GO SERIES::END)) (SETQ #:ELEMENTS-41985 (CAR #:LISTPTR-41984)) (SETQ #:LISTPTR-41984 (CDR #:LISTPTR-41984)) (IF (NOT (COMMON-LISP:FUNCALL #:OUT-41991 #:ELEMENTS-41985)) (GO #:SS-41982)) (SETQ #:LASTCONS-41973 (SETF (CDR #:LASTCONS-41973) (CONS #:ELEMENTS-41985 NIL))) (GO #:SS-41982) #:SS-41982 (GO #:LL-41992) SERIES::END) (CDR #:LST-41974))))) EVAL frame for form (COLLECT (UNIQ4 (SERIES::LITERAL-SERIES '(1 2 3 4 2 3 6 4 2 7)))) [...] [407]> (macroexpand-1 '(uniq4 #z(1 2 3) :test #'eql)) (LET ((#:SEEN-41970 (MAKE-HASH-TABLE :TEST #'EQL))) (SPLIT-IF (SERIES::LITERAL-SERIES '(1 2 3)) (LAMBDA (#:ITEM-41971) ((LAMBDA (ELT) (UNLESS (GETHASH ELT #:SEEN-41970) (SETF (GETHASH ELT #:SEEN-41970) T))) (FUNCALL #'IDENTITY #:ITEM-41971))))) ; T ; expansion looks ok Small variants of the macro do work: Here I'm using #'(lambda ...) instead of the (lambda ...) macro that ANSI-CL introduced. (defmacro uniq4 (items &key (key '#'identity) (test '#'eql) &allow-other-keys) ;;TODO evaluation order & eval-once ;;TODO &rest and apply make-hash-table to other keys (let ((seen (gensym "SEEN-")) (item (gensym "ITEM-")) ) `(let ((,seen (make-hash-table :test ,test))) (split-if ,items #'(lambda (,item) ;seems to work ;; the ((lambda ..) .) trick doesn't capture the variable elt ((lambda (elt) (unless (gethash elt ,seen) (setf (gethash elt ,seen) t))) (funcall ,key ,item))))))) Here I'm using (LAMBDA ...) but not ((LAMBDA ...) ...): (defmacro uniq4 (items &key (key '#'identity) (test '#'eql) &allow-other-keys) ;;TODO evaluation order & eval-once ;;TODO &rest and apply make-hash-table to other keys (let ((table (gensym "TABLE-")) (item (gensym "ITEM-")) (elt (gensym "ELT-"))) `(let ((,table (make-hash-table :test ,test))) (split-if ,items (lambda (,item &aux (,elt (funcall ,key ,item))) (print ,item) (unless (gethash ,elt ,table) (setf (gethash ,elt ,table) t))))))) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=519015&group_id=3235 |
From: <no...@so...> - 2002-02-24 23:00:08
|
Bugs item #498854, was opened at 2002-01-02 22:44 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=498854&group_id=3235 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Rahul Jain (rjain) Assigned to: Nobody/Anonymous (nobody) >Summary: optimization munges LOOP type specifiers Initial Comment: The following code (series::let* ((foo (scan 'list '(1 2 3))) (max (collect-max foo)) (bar (with-open-file (file filename :direction :input) (loop for line of-type (or null simple-string) = (read-line file nil))))) nil) macroexpands to a form containing (COMMON-LISP:LET ((LINE NIL)) (DECLARE (TYPE (COMMON-LISP:LET ((#:G4883 NULL)) (IF #:G4883 #:G4883 SIMPLE-STRING)) LINE)) Note that the (or null simple-string) type specifier was incorrectly interpreted as an evaluable form and was macroexpanded. Removing the WITH-OPEN-FILE causes the expansion to execute correctly. The macroexpansion of the LOOP form starts with: (COMMON-LISP:LET ((LINE NIL)) (DECLARE (TYPE (OR NULL SIMPLE-STRING) LINE)) The macroexpansion of the WITH-OPEN-FILE form starts with: (COMMON-LISP:LET ((FILE (OPEN FILENAME :DIRECTION :INPUT)) (#:G4904 T)) (UNWIND-PROTECT (MULTIPLE-VALUE-PROG1 (PROGN (LOOP I am using cmucl and series from debian unstable. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=498854&group_id=3235 |
From: <no...@so...> - 2002-02-18 15:51:56
|
Bugs item #516935, was opened at 2002-02-13 04:42 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=516935&group_id=3235 Category: None Group: None Status: Open Resolution: Accepted Priority: 5 Submitted By: Jörg Höhle (hoehle) Assigned to: Nobody/Anonymous (nobody) Summary: poor documentation, rest/key parameters Initial Comment: I'm not too happy with the current state of the documentation (what documentation? ;) of the series package. The implementation has more features than CLtL2 describes. http://www-2.cs.cmu.edu/Groups/AI/html/cltl/clm/node347 .html For example, the following are undocumented: scan* every-nth scan-stream collect-stream collect-ignore literal-series scan-range specifies :start but example & implementation are using :from The often cited AI-memos 1082 and 1083 ftp://publications.ai.mit.edu/ai-publications/1000-1499 /AIM-1082.ps (7MB) ftp://publications.ai.mit.edu/ai-publications/1000-1499 /AIM-1083.ps (5MB) are poor quality scans (.tiff embedded in .ps) of old papers by Richard Waters. Precious, but possibly inaccurate, out of date (1989). They contain valuable information. For example, the user report mentions why I couldn't define my own transducer as a function using &key or &rest parameters. &optional is all that is possible. Using a macro is suggested instead. This failed attempt cost me (and Raymond Toy) time and e-mail trafic. I should have read the memo first, but it was not trivial to find. Neither of http://series.sourceforge.net http://sourceforge.net/projects/series/ links to the MIT memos, or anything newer. There are rumours about papers from 1991 (ACM) or 1992(?). I volunteer to participate in updating an eletronic documentation -- R.toy wrote: "I should ask Dr. Waters if he still has the original sources for the documents." -- with what shall we start? ---------------------------------------------------------------------- >Comment By: Raymond Toy (rtoy) Date: 2002-02-18 07:51 Message: Logged In: YES user_id=28849 Dr. Waters has sent me his text documentation. I'll add it to the repository. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=516935&group_id=3235 |
From: <no...@so...> - 2002-02-18 09:27:36
|
Bugs item #519015, was opened at 2002-02-18 01:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=519015&group_id=3235 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jörg Höhle (hoehle) Assigned to: Nobody/Anonymous (nobody) Summary: LAMBDA () transformation bug Initial Comment: I believe Series doesn't code-walk or transform properly in the case below where I use LAMBDA both as macro (equivalent to #'(lambda ...)) and in a ((lambda (x) ...) y) form. Maybe it's a bug in CLISP? I was trying to write a UNIQ filter as a macro (I cannot use a function because &rest or &key wouldn't work). BTW, some unique/remove-duplicates functionality might be worth including in the series package, since it's already hidden in parts of it: SCAN-PLIST and SCAN-ALIST remove duplicates. That's why (scan-alist l) is not equivalent to (chunk 2 2 (scan l)). The code is appended as a notice to this bug report because Sourceforge doesn't preserve formatting in the main text. Series 2.2.5, clisp-2.27-win32 on MS-Windos-2k Thanks for your help, Jörg Höhle. ---------------------------------------------------------------------- >Comment By: Jörg Höhle (hoehle) Date: 2002-02-18 01:27 Message: Logged In: YES user_id=377168 (defmacro uniq4 (items &key (key '#'identity) (test '#'eql) &allow-other-keys) ;;TODO evaluation order & eval-once ;;TODO &rest and apply #'make-hash-table to other keys (let ((seen (gensym "SEEN-")) (item (gensym "ITEM-")) ) `(let ((,seen (make-hash-table :test ,test))) (split-if ,items (lambda (,item) ;doesn't work ;; the ((lambda ..) .) trick doesn't capture the variable elt ((lambda (elt) (unless (gethash elt ,seen) (setf (gethash elt ,seen) t))) (funcall ,key ,item))))))) [427]> (setq series:*series-expression-cache* t) ; don't get in my way T [428]> (uniq4 #z(1 2 3 4 2 3 6 4 2 7)) ; works without surprises #Z(1 2 3 4 6 7) ; #Z(2 3 4 2) [429]> (collect (uniq4 #z(1 2 3 4 2 3 6 4 2 7)) ) *** - EVAL: variable #:ITEM-41976 has no value > backtrace-1 [...] EVAL frame for form (COMMON-LISP:LET* ((#:SEEN-41975 (MAKE-HASH-TABLE :TEST #'EQL)) (ELT (COMMON-LISP:FUNCALL #'IDENTITY #:ITEM-41976))) ; ^^ this was incorrectly moved up to the level of the hash table. ; There of course, ITEM(-41976) is not yet defined. (COMMON-LISP:LET (#:OUT-41989) (SETQ #:OUT-41989 (IF (NOT (GETHASH ELT #:SEEN-41975)) (PROGN (SETF (GETHASH ELT #:SEEN-41975) T)))) (COMMON-LISP:LET (#:OUT-41991) (SETQ #:OUT-41991 (LAMBDA (#:ITEM-41976) #:OUT-41989)) ; ^^ item-41976 is defined here (COMMON-LISP:LET (#:LISTPTR-41984 #:ELEMENTS-41985 (#:LASTCONS-41973 (LIST NIL)) #:LST-41974) (DECLARE (TYPE LIST #:LISTPTR-41984) (TYPE CONS #:LASTCONS-41973) (TYPE LIST #:LST-41974)) (SETQ #:LISTPTR-41984 '(1 2 3 4 2 3 6 4 2 7)) (SETQ #:LST-41974 #:LASTCONS-41973) (TAGBODY #:LL-41992 (IF (ENDP #:LISTPTR-41984) (GO SERIES::END)) (SETQ #:ELEMENTS-41985 (CAR #:LISTPTR-41984)) (SETQ #:LISTPTR-41984 (CDR #:LISTPTR-41984)) (IF (NOT (COMMON-LISP:FUNCALL #:OUT-41991 #:ELEMENTS-41985)) (GO #:SS-41982)) (SETQ #:LASTCONS-41973 (SETF (CDR #:LASTCONS-41973) (CONS #:ELEMENTS-41985 NIL))) (GO #:SS-41982) #:SS-41982 (GO #:LL-41992) SERIES::END) (CDR #:LST-41974))))) EVAL frame for form (COLLECT (UNIQ4 (SERIES::LITERAL-SERIES '(1 2 3 4 2 3 6 4 2 7)))) [...] [407]> (macroexpand-1 '(uniq4 #z(1 2 3) :test #'eql)) (LET ((#:SEEN-41970 (MAKE-HASH-TABLE :TEST #'EQL))) (SPLIT-IF (SERIES::LITERAL-SERIES '(1 2 3)) (LAMBDA (#:ITEM-41971) ((LAMBDA (ELT) (UNLESS (GETHASH ELT #:SEEN-41970) (SETF (GETHASH ELT #:SEEN-41970) T))) (FUNCALL #'IDENTITY #:ITEM-41971))))) ; T ; expansion looks ok Small variants of the macro do work: Here I'm using #'(lambda ...) instead of the (lambda ...) macro that ANSI-CL introduced. (defmacro uniq4 (items &key (key '#'identity) (test '#'eql) &allow-other-keys) ;;TODO evaluation order & eval-once ;;TODO &rest and apply make-hash-table to other keys (let ((seen (gensym "SEEN-")) (item (gensym "ITEM-")) ) `(let ((,seen (make-hash-table :test ,test))) (split-if ,items #'(lambda (,item) ;seems to work ;; the ((lambda ..) .) trick doesn't capture the variable elt ((lambda (elt) (unless (gethash elt ,seen) (setf (gethash elt ,seen) t))) (funcall ,key ,item))))))) Here I'm using (LAMBDA ...) but not ((LAMBDA ...) ...): (defmacro uniq4 (items &key (key '#'identity) (test '#'eql) &allow-other-keys) ;;TODO evaluation order & eval-once ;;TODO &rest and apply make-hash-table to other keys (let ((table (gensym "TABLE-")) (item (gensym "ITEM-")) (elt (gensym "ELT-"))) `(let ((,table (make-hash-table :test ,test))) (split-if ,items (lambda (,item &aux (,elt (funcall ,key ,item))) (print ,item) (unless (gethash ,elt ,table) (setf (gethash ,elt ,table) t))))))) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=519015&group_id=3235 |
From: <no...@so...> - 2002-02-18 09:26:23
|
Bugs item #519015, was opened at 2002-02-18 01:26 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=519015&group_id=3235 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jörg Höhle (hoehle) Assigned to: Nobody/Anonymous (nobody) Summary: LAMBDA () transformation bug Initial Comment: I believe Series doesn't code-walk or transform properly in the case below where I use LAMBDA both as macro (equivalent to #'(lambda ...)) and in a ((lambda (x) ...) y) form. Maybe it's a bug in CLISP? I was trying to write a UNIQ filter as a macro (I cannot use a function because &rest or &key wouldn't work). BTW, some unique/remove-duplicates functionality might be worth including in the series package, since it's already hidden in parts of it: SCAN-PLIST and SCAN-ALIST remove duplicates. That's why (scan-alist l) is not equivalent to (chunk 2 2 (scan l)). The code is appended as a notice to this bug report because Sourceforge doesn't preserve formatting in the main text. Series 2.2.5, clisp-2.27-win32 on MS-Windos-2k Thanks for your help, Jörg Höhle. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=519015&group_id=3235 |
From: <no...@so...> - 2002-02-13 13:11:31
|
Bugs item #516952, was opened at 2002-02-13 05:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=516952&group_id=3235 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jörg Höhle (hoehle) Assigned to: Nobody/Anonymous (nobody) Summary: only optimized split-if works Initial Comment: a completes series expression is optimized and produces correct output, the intermediates however do not: I expect two series values returned from split-if. [252]> (collect (split-if (scan '(1 2 1 2 3)) (lambda (item) (evenp item)))) (2 2); fine [253]> (split-if (scan '(1 2 1 2 3)) (lambda (item) (print item) (evenp item))) (1 (1 2 1 2 3) NIL -1 T) *** - argument to EVENP should be an integer: (1 (1 2 1 2 3) NIL -1 T) 1. Break [254]> (collect (uniq4 (scan '(1 2 3 4 2 3 6 4 2 7))) ) ;fine 1 [...] 7 (1 2 3 4 6 7) 1. Break [254]> [255]> (uniq4 (scan '(1 2 3 4 2 3 6 4 2 7))) ; item is passed broken values? (1 (1 2 3 4 2 3 6 4 2 7) NIL -1 T) (2 (2 3 4 2 3 6 4 2 7) NIL -1 T) (3 (3 4 2 3 6 4 2 7) NIL -1 T) (4 (4 2 3 6 4 2 7) NIL -1 T) (2 (2 3 6 4 2 7) NIL -1 T) (3 (3 6 4 2 7) NIL -1 T) (6 (6 4 2 7) NIL -1 T) (4 (4 2 7) NIL -1 T) (2 (2 7) NIL -1 T) (7 (7) NIL -1 T) #Z(1 2 3 4 2 3 6 4 2 7) ; #Z() Results of promote-series and/or alter-fn seem involved: (split-if (scan '(1 2 1 2 3)) (lambda (item) (print item) t)) ;incorrect item (split-if #z(1 2 1 2 3) (lambda (item) (print item) t)) ; works Using series-2.2.5 with CLISP-2.27-win32 on MS-Windows-2k. Thanks for your effort, Jörg Höhle (defmacro uniq4 (items &key (key '#'identity) (test '#'eql) &allow-other-keys) (let ((table (gensym "TABLE-")) (item (gensym "ITEM-")) (elt (gensym "ELT-"))) `(let ((,table (make-hash-table :test ,test))) (split-if ,items (lambda (,item &aux (,elt (funcall ,key ,item))) (print ,item) (unless (gethash ,elt ,table) (setf (gethash ,elt ,table) t))))))) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103235&aid=516952&group_id=3235 |