next up previous index
Next: Options Up: Basic data types and Previous: Floating-point numbers   Index

Characters

In character.cecil:

abstract object character isa ordered_hashable[character];
signature char_code(character):int;
method if_char(c@:character, if_yes:&(char):`T, if_no:&():`T):T;
method if_char(c@:character, if_yes:&(char):void):void;
method as_char(c@:character):char;
method is_char(c@:character):bool;
method =(l@:character,r@:character):bool;
method <(l@:character,r@:character):bool;
method <=(l@:character,r@:character):bool;
method hash(c@:character, range:int):int;
extend char isa character;
method char_code(c@:char):int;
method if_char(c@:char, if_yes:&(char):`T, if_no:&():`T):T;
method from_ascii(i@:int):char;
method from_ascii(i@:int, if_error:&():char):char;
method ascii_code(c@:char):int;  - convert between characters and integer ASCII codes
method is_lower_case(c@:char):bool;
method is_upper_case(c@:char):bool;
method is_letter(c@:char):bool;
method is_digit(c@:char):bool;
method is_digit(c@:char, base:int):bool;
method is_octal_digit(c@:char):bool;
method is_hex_digit(c@:char):bool;
method is_alphanumeric(c@:char):bool;
method is_printable(c@:char):bool;
method as_string(c@:char):string;  - convert to a string of a single character
method to_lower_case(c@:char):char;
method to_upper_case(c@:char):char;
method parse_as_int(c@:char):int;
method parse_as_int(c@:char, base:int):int;
method parse_as_int(c@:char, fail@:&():int):int;
method parse_as_int(c@:char, base:int, fail@:&():int):int;
method print_string(c@:char):string;
Cecil characters are pretty standard. The parse_as_int methods convert digits (such as '0' ... '9') to integer equivalents.

In unicode.cecil:

template object unicode_char isa character;
  field char_code(@:unicode_char):int;
  method from_unicode(code:int):character;
  method print_string(c@:unicode_char):string;
Representation and operations for UNICODE 2-byte characters. Any characters in the ASCII range are represented as regular characters, though.


next up previous index
Next: Options Up: Basic data types and Previous: Floating-point numbers   Index

Cecil/Vortex Project