
I'm trying to test TclHaskell under Hugs98-Nov2003, compiled from source. My current problem with getting it to work seems to be a failure to load the function intToWord32. Well, here is a partial transcript of a session run from within the TclHaskell src directory (after compiling TclPrim.so): ------------- bash-2.05b$ hugs __ __ __ __ ____ ___ _________________________________________ || || || || || || ||__ Hugs 98: Based on the Haskell 98 standard ||___|| ||__|| ||__|| __|| Copyright (c) 1994-2003 ||---|| ___|| World Wide Web: http://haskell.org/hugs || || Report bugs to: hugs-bugs@haskell.org || || Version: November 2003 _________________________________________ Haskell 98 mode: Restart with command line option -98 to enable extensions Type :? for help Prelude> :load "../demo/Demo.hs" ERROR "./TclPrim.hs":49 - Undefined variable "intToWord32" Word> :names Hugs.Array.! Hugs.Prelude.!! Hugs.Prelude.$ Hugs.Prelude.$! Hugs.Prelude.% Hugs.Prelude.&& Hugs.Prelude.() Hugs.Prelude.* Hugs.Prelude.** Hugs.Prelude.+ ....[snipped many lines] Hugs.Int.intToInt16 Hugs.Int.intToInt32 Hugs.Int.intToInt8 Hugs.Prelude.intToRatio Hugs.Word.intToWord16 Hugs.Word.intToWord32 ... [snipped the rest] ---------------------- So ':names' thinks there is such a thing, but the loader doesn't? I see that intToWord32 is declared with the keyword "primitive" -- i.e., specifically, from Word.hs in the library: primitive intToWord32 "intToWord32" :: Int -> Word32 I'm having trouble finding this syntax in the documentation, but, as I recall -- perhaps incorrectly -- I ran across some gopher documentation that indicated that the "intToWord32" in quotation marks was supposed to be the file name where the foreign primitive could be found. Using "locate" I can't find any files by the name of "intToWord32" in my system. Perhaps this is the Undefined variable in question. Finally, I'm running on a Linux system, Slackware 9, 400Mhz pentium II, 128 mb memory. Any advice or references to documentation will be appreciated. (By the way -- I decided to try TclHaskell because it seemed to be the simplest way to get a graphical interface to an application going! Any advice here will be appreciated as well.) Thanks, John Velman

John Velman wrote:
I'm trying to test TclHaskell under Hugs98-Nov2003, compiled from source.
My current problem with getting it to work seems to be a failure to load the function intToWord32.
"intToWord32" and friends have been deprecated more than 3 years ago, and recent Haskell platforms have dropped the support for it completely. You can easily use the more general "fromIntegral" as a replacement.
[...] So ':names' thinks there is such a thing, but the loader doesn't?
Yep, it's only an internal function in that module.
[...] I'm having trouble finding this syntax in the documentation
The "primitive" keyword is used for Hugs internals only. It means that the runtime system has a C function registered with the given name. Think of "primitive" as the glue between C and Haskell. It has got nothing to do with any filenames.
[...] (By the way -- I decided to try TclHaskell because it seemed to be the simplest way to get a graphical interface to an application going! Any advice here will be appreciated as well.)
It really depends on your GUI needs, http://haskell.org/libraries/#guigs offers a lot options in this area. Cheers, S.
participants (2)
-
John Velman
-
Sven Panne