Implement zero for Char.

This commit is contained in:
Jorge Acereda 2019-06-14 13:02:03 +02:00
parent 8550f0e243
commit c76177dfa7
2 changed files with 4 additions and 1 deletions

View File

@ -45,6 +45,9 @@
(doc alphanum? "tests whether a character is alphanumerical.")
(defn alphanum? [c]
(or (alpha? c) (num? c)))
(defn zero []
(from-int 0))
)
(defmodule CharRef

View File

@ -51,7 +51,7 @@
(let [f (IO.fopen filename "rb")]
(if (null? f)
(Result.Error (fmt "File “%s” couldnt be opened!" filename))
(let [c (Char.from-int 0)
(let [c (zero)
r []]
(do
(while (do (set! c (IO.fgetc f))