From 89a907ddd0b7f6b888c61d54e3e41a8cee00b971 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 20 Feb 2024 02:18:36 +0200 Subject: expand type expansion --- examples/std.ek | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples/std.ek') diff --git a/examples/std.ek b/examples/std.ek index f9eb58c..dbf3a8c 100644 --- a/examples/std.ek +++ b/examples/std.ek @@ -92,6 +92,10 @@ pub typedef string { *i9 buf; } +pub define string(s) { + {.len = sizeof(s), .buf = s} as string; +} + /* result import */ pub typedef result[any T] { *i9 err; @@ -116,7 +120,7 @@ pub define fmt[] { str(*fmt p => string) { /* is this a loop? allowed? */ /* alternative would be {.len = 0, .buf = ""} as string I guess*/ - const r = p.fmt("".str()); + const r = p.fmt(string!("")); if r.err() { abort("error converting to string"); } -- cgit v1.3