iyi

Prelude, 0.18.0

Char

One character - a byte, in this prelude, which reads its strings as ASCII.

In the prelude: every iyi program has it, with no import.

Charstruct

Chariyi doc Char
struct Char < Value

  def !=(other : Char) : Bool

  # The character *other* code points on: what `'a'..'z'` steps by. `chr`
  # refuses a surrogate too, where `'\u{D7FF}' + 1` was U+D800.
  def +(other : Int32) : Char

  def <(other : Char) : Bool

  def <=(other : Char) : Bool

  def ==(other : Char) : Bool

  def >(other : Char) : Bool

  def >=(other : Char) : Bool

  def alphanumeric? : Bool

  def bytesize : Int32

  def digit? : Bool

  # `0x10FFFF` is the last code point there is; past it a `'?'` goes out
  # rather than a sequence no reader can decode. `String::Builder` writes
  # these too, which had its own copy of the four arms.
  def each_byte(& : (UInt8 -> Nil)) : Nil

  def hash : Int32

  def inspect : String

  # Itself as `inspect` writes it between *quote*s, the other library's
  # escapes; not `printable?`, as `\u` and hex. `'\''` was `'''`.
  def inspect_into(io : String::Builder, quote : Char) : String::Builder

  # The classes a word counter asks about, ASCII's: a letter is one of the
  # fifty-two, a digit one of the ten. Whitespace is the other library's:
  # the space and `\t` to `\r`, and above ASCII Unicode's Zs, Zl and Zp, so
  # U+00A0 and U+3000 are and U+0085, a control, is not. It was ASCII's.
  def letter? : Bool

  def ord : Int32

  # Not a control (Cc), format (Cf) or private-use (Co) character of
  # Unicode 15, nor whitespace but the space: the other library's.
  def printable? : Bool

  def to_s : String

  def whitespace? : Bool
end