Character codes: Difference between revisions

(added slate language)
Line 149:
<lang fortran>WRITE(*,*) ACHAR(97), IACHAR("a")
WRITE(*,*) CHAR(97), ICHAR("a")</lang>
 
=={{header|Haskell}}==
Groovy does not have a character literal at all, so one-character strings have to be ''coerced'' to '''char'''. Groovy '''printf''' (like Java, but unlike C) is ''not type-agnostic'', so the cast from '''char''' to '''int''' is also required. The reverse direction is considerably simpler.
<lang groovy>printf ("%d\n", ('a' as char) as int)
printf ("%c\n", 97)</lang>
 
=={{header|Haskell}}==
Anonymous user