[racket-dev] possible 5.2.900.1 bug involving rest argument

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Sat Jul 28 13:52:13 EDT 2012

Looks like a minor compiler/optimizer bug in Friday's 5.2.900.1 pre-release.

I haven't yet found a simpler test case, but you can reproduce by 
installing a particular PLaneT package as shown below.

The line 1275 it's complaining about is the following, which starts a 
procedure definition that is later applied at toplevel in the same module:

(define (charterm-make-keydec keydec-id . keysets)

The demo program for this PLaneT package seems to run correctly despite 
these install/compile-time error messages.

Racket 5.2.1 does not give these install/compile-time errors, as is also 
shown below.

$ /usr/local/racket-5.2.900.1-20120727/bin/raco planet remove neil 
charterm.plt 3 0
[...]
$ /usr/local/racket-5.2.900.1-20120727/bin/racket -p neil/charterm:3:=0
andmap: contract violation
   expected: list?
   given: 
'(#<syntax:/home/user/.racket/planet/300/5.2.900.1/cache/neil/charterm.plt/3/0/charterm.rkt:1275:30 
keydec-id> . 
#<syntax:/home/user/.racket/planet/300/5.2.900.1/cache/neil/charterm.plt/3/0/charterm.rkt:1275:42 
keysets>)
   argument position: 2nd
   other arguments...:
    #<procedure:void>
andmap: contract violation
   expected: list?
   given: 
'(#<syntax:/home/user/.racket/planet/300/5.2.900.1/cache/neil/charterm.plt/3/0/charterm.rkt:1275:30 
keydec-id> . 
#<syntax:/home/user/.racket/planet/300/5.2.900.1/cache/neil/charterm.plt/3/0/charterm.rkt:1275:42 
keysets>)
   argument position: 2nd
   other arguments...:
    #<procedure:void>
raco setup: error: during making for <planet>/neil/charterm.plt/3/0 
(CharTerm)
raco setup:   andmap: contract violation
raco setup:     expected: list?
raco setup:     given: 
'(#<syntax:/home/user/.racket/planet/300/5.2.900.1/cache/neil/charterm.plt/3/0/charterm.rkt:1275:30 
keydec-id> . 
#<syntax:/home/user/.racket/planet/300/5.2.900.1/cache/neil/charterm.plt/3/0/charterm.rkt:1275:42 
keysets>)
raco setup:     argument position: 2nd
raco setup:     other arguments...:
raco setup:      #<procedure:void>
raco setup: error: during Building docs for 
/home/user/.racket/planet/300/5.2.900.1/cache/neil/charterm.plt/3/0/doc.scrbl
raco setup:   andmap: contract violation
raco setup:     expected: list?
raco setup:     given: 
'(#<syntax:/home/user/.racket/planet/300/5.2.900.1/cache/neil/charterm.plt/3/0/charterm.rkt:1275:30 
keydec-id> . 
#<syntax:/home/user/.racket/planet/300/5.2.900.1/cache/neil/charterm.plt/3/0/charterm.rkt:1275:42 
keysets>)
raco setup:     argument position: 2nd
raco setup:     other arguments...:
raco setup:      #<procedure:void>
$

$ /usr/local/racket-5.2.1/bin/raco planet remove neil charterm.plt 3 0
[...]
$ /usr/local/racket-5.2.1/bin/racket -p neil/charterm:3:=0
[...no output...]
$

Neil V.


Posted on the dev mailing list.