I think there is a problem with %Foreign in green card (for 2.09). Here
is a minimal file which illustrates it.

-----
module Foo
 
where
 
import StdDis
 
data Datum = Datum ForeignObj Int
%dis datum x y = Datum (foreignPtr x) (int y)
 
 
%fun gdbm_fetch :: Int -> Datum
%code datum result;
%result (datum {result.dptr} {result.dsize})
---
This doesn't actually do anything - I've stripped away anything which is
not absolutely essential for showing the error.

When you run green card, you get the message "Malformed %Foreign". BTW
this worked OK with verion 0.9. If you take away the {} around
result.dptr, then it runs all the way through but the resulting code is
wrong. It includes references to both C and Haskell variables called
"result.dptr", which yields a parse error at the Haskell level, and
wouldn't compile at the C level even if it got through.

Also, two minor points:
 * there is no newline at the end of the error message - annoying.
 * you have to add three spurious characters to the end of the input
file on the command line.

-- David
_______________________________________________________________________
David Elworthy <[EMAIL PROTECTED]>
Canon Research Centre Europe Ltd., Guildford, Surrey, UK
URL: http://www.cre.canon.co.uk/
Phone: +44 1483 448844; Fax: +44 1483 448845

Reply via email to