mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 13:37:57 +03:00
Implement zero for Char.
This commit is contained in:
parent
8550f0e243
commit
c76177dfa7
@ -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
|
||||
|
@ -51,7 +51,7 @@
|
||||
(let [f (IO.fopen filename "rb")]
|
||||
(if (null? f)
|
||||
(Result.Error (fmt "File “%s” couldn’t be opened!" filename))
|
||||
(let [c (Char.from-int 0)
|
||||
(let [c (zero)
|
||||
r []]
|
||||
(do
|
||||
(while (do (set! c (IO.fgetc f))
|
||||
|
Loading…
Reference in New Issue
Block a user