Skip to content

Commit 7497a57

Browse files
committed
Let LispKit clients override LispKit library implementations.
1 parent c63c569 commit 7497a57

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Sources/LispKit/Runtime/FileHandler.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ public final class FileHandler {
8181
return true
8282
}
8383

84+
public func prependSearchPath(_ path: String) -> Bool {
85+
guard self.isDirectory(atPath: path) else {
86+
return false
87+
}
88+
self.searchUrls.insert(URL(fileURLWithPath: path, isDirectory: true), at: 0)
89+
return true
90+
}
91+
8492
public func addLibrarySearchPath(_ path: String) -> Bool {
8593
guard self.isDirectory(atPath: path) else {
8694
return false
@@ -89,6 +97,14 @@ public final class FileHandler {
8997
return true
9098
}
9199

100+
public func prependLibrarySearchPath(_ path: String) -> Bool {
101+
guard self.isDirectory(atPath: path) else {
102+
return false
103+
}
104+
self.librarySearchUrls.insert(URL(fileURLWithPath: path, isDirectory: true), at: 0)
105+
return true
106+
}
107+
92108
public func filePath(forFile name: String, relativeTo root: String? = nil) -> String? {
93109
return self.searchFile(withName: name,
94110
ofType: "scm",

0 commit comments

Comments
 (0)