aboutsummaryrefslogtreecommitdiff
path: root/source/lux/data/char.lux
diff options
context:
space:
mode:
Diffstat (limited to 'source/lux/data/char.lux')
-rw-r--r--source/lux/data/char.lux25
1 files changed, 13 insertions, 12 deletions
diff --git a/source/lux/data/char.lux b/source/lux/data/char.lux
index 5a811c006..b7b4c6bda 100644
--- a/source/lux/data/char.lux
+++ b/source/lux/data/char.lux
@@ -1,21 +1,22 @@
-## Copyright (c) Eduardo Julian. All rights reserved.
-## The use and distribution terms for this software are covered by the
-## Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
-## which can be found in the file epl-v10.html at the root of this distribution.
-## By using this software in any fashion, you are agreeing to be bound by
-## the terms of this license.
-## You must not remove this notice, or any other, from this software.
+## Copyright (c) Eduardo Julian. All rights reserved.
+## This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+## If a copy of the MPL was not distributed with this file,
+## You can obtain one at http://mozilla.org/MPL/2.0/.
(;import lux
- (.. (eq #as E)
- (show #as S)
- (text #as T #open ("text:" Text/Monoid))))
+ (lux/control (eq #as E)
+ (show #as S))
+ (.. (text #as T #open ("text:" Text/Monoid))))
## [Structures]
(defstruct #export Char/Eq (E;Eq Char)
- (def (E;= x y)
+ (def (= x y)
(_jvm_ceq x y)))
(defstruct #export Char/Show (S;Show Char)
- (def (S;show x)
+ (def (show x)
($ text:++ "#\"" (_jvm_invokevirtual "java.lang.Object" "toString" [] x []) "\"")))
+
+(def #export (->text c)
+ (-> Char Text)
+ (_jvm_invokevirtual "java.lang.Object" "toString" [] c []))