The latest Green Card version behaves different from earlier versions.
E.g. the following a small example

--------------------------------------
import StdDIS

type Table = [Int]
%dis table x = stable x

%fun getTable :: IO Table
%code
%result (stable {the_table})
--------------------------------------

is converted to

--------------------------------------
import StdDIS

type Table = [Int]

getTable :: IO Table
getTable =
  _casm_ ``do {int the_table;      <= !!! HUH???
               do {;
                   %r = the_table;} while(0);} while(0);''
  >>= \  the_table  ->
  ( deRefStablePtr  the_table) >>= \ gc_res1 ->
  (return (gc_res1))
--------------------------------------

the_table is a global C variable, but Green Card suddenly defines a
local variable with the same name. Bug or feature? If it's the latter,
how can global C variables be accessed from Haskell land now?

-- 
Sven Panne                                        Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik                     FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen              Oettingenstr. 67
mailto:[EMAIL PROTECTED]            D-80538 Muenchen
http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne

Reply via email to