Only simple circular lists seem to work properly.

'(a b . (c d e .))

is equivalent to

'(a b c d e c d e ...)

: (de X . (a b .))
-> X
: X
-> (a b .)
: (de X . (a . (b c .)))
# X redefined
-> X
: (cdr X)
-> (b c .)
: X
-> (a b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b c b
c b c b c b c b c b c b c b c b c b c b c b c b c

and so on forever.

John

On 10 Apr 2008, at 3:35 AM, Jon Kleiser wrote:

Hi Alex,

After you made me aware of the circular list in lib/form.l, I changed my 'ifwarn' function to skip circular lists by putting in the (nT (length Prg)) test, like this:

(de ifwarn (Prg)
        (when (and (lst? Prg) (nT (length Prg)))
                (when (and (= (car Prg) 'if) (<> (length Prg) 4))
                        (println Prg) )
                (mapcar ifwarn Prg)
                NIL) )

However, this fix may not be the ultimate, because in lib/misc.l there's a tougher problem, that can be illustrated by this ...

(length '(de *Day . (Mon Tue Wed Thu Fri Sat Sun .)))

.. which I'm not able to abort with Ctrl-C or Ctrl-D. Ctrl-Z does it.

Why does 'length' have such problems here?

/Jon

Reply via email to