[Haskell-cafe] Problem with JHC
Philippos Apolinarius
phi500ac at yahoo.ca
Wed Nov 11 16:26:03 EST 2009
Hi, Ross.
Ops, the paste is wrong, but the bug is real. I mean, if I try to run
the program with the right input, the program aborts in the same place,
with the same error message:
philip at desktop:~/jhctut$ ./jtestarbo
Give me a tree:
T AND [L 1, L 2]
jtestarbo_code.c:2670: case fell off
Abortado
In fact, it aborts in the same place for any input. This fact may help to discover where the trouble is:
philip at desktop:~/jhctut$ ./jtestarbo
Give me a tree:
fdsfkldkl
jtestarbo_code.c:2670: case fell off
Abortado
--- On Wed, 11/11/09, Ross Mellgren <rmm-haskell at z.odi.ac> wrote:
From: Ross Mellgren <rmm-haskell at z.odi.ac>
Subject: Re: [Haskell-cafe] Problem with JHC
To: "Philippos Apolinarius" <phi500ac at yahoo.ca>
Cc: "Felipe Lessa" <felipe.lessa at gmail.com>, haskell-cafe at haskell.org
Received: Wednesday, November 11, 2009, 9:52 AM
According to the paste you gave for the JHC test run:
Here is what happens when I try to run it:
philip at desktop:~/jhctut$ ./jtree
Give me a tree:
T AND (L 1, L 2)
jtree_code.c:2670: case fell off
Aborted
You gave it parens not square brackets.
-Ross
On Nov 11, 2009, at 11:45 AM, Philippos Apolinarius wrote:
> you declared 'T Op [Tree]' so you should give 'T AND [L 1, L 2]'
> as the tree, right?
Hi, Felipe.
You are right. This means that I gave the correct input to the program. As you can see, I typed 'T AND [L 1, L 2]'. Therefore, JHC was expected to parse and print it. However, it failed to parse it. The program works perfectly well in GHC. Here is the GHC output:
> philip at desktop:~/jhctut$ ghc tree.hs --make
[1 of 1] Compiling Main ( tree.hs, tree.o )
Linking tree ...
> philip at desktop:~/jhctut$ ./tree
Give me a tree:
T AND [L 1, L 2]
T AND [L 1,L 2]
--- On Wed, 11/11/09, Felipe Lessa <felipe.lessa at gmail.com> wrote:
From: Felipe Lessa <felipe.lessa at gmail.com>
Subject: Re: [Haskell-cafe] Problem with JHC
To: haskell-cafe at haskell.org
Received: Wednesday, November 11, 2009, 6:23 AM
On Wed, Nov 11, 2009 at 04:32:05AM -0800, Philippos Apolinarius wrote:
> data Op = AND | OR | NOT deriving (Show, Read)
> data Tree= L Int | T Op [Tree] deriving (Show, Read)
Hmm, you see,
> philip at desktop:~/jhctut$ ./jtree
> Give me a tree:
> T AND (L 1, L 2)
>
> jtree_code.c:2670: case fell off
> Aborted
you declared 'T Op [Tree]' so you should give 'T AND [L 1, L 2]'
as the tree, right?
--
Felipe.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Get the name you've always wanted ! @ymail.com or @rocketmail.com._______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
__________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091111/19c88f6b/attachment.html
More information about the Haskell-Cafe
mailing list