Carp/core/Char.carp

30 lines
601 B
Plaintext
Raw Normal View History

2018-01-24 18:08:18 +03:00
(system-include "carp_char.h")
2018-01-24 17:53:18 +03:00
2017-06-26 12:15:03 +03:00
(defmodule Char
2017-11-29 17:28:21 +03:00
(register = (Fn [Char Char] Bool))
(register to-int (Fn [Char] Int))
(register from-int (Fn [Int] Char))
(register copy (Fn [&Char] Char))
(defn meaning [char-ref]
(cond
(= @char-ref \0) 0
(= @char-ref \1) 1
(= @char-ref \2) 2
(= @char-ref \3) 3
(= @char-ref \4) 4
(= @char-ref \5) 5
(= @char-ref \6) 6
(= @char-ref \7) 7
(= @char-ref \8) 8
(= @char-ref \9) 9
-1))
(defn /= [a b]
(not (= (the Char a) b)))
)
(defmodule CharRef
(defn = [a b]
(Char.= @a @b)))