Hi, John. I am trying JHC in a small embedded system (Medical instruments). The software is written in Clean, and I am translating to Haskell. You may want to take a look at my page: http://www.discenda.org/med/ I am writing because I found something in JHC that smells like a bug. The program compiles without a single complaint both in GHC and JHC, but the resulting binary file does not work in JHC. I wrote a simplified example so you can spot the problem easily. The original program is used to design and simplify digital circuits for sensors (capnograms, electrocardiograms, electroencephalograms, electromyograms, and temperature). It seems that JHC is not able to deal with the trees representing the circuits. Here is a very small program. All it does is to read a tree and show it: {- file: tree.hs -} {- compile: jhc tree.hs -dc -o jtree } import System (getArgs) import System.IO import IO data Op = AND | OR | NOT deriving (Show, Read) data Tree= L Int | T Op [Tree] deriving (Show, Read) main= do putStrLn "Give me a tree:" s <- getLine let xx= read s putStrLn (show (xx::Tree)) Here is what happens when I try to run it: philip@desktop:~/jhctut$ ./jtree Give me a tree: T AND (L 1, L 2) jtree_code.c:2670: case fell off Aborted It seems that the problem is in the Read class, since it works if I use the Show class only: import System (getArgs) import System.IO import IO data Op = AND | OR | NOT deriving (Show, Read) data Tree= L Int | T Op [Tree] deriving (Show, Read) main= do putStrLn "Give me a tree:" s <- getLine let xx= T AND [L 1, L 2] putStrLn (show (xx::Tree)) I hope you can fix it. --- On Wed, 11/11/09, John Meacham <john@repetae.net> wrote:
|