Closed justinethier closed 3 years ago
Here is a simplified program leading to the same (or at least very similar) compilation warning:
((lambda (failure)
((lambda (else) 'done) 'v))
(lambda () (error 'match "no matching pattern")))
This program is equivalent to the original match example:
(((lambda (v)
((lambda (failure)
((lambda (else) 'done) v))
(lambda () (error 'match "no matching pattern"))))
(read)))
Seems ultimately this is not an issue with match but rather with the compiler itself.
Updated the compiler to no longer emit code containing unused closures.
Consider the following example:
This produces the following warning when compiled:
It seems the problem is that there is a continuation to handle the case when there is match, but when there is an
else
this continuation will never be called.TBD if
match
can be enhanced to generate better code in this case.Regardless, our compiler should not be generating C statements with no effect.