From 86d59abfbcdd6ea99ab68d04e04d263c04ca734f Mon Sep 17 00:00:00 2001 From: sergeych Date: Sat, 31 May 2025 23:44:07 +0400 Subject: [PATCH] missed file --- .../kotlin/net/sergeych/ling/ObjChar.kt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 library/src/commonMain/kotlin/net/sergeych/ling/ObjChar.kt diff --git a/library/src/commonMain/kotlin/net/sergeych/ling/ObjChar.kt b/library/src/commonMain/kotlin/net/sergeych/ling/ObjChar.kt new file mode 100644 index 0000000..733bce5 --- /dev/null +++ b/library/src/commonMain/kotlin/net/sergeych/ling/ObjChar.kt @@ -0,0 +1,19 @@ +package net.sergeych.ling + +class ObjChar(val value: Char): Obj() { + + override val objClass: ObjClass = type + + override suspend fun compareTo(context: Context, other: Obj): Int = + (other as? ObjChar)?.let { value.compareTo(it.value) } ?: -1 + + override fun toString(): String = value.toString() + + override fun inspect(): String = "'$value'" + + companion object { + val type = ObjClass("Char").apply { + addFn("code") { ObjInt(thisAs().value.code.toLong()) } + } + } +} \ No newline at end of file