[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-janitors] #1145: Issue with matchable and the module system
From: |
Chicken Trac |
Subject: |
Re: [Chicken-janitors] #1145: Issue with matchable and the module system |
Date: |
Fri, 20 Nov 2015 12:58:05 -0000 |
#1145: Issue with matchable and the module system
-----------------------+--------------------------------------
Reporter: mario | Owner: sjamaan
Type: defect | Status: assigned
Priority: major | Milestone: 4.11.0
Component: expander | Version: 4.9.x
Resolution: | Keywords: matchable, module system
-----------------------+--------------------------------------
Comment (by sjamaan):
If you want to debug this, see the generated source, you can try putting
the match expression outside of a module, and then compile with {{{csc
-debug 2 test.scm}}}. It will output something like:
{{{
#!scm
[canonicalized]
(##core#callunit "library")
(##core#callunit "eval")
(##core#callunit "chicken_2dsyntax")
(##core#undefined)
(let ((t11 (let ((t10 (##sys#require 'matchable))) (##core#undefined))))
(##core#undefined))
(let ((v1316 'some-form))
(let ((failure1927
(##core#lambda
()
(let ((failure3038
(##core#lambda () (error 'match '"no matching
pattern"))))
(let ((else97 v1316)) '#f)))))
(let ((sk2587591 (##core#lambda (b592 a593) 'a-macro)))
(let ((fk2595599
(##core#lambda
()
(if (pair? v1316)
(let ((w680687 (car v1316)) (x682688 (cdr v1316)))
(if (equal? w680687 'y)
(if (if (pair? x682688) (null? (cdr x682688)) '#f)
(let ((w770775 (car x682688)))
;; The "a" in the expression below is clearly
unbound
(let ((b831 w770775)) (sk2587591 b831 a)))
(failure1927))
(failure1927)))
(failure1927)))))
(if (pair? v1316)
(let ((w911918 (car v1316)) (x913919 (cdr v1316)))
(if (equal? w911918 'x)
(if (if (pair? x913919) (null? (cdr x913919)) '#f)
(let ((w10011006 (car x913919)))
;; The "b" in the expression below is clearly unbound
(let ((a1062 w10011006)) (sk2587591 b a1062)))
(fk2595599))
(fk2595599)))
(fk2595599))))))
((##sys#implicit-exit-handler))
(##core#undefined)
}}}
There's a bit of a problem with CHICKEN in that it bails out early when a
module is unresolved, so you can't see '''exactly''' how it's compiled
inside a module, but I think the problem is clear in the code above, where
I put the comments.
--
Ticket URL: <http://bugs.call-cc.org/ticket/1145#comment:12>
CHICKEN Scheme <http://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.