File: bugs

package info (click to toggle)
cl-pdf 117-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,860 kB
  • ctags: 844
  • sloc: lisp: 8,897; makefile: 39
file content (92 lines) | stat: -rw-r--r-- 2,802 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Overview
********

1 Unfixed bugs (TODO)
*********************

1.1 Doesn't build on Corman Lisp
================================

reported by Carlos Ungil <<ungil@mac.com>>; fix at
http://www.artofprogramming.com/bb/viewtopic.php?t=85
(http://www.artofprogramming.com/bb/viewtopic.php?t=85)

1.2 PREVIOUS and INITIALLY
==========================

      (iter (for el in '(1 2 3 4))
            (for p-el previous el)
            (for pp-el previous p-el initially 0)
            (collect pp-el))

   gives `(0 NIL 1 2)'; should be `(0 0 1 2)' according to the manual. I
suspect it's a doc bug. Found by Carlos Ungil <<ungil@mac.com>>.

     (iter (for el in '(1 2 3 4))
           (for pp-el previous el back 2 initially 0)
           (collect pp-el))

   gives the right result.

   So does:

     (iter (for el in '(1 2 3 4))
           (for p-el previous el initially 0)
           (for pp-el previous p-el initially 0)
           (collect pp-el))

   Without an INITIALLY 0, p-el gets set to NIL the first time through
the loop. So, pp-el's value is NIL the second time through the loop.
The for...previous documentation talks about the "first" and "second"
value. But it doesn't detail if the initial value counts as a "first"
value.

2 Wishlist
**********

2.1 Macrolets in the iterate form
=================================

     (iterate (for i from 0 to 20)
              (macrolet ((collect-if-divisible (variable divisor result-var)
     		      `(when (zerop (mod ,variable ,divisor))
     			 (collect ,variable into ,result-var))))
                (collect-if-divisible i 3 result-3)
     	   (collect-if-divisible i 5 result-5))
         	 (finally (return (values result-3 result-5))))

   would be nice to have. Currently has to be rewritten:

     (macrolet ((collect-if-divisible (variable divisor result-var)
     		   `(when (zerop (mod ,variable ,divisor))
     			 (collect ,variable into ,result-var))))
       (iterate (for i from 0 to 20)
                (collect-if-divisible i 3 result-3)
     	   (collect-if-divisible i 5 result-5)
     	   (finally (return (values result-3 result-5)))))

   of course, this does not work in all cases.

3 Already done (DONE)
*********************

3.1 synonyms
============

     (iter (generating (key . item) in '((a . 1) (b . 2) (c .3)))
           (collect (next key))
           (collect (next item)))
     TYPE ERROR : The value ITEM is not of type LIST.
     in the manual: (a 2 c)

   `iter:symbol-synonym' was broken.

4 Administrativa
****************

arch-tag: de16d41a-b240-11d8-a267-000c76244c24

   You can find the most recent version of this file at
http://boinkor.net/iterate.bugs.html
(http://boinkor.net/iterate.bugs.html)