
On 03 February 2006 00:40, John Meacham wrote:
On Thu, Feb 02, 2006 at 06:19:43PM -0600, Taral wrote:
Got a unicode-compliant compiler?
sure do :)
but it currently doesn't recognize any unicode characters as possible operators. which it should, but I am just not sure how to specify that yet until some sort of standard develops. Once there are more unicode compliant compilers out there something will evolve probably. Right now I am thinking of being able to add a PRAGMA to force some characters to be interpreted as operators just so that they can start being used now, even though there isn't a standard set you can count on yet.
GHC treats the Unicode categories Sm, Sc, Sk and So as symbols, FWIW. These are the same characters for which Data.Char.isSymbol returns True. How do you implement the Data.Char predicates in jhc, BTW? Cheers, Simon

On Fri, Feb 03, 2006 at 01:43:15PM -0000, Simon Marlow wrote:
GHC treats the Unicode categories Sm, Sc, Sk and So as symbols, FWIW. These are the same characters for which Data.Char.isSymbol returns True.
cool. I will try to make jhc do the same thing.
How do you implement the Data.Char predicates in jhc, BTW?
for now just via the following ffi call: (though the plain 'module Char' just uses the report definitions for now)
newtype CType = CType Int
-- | Get a ctype other than one of the defaults.
ctype :: String -> IO CType ctype s = withCString s >>= c_wctype
t_alnum, t_alpha, t_blank, t_cntrl, t_digit, t_graph, t_lower, t_print, t_punct, t_space, t_upper, t_xdigit, t_none :: CType
t_alnum = unsafePerformIO (ctype "alnum") t_alpha = unsafePerformIO (ctype "alpha") t_blank = unsafePerformIO (ctype "blank") t_cntrl = unsafePerformIO (ctype "cntrl") t_digit = unsafePerformIO (ctype "digit") t_graph = unsafePerformIO (ctype "graph") t_lower = unsafePerformIO (ctype "lower") t_print = unsafePerformIO (ctype "print") t_punct = unsafePerformIO (ctype "punct") t_space = unsafePerformIO (ctype "space") t_upper = unsafePerformIO (ctype "upper") t_xdigit = unsafePerformIO (ctype "xdigit") t_none = CType 0
foreign import ccall "wctype.h iswctype" c_iswctype :: Char -> CType -> IO Int foreign import ccall "wctype.h wctype" c_wctype :: CString -> IO CType
John -- John Meacham - ⑆repetae.net⑆john⑈
participants (2)
-
John Meacham
-
Simon Marlow