generic types, any -> opaque

This commit is contained in:
2026-07-17 11:44:05 +02:00
parent af08d1888a
commit 1471c229c2
20 changed files with 284 additions and 167 deletions

View File

@@ -117,19 +117,19 @@ func os.is_a_directory[path: str] : bool
return (mem.read32(st + 24) & S_IFMT) == S_IFDIR
func os.list_directory[path: str] : Array, bool
func os.list_directory[path: str] : Array<str>, bool
fd := _builtin_syscall(SYS_openat, AT_FDCWD, path, O_RDONLY, 0)
if fd < 0
return 0 as Array, false
return 0 as Array<str>, false
files := []
files := [] as Array<str>
buf := _stackalloc(1024)
while true
n := _builtin_syscall(SYS_getdents64, fd, buf, 1024)
if n < 0
files->free_with_items()
_builtin_syscall(SYS_close, fd)
return 0 as Array, false
return 0 as Array<str>, false
else if n == 0
break