Reduceron icon indicating copy to clipboard operation
Reduceron copied to clipboard

Problems with Flite examples.

Open VitorCBSB opened this issue 8 years ago • 1 comments

Hello, I've been trying to run the examples in Flite, but some of them are giving unexpected results. For instance, the Fibonacci one gives the following output:

C:\Users\VitorCBSB\Reduceron\flite>stack exec -- flite examples/Fib.hs
fib(10) =

If I compile it to C and run it, these are the results:

C:\Users\VitorCBSB\Reduceron\flite>stack exec -- flite -c examples/Fib.hs > Fib.c

C:\Users\VitorCBSB\Reduceron\flite>gcc Fib.c -o Fib

C:\Users\VitorCBSB\Reduceron\flite>Fib
fib(10) = ERROR: bottom!

I have also found problems with Taut.hs (empty output) and Countdown.hs (either doesn't stop running or takes a long time). Sudoku.hs, however, apparently works correctly. Have not attempted to run the others yet.

Thanks.

VitorCBSB avatar May 02 '16 17:05 VitorCBSB

First, thanks for the report and I'm so very very sorry for not noticing this report until now (I have no idea how that happened).

Indeed, the examples aren't run as part of the regression suite and are in fact broken (the examples in programs all pass). It would seem that I broke it. If you replace

emitStr [] k = k;

with

emitStr Nil k = k;

it works.

I'll look into this.

tommythorn avatar May 25 '17 02:05 tommythorn