ATSLIB/prelude/char

This package contains various functions on (signed) chars and unsigned chars.


  • g0ofg1_char
  • g1ofg0_char
  • add_char0_int0
  • sub_char0_int0
  • sub_char0_char0
  • lt_char0_char0
  • lt_char1_char1
  • lte_char0_char0
  • lte_char1_char1
  • gt_char0_char0
  • gt_char1_char1
  • gte_char0_char0
  • gte_char1_char1
  • eq_char0_char0
  • eq_char1_char1
  • neq_char0_char0
  • neq_char1_char1
  • compare_char0_char0
  • compare_char1_char1
  • print_char
  • prerr_char
  • fprint_char
  • isalpha
  • isalpha_int
  • isalpha_char
  • isalnum
  • isalnum_int
  • isalnum_char
  • isascii
  • isascii_int
  • isascii_char
  • isblank
  • isblank_int
  • isblank_char
  • isspace
  • isspace_int
  • isspace_char
  • iscntrl
  • iscntrl_int
  • iscntrl_char
  • isdigit
  • isdigit_int
  • isdigit_char
  • isxdigit
  • isxdigit_int
  • isxdigit_char
  • isgraph
  • isgraph_int
  • isgraph_char
  • isprint
  • isprint_int
  • isprint_char
  • ispunct
  • ispunct_int
  • ispunct_char
  • islower
  • islower_int
  • islower_char
  • isupper
  • isupper_int
  • isupper_char
  • toascii
  • tolower
  • tolower_int
  • tolower_char
  • toupper
  • toupper_int
  • toupper_char
  • int2digit
  • int2xdigit
  • int2xxdigit
  • Overloaded Symbols
  • g0ofg1
  • g1ofg0
  • +
  • -
  • <
  • <=
  • >
  • >=
  • =
  • !=
  • compare
  • iseqz
  • isneqz
  • print
  • prerr
  • fprint

  • g0ofg1_char

    Synopsis

    castfn g0ofg1_char (c: Char):<> char

    g1ofg0_char

    Synopsis

    castfn g1ofg0_char (c: char):<> Char

    add_char0_int0

    Synopsis

    fun add_char0_int0
      (c: char, i: int):<> char = "mac#%"

    sub_char0_int0

    Synopsis

    fun sub_char0_int0
      (c: char, i: int):<> char = "mac#%"

    sub_char0_char0

    Synopsis

    fun sub_char0_char0
      (c1: char, c2: char):<> int = "mac#%"

    lt_char0_char0

    Synopsis

    fun lt_char0_char0
      (c1: char, c2: char):<> bool = "mac#%"

    Description

    This function returns true if and only if the ascii code of its first argument is less than that of its second argument.

    lt_char1_char1

    Synopsis

    fun
    lt_char1_char1 {c1,c2:int}
      (c1: char (c1), c2: char (c2)):<> bool (c1 < c2) = "mac#%"

    Description

    This function does the same as lt_char0_char0 but it is assigned a more informative type.

    lte_char0_char0

    Synopsis

    fun lte_char0_char0
      (c1: char, c2: char):<> bool = "mac#%"

    Description

    This function returns true if and only if the ascii code of its first argument is less than or equal to that of its second argument.

    lte_char1_char1

    Synopsis

    fun
    lte_char1_char1 {c1,c2:int}
      (c1: char (c1), c2: char (c2)):<> bool (c1 <= c2) = "mac#%"

    Description

    This function does the same as lte_char0_char0 but it is assigned a more informative type.

    gt_char0_char0

    Synopsis

    fun gt_char0_char0
      (c1: char, c2: char):<> bool = "mac#%"

    Description

    This function returns true if and only if the ascii code of its first argument is greater than that of its second argument.

    gt_char1_char1

    Synopsis

    fun
    gt_char1_char1 {c1,c2:int}
      (c1: char (c1), c2: char (c2)):<> bool (c1 > c2) = "mac#%"

    Description

    This function does the same as gt_char0_char0 but it is assigned a more informative type.

    gte_char0_char0

    Synopsis

    fun gte_char0_char0
      (c1: char, c2: char):<> bool = "mac#%"

    Description

    This function returns true if and only if the ascii code of its first argument is greater than or equal to that of its second argument.

    gte_char1_char1

    Synopsis

    fun
    gte_char1_char1 {c1,c2:int}
      (c1: char (c1), c2: char (c2)):<> bool (c1 >= c2) = "mac#%"

    Description

    This function does the same as gte_char0_char0 but it is assigned a more informative type.

    eq_char0_char0

    Synopsis

    fun eq_char0_char0
      (c1: char, c2: char):<> bool = "mac#%"

    Description

    This function returns true if and only if the ascii code of its first argument is equal to that of its second argument.

    eq_char1_char1

    Synopsis

    fun
    eq_char1_char1 {c1,c2:int}
      (c1: char (c1), c2: char (c2)):<> bool (c1 == c2) = "mac#%"

    Description

    This function does the same as eq_char0_char0 but it is assigned a more informative type.

    neq_char0_char0

    Synopsis

    fun neq_char0_char0
      (c1: char, c2: char):<> bool = "mac#%"

    Description

    This function returns true if and only if the ascii code of its first argument is unequal to that of its second argument.

    neq_char1_char1

    Synopsis

    fun
    neq_char1_char1 {c1,c2:int}
      (c1: char (c1), c2: char (c2)):<> bool (c1 != c2) = "mac#%"

    Description

    This function does the same as neq_char0_char0 but it is assigned a more informative type.

    compare_char0_char0

    Synopsis

    fun compare_char0_char0
      (c1: char, c2: char):<> int = "mac#%"

    Description

    This function returns ~1, 0, and 1 if if the ascii code of its first argument is less than, equal to, and greater than that of its second argument.

    compare_char1_char1

    Synopsis

    fun compare_char1_char1
      {c1,c2:int}
      (c1: char c1, c2: char c2) :<> int (c1-c2) = "mac#%"

    Description

    This function does the same as compare_char0_char0 but it is assigned a more informative type.

    print_char

    Synopsis

    fun print_char (x: char): void = "mac#%"

    prerr_char

    Synopsis

    fun prerr_char (x: char): void = "mac#%"

    fprint_char

    Synopsis

    fun fprint_char : fprint_type (char) = "mac#%"

    isalpha

    Synopsis

    overload isalpha with isalpha_int of 0
    overload isalpha with isalpha_char of 0

    isalpha_int

    Synopsis

    fun isalpha_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function isalpha.

    isalpha_char

    Synopsis

    fun isalpha_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of isalpha_int.

    isalnum

    Synopsis

    overload isalnum with isalnum_int of 0
    overload isalnum with isalnum_char of 0

    isalnum_int

    Synopsis

    fun isalnum_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function isalnum.

    isalnum_char

    Synopsis

    fun isalnum_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of isalnum_int.

    isascii

    Synopsis

    overload isascii with isascii_int of 0
    overload isascii with isascii_char of 0

    isascii_int

    Synopsis

    fun isascii_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function isascii.

    isascii_char

    Synopsis

    fun isascii_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of isascii_int.

    isblank

    Synopsis

    overload isblank with isblank_int of 0
    overload isblank with isblank_char of 0

    isblank_int

    Synopsis

    fun isblank_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function isblank.

    isblank_char

    Synopsis

    fun isblank_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of isblank_int.

    isspace

    Synopsis

    overload isspace with isspace_int of 0
    overload isspace with isspace_char of 0

    isspace_int

    Synopsis

    fun isspace_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function isspace.

    isspace_char

    Synopsis

    fun isspace_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of isspace_int.

    iscntrl

    Synopsis

    overload iscntrl with iscntrl_int of 0
    overload iscntrl with iscntrl_char of 0

    iscntrl_int

    Synopsis

    fun iscntrl_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function iscntrl.

    iscntrl_char

    Synopsis

    fun iscntrl_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of iscntrl_int.

    isdigit

    Synopsis

    overload isdigit with isdigit_int of 0
    overload isdigit with isdigit_char of 0

    isdigit_int

    Synopsis

    fun isdigit_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function isdigit.

    isdigit_char

    Synopsis

    fun isdigit_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of isdigit_int.

    isxdigit

    Synopsis

    overload isxdigit with isxdigit_int of 0
    overload isxdigit with isxdigit_char of 0

    isxdigit_int

    Synopsis

    fun isxdigit_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function isxdigit.

    isxdigit_char

    Synopsis

    fun isxdigit_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of isxdigit_int.

    isgraph

    Synopsis

    overload isgraph with isgraph_int of 0
    overload isgraph with isgraph_char of 0

    isgraph_int

    Synopsis

    fun isgraph_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function isgraph.

    isgraph_char

    Synopsis

    fun isgraph_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of isgraph_int.

    isprint

    Synopsis

    overload isprint with isprint_int of 0
    overload isprint with isprint_char of 0

    isprint_int

    Synopsis

    fun isprint_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function isprint.

    isprint_char

    Synopsis

    fun isprint_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of isprint_int.

    ispunct

    Synopsis

    overload ispunct with ispunct_int of 0
    overload ispunct with ispunct_char of 0

    ispunct_int

    Synopsis

    fun ispunct_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function ispunct.

    ispunct_char

    Synopsis

    fun ispunct_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of ispunct_int.

    islower

    Synopsis

    overload islower with islower_int of 0
    overload islower with islower_char of 0

    islower_int

    Synopsis

    fun islower_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function islower.

    islower_char

    Synopsis

    fun islower_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of islower_int.

    isupper

    Synopsis

    overload isupper with isupper_int of 0
    overload isupper with isupper_char of 0

    isupper_int

    Synopsis

    fun isupper_int (c: int):<> bool = "mac#%"

    Description

    This function directly corresponds to the libc-function isupper.

    isupper_char

    Synopsis

    fun isupper_char (c: char):<> bool = "mac#%"

    Description

    This function is a slight variant of isupper_int.

    toascii

    Synopsis

    fun toascii (c: int):<> int = "mac#%"

    Description

    This function directly corresponds to the libc-function toascii.

    tolower

    Synopsis

    overload tolower with tolower_int
    overload tolower with tolower_char

    tolower_int

    Synopsis

    fun tolower_int (c: int):<> int = "mac#%"

    Description

    This function directly corresponds to the libc-function tolower.

    tolower_char

    Synopsis

    fun tolower_char (c: char):<> char = "mac#%"

    Description

    This function is a slight variant of tolower_int.

    toupper

    Synopsis

    overload toupper with toupper_int
    overload toupper with toupper_char

    toupper_int

    Synopsis

    fun toupper_int (c: int):<> int = "mac#%"

    Description

    This function directly corresponds to the libc-function toupper.

    toupper_char

    Synopsis

    fun toupper_char (c: char):<> char = "mac#%"

    Description

    This function is a slight variant of toupper_int.

    int2digit

    Synopsis

    fun int2digit (i: intBtw(0, 10)): char = "mac#%"

    Description

    This function turns a single decimal digit integer into the character representing it.

    int2xdigit

    Synopsis

    fun int2xdigit (i: intBtw(0, 16)): char = "mac#%"

    Description

    This function turns a single hexadecimal digit integer into the (lowercase) character representing it.

    int2xxdigit

    Synopsis

    fun int2xxdigit (i: intBtw(0, 16)): char = "mac#%"

    Description

    This function turns a single hexadecimal digit integer into the (uppercase) character representing it.

    Overloaded Symbols


    g0ofg1

    Synopsis

    overload g0ofg1 with g0ofg1_char // index-erasing

    g1ofg0

    Synopsis

    overload g1ofg0 with g1ofg0_char // index-inducing

    +

    Synopsis

    overload + with add_char0_int0 of 0

    -

    Synopsis

    overload - with sub_char0_int0 of 0
    overload - with sub_char0_char0 of 0

    <

    Synopsis

    overload < with lt_char0_char0 of 0
    overload < with lt_char1_char1 of 20
    overload < with lt_uchar0_uchar0 of 0
    overload < with lt_uchar1_uchar1 of 20

    <=

    Synopsis

    overload <= with lte_char0_char0 of 0
    overload <= with lte_char1_char1 of 20
    overload <= with lte_uchar0_uchar0 of 0
    overload <= with lte_uchar1_uchar1 of 20

    >

    Synopsis

    overload > with gt_char0_char0 of 0
    overload > with gt_char1_char1 of 20
    overload > with gt_uchar0_uchar0 of 0
    overload > with gt_uchar1_uchar1 of 20

    >=

    Synopsis

    overload >= with gte_char0_char0 of 0
    overload >= with gte_char1_char1 of 20
    overload >= with gte_uchar0_uchar0 of 0
    overload >= with gte_uchar1_uchar1 of 20

    =

    Synopsis

    overload = with eq_char0_char0 of 0
    overload = with eq_char1_char1 of 20
    overload = with eq_char0_int0 of 0
    overload = with eq_int0_char0 of 0
    overload = with eq_uchar0_uchar0 of 0
    overload = with eq_uchar1_uchar1 of 20

    !=

    Synopsis

    overload != with neq_char0_char0 of 0
    overload != with neq_char1_char1 of 20
    overload != with neq_char0_int0 of 0
    overload != with neq_int0_char0 of 0
    overload != with neq_uchar0_uchar0 of 0
    overload != with neq_uchar1_uchar1 of 20

    compare

    Synopsis

    overload compare with compare_char0_char0 of 0
    overload compare with compare_char1_char1 of 20
    overload compare with compare_char0_int0
    overload compare with compare_int0_char0
    overload compare with compare_uchar0_uchar0 of 0
    overload compare with compare_uchar1_uchar1 of 20

    iseqz

    Synopsis

    overload iseqz with char0_iseqz of 0
    overload iseqz with char1_iseqz of 10

    isneqz

    Synopsis

    overload isneqz with char0_isneqz of 0
    overload isneqz with char1_isneqz of 10

    print

    Synopsis

    overload print with print_char
    overload print with print_schar
    overload print with print_uchar

    prerr

    Synopsis

    overload prerr with prerr_char
    overload prerr with prerr_schar
    overload prerr with prerr_uchar

    fprint

    Synopsis

    overload fprint with fprint_char
    overload fprint with fprint_schar
    overload fprint with fprint_uchar

    This page is created with ATS by Hongwei Xi and also maintained by Hongwei Xi. SourceForge.net Logo