happy: intToInt16# vs narrow16Int#
Tue, 28 Aug 2001 10:23:26 -0400
Content-Type: text/plain; charset=us-ascii
On 2001-08-27T11:27:45+0100, Simon Marlow wrote:
> We're still using Happy from before your changes to make it not
> dependent on the word size, and that version still works with both 5.02
> and 5.00.2 because it doesn't use either intToInt16# or narrowInt16#.=20
Ah! (smacks head)
> Unfortunately we can't just use conditional compilation in the template
> to pick the right one, because we can't force the generated parser to
> require -cpp to compile. Or perhaps we should? Happy can put the flag
> automatically in the OPTIONS pragma at the top of the file. Then we
> have to figure out how to quote these cpp directives in GenericTemplate
> so they don't get processed by the first pass of cpp.
> And for GHC >=3D 5.00, we really should be using indexInt16OffAddr#.
our_narrow16Int# :: Int# -> Int#
=3D case fromIntegral (fromIntegral (I# i#) :: Int16) of
I# i16# -> i16#
But would this work with sufficiently earlier versions of GHC?
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
"Enjoy. It's dreadful, but it's quite short"
- Dylan Moran, "Black Books"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----