From 1a77126f4b27f3389dd7c6354d81ce607f4a7d13 Mon Sep 17 00:00:00 2001 From: Seggan Date: Thu, 28 Dec 2023 12:20:05 -0500 Subject: [PATCH] Rename `paths#list` to `paths#listDir` --- docs/lang/std/paths.papyri | 2 +- .../io/github/seggan/metis/runtime/intrinsics/NativeLibrary.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/lang/std/paths.papyri b/docs/lang/std/paths.papyri index bf3e28c..0734521 100644 --- a/docs/lang/std/paths.papyri +++ b/docs/lang/std/paths.papyri @@ -54,7 +54,7 @@ Returns a boolean value indicating whether the given path is hidden. @h3 { isSymlink(path: string): boolean } Returns a boolean value indicating whether the given path is a symbolic link. -@h3 { list(path: string): list\[string\] } +@h3 { listDir(path: string): list\[string\] } Returns a list of the files and directories in the given directory. @h3 { move(from: string, to: string): null } diff --git a/metis-lang/src/main/kotlin/io/github/seggan/metis/runtime/intrinsics/NativeLibrary.kt b/metis-lang/src/main/kotlin/io/github/seggan/metis/runtime/intrinsics/NativeLibrary.kt index f4412d4..457fd10 100644 --- a/metis-lang/src/main/kotlin/io/github/seggan/metis/runtime/intrinsics/NativeLibrary.kt +++ b/metis-lang/src/main/kotlin/io/github/seggan/metis/runtime/intrinsics/NativeLibrary.kt @@ -134,7 +134,7 @@ object PathLib : NativeLibrary("__path") { lib["fileName"] = pathFunction { it.fileName.toString().metisValue() } lib["root"] = pathFunction { it.root.toString().metisValue() } lib["isAbsolute"] = pathFunction { it.isAbsolute.metisValue() } - lib["list"] = pathFunction { path -> + lib["listDir"] = pathFunction { path -> val list = Value.List() path.toFile().listFiles()?.forEach { list.add(it.absolutePath.metisValue())