[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Internal compiler error on use bindings
From: |
Peter Bex |
Subject: |
Re: [Chicken-users] Internal compiler error on use bindings |
Date: |
Tue, 20 Mar 2012 14:21:54 +0100 |
User-agent: |
Mutt/1.4.2.3i |
On Tue, Mar 20, 2012 at 01:11:14PM +0000, Mark Carter wrote:
> Here's one for your mystery file:
>
> foo.scm:
> (use bindings)
> (bind (a b c) '(1 2 3)
> (print a))
> (write-line "Finished")
>
>
> $ csj -bq foo.scm
> 1
> Finished
>
> BUT:
>
> $ csc foo.scm
>
> Error: [internal compiler error] type of literal not supported: #<procedure>
>
> Call history:
>
> <syntax> (##core#begin (write-line "Finished"))
> <syntax> (write-line "Finished") <--
That's a bug in the bind egg. It is a macro that returns procedure
objects instead of the name that refers to the procedure.
In the interpreter that's allowed but the compiler doesn't know
how to serialize them.
You can easily see this in the interpreter by typing ,x (bind ...):
#;2> ,x (bind (a b c) '(1 2 3)
(print a))
(##core#let
((a ('#<procedure> '(1 2 3) 0))
(b ('#<procedure> '(1 2 3) 1))
(c ('#<procedure> '(1 2 3) 2)))
(if (and ('#<procedure> ('#<procedure> '(1 2 3) 3)))
(begin (print a))
(#%error
'bind
(#%sprintf
"(sub)sequence in ~A too long to match (sub)pattern in ~A~%"
'(1 2 3)
'(a b c)))))
The if for example is easy to fix:
(and ,@(map (lambda (x) `(',empty? ,x)) checks))
I think this should be:
(and ,@(map (lambda (x) `(empty? ,x)) checks))
I don't know if Juergen (the "bindings" maintainer) is reading this
mailinglist, otherwise it's probably a good idea to file a bug in trac
and/or mail him about it.
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth