﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
487	matchable: crash matching a symbol when a production contains |...|	Alan Post		"The following program:

{{{
(use matchable)

(pretty-print (map
  (match-lambda
    ((x ... y) `(,x ,y))
    (x         x))
  '((a c) (a b c) (a b b c) (a) (c) a)))
(exit)
}}}

Generates the following error message:

{{{
Error: (length) bad argument type - not a proper list: a

        Call history:

        <eval>    (#%= n109 tail-len102)
        <eval>    (#%reverse p-ls56)
        <eval>    (#%pair? ls104)
        <eval>    (#%null? (#%cdr ls104))
        <eval>    (#%cdr ls104)
        <eval>    (#%car ls104)
        <eval>    (##sys#cons x (##sys#cons y (##core#quote ())))
        <eval>    (##sys#cons y (##core#quote ()))
        <eval>    (#%length (quote103 (y)))
        <eval>    (#%length ls104)      <--
}}}

I would expect the output of the program to instead be:

{{{
(((a) c) ((a b) c) ((a b b) c) (() a) (() c) a)
}}}

The error message is being generated by the final element in the map, the symbol |a|.  It seems to be a caused by the |...| operator in matchable.

With the following variation (substituted a single |.| for the |...|):

{{{
(use matchable)

(pretty-print (map
  (match-lambda
    ((x . y) `(,x ,y))
    (x         x))
  '((a c) (a b c) (a b b c) (a) (c) a)))
(exit)
}}}

The program does not generate the error message.  It does generate a slightly different result, of course:

{{{
((a (c)) (a (b c)) (a (b b c)) (a ()) (c ()) a)
}}}

I'm running Chicken experimental de033aef6860a4b76d388810e73d3927fd553e95 on OpenBSD 4.8 in a VMWare virtual machine."	defect	closed	major	4.9.0	extensions	4.6.x	fixed			
