Skip to content

Commit 6b91883

Browse files
committed
Support generating unique uninterned symbols.
1 parent cd2ee18 commit 6b91883

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Sources/LispKit/Compiler/EvalError.swift

+3
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ public enum EvalError: Int, Hashable, Codable {
197197
case urlAuthorityError
198198
case urlPrototypeInvalid
199199
case cannotCreatePdf
200+
case cannotLoadPdf
200201
case invalidPDFAccessIdentifier
201202
case invalidPDFDocGenerationOption
202203
case unknownPDFAnnotationType
@@ -555,6 +556,8 @@ public enum EvalError: Int, Hashable, Codable {
555556
return "$0 is not a valid URL prototype for procedure $,1"
556557
case .cannotCreatePdf:
557558
return "cannot create pdf document from bytevector $0"
559+
case .cannotLoadPdf:
560+
return "cannot load pdf document from file $0"
558561
case .invalidPDFAccessIdentifier:
559562
return "invalid PDF access permission identifier: $0"
560563
case .invalidPDFDocGenerationOption:

Sources/LispKit/Primitives/DrawingLibrary_iOS.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2478,6 +2478,6 @@ extension UIFont {
24782478
}
24792479

24802480
private var traits: [UIFontDescriptor.TraitKey: Any] {
2481-
return fontDescriptor.object(forKey: .traits) as? [UIFontDescriptor.TraitKey: Any] ?? [:]
2481+
return fontDescriptor.object(forKey: .traits) as? [UIFontDescriptor.TraitKey: Any] ?? [:]
24822482
}
24832483
}

Sources/LispKit/Runtime/SymbolTable.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public final class SymbolTable: Sequence {
329329
}
330330

331331
/// Generates a new interned symbol.
332-
public func gensym(_ basename: String) -> Symbol {
332+
public func gensym(_ basename: String, intern: Bool = true) -> Symbol {
333333
self.gensymLock.lock()
334334
defer {
335335
self.gensymLock.unlock()
@@ -339,7 +339,7 @@ public final class SymbolTable: Sequence {
339339
ident = basename + String(self.gensymCounter)
340340
self.gensymCounter &+= 1
341341
} while self.exists(ident)
342-
return self.intern(ident)
342+
return intern ? self.intern(ident) : Symbol(uninterned: ident)
343343
}
344344

345345
/// Generates an interned symbol by concatenating `prefix` and `sym`.

0 commit comments

Comments
 (0)