From 5cc2947143f2a6ebd4ef1ae4d25ab956b87de808 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Tue, 21 Jul 2026 21:27:03 +0200 Subject: Redefine strings as slice of constant characters --- source/common.elna | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/common.elna') diff --git a/source/common.elna b/source/common.elna index b6f85f1..1bdfa1f 100644 --- a/source/common.elna +++ b/source/common.elna @@ -17,7 +17,7 @@ type proc write*(fd: Int; buf: Pointer; Word: Int): Int extern -proc write_s*(value: String) +proc write_s*(value: []const Char) begin (* fwrite(cast(value.ptr: Pointer), value.length, 1u, stdout) *) write(1, cast(value.ptr: Pointer), cast(value.length: Int)) @@ -78,7 +78,7 @@ begin return nil (* Returns true or false depending whether two strings are equal. *) -proc string_compare*(lhs_pointer: ^Char; lhs_length: Word; rhs_pointer: String): Bool +proc string_compare*(lhs_pointer: ^Char; lhs_length: Word; rhs_pointer: []const Char): Bool var result: Bool begin -- cgit v1.2.3