David Elworthy writes:
>
> 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.
>
Thanks, a ForeignObj unmarshall bug/limitation,
ftp://laysan.dcs.gla.ac.uk/fran/green-card.zip
contains a version that hopefully fixes the problem.
>
> Also, two minor points:
> * there is no newline at the end of the error message - annoying.
Yep, I've changed this to also print out the %dis where it breaks,
which hopefully should make debugging a little bit easier.
>
> * you have to add three spurious characters to the end of the input
> file on the command line.
>
There was the implicit assumption that Green Card files ended in
.gc. I've removed this, given the input file Foo[.baz], Green Card
will now create the file Foo.hs for the ghc backend.
Thanks again for the feedback.
--Sigbjorn