From 8afe90549ece414e3159ca761e49b16246a697f1 Mon Sep 17 00:00:00 2001 From: escalant3 Date: Thu, 29 Oct 2026 13:31:55 +0100 Subject: [PATCH] feat: add HYPERLINK(url, [link_label]) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cell shows the label (or the URL) and is drawn as a link. On the Mac, ⌘-click opens it and right-click offers Open Link / Copy Link; on iPad the cell's long-press menu does. The URL is read from the cell's formula when needed, so values, XLSX and CSV are unchanged. Only http, https and mailto links open; a URL without a scheme gets http://. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 +- .../SpreadsheetCore/CalculationEngine.swift | 53 +++++++++++++++++++ Sources/SpreadsheetCore/FunctionsText.swift | 9 ++++ .../Mac/SpreadsheetGridView.swift | 12 +++-- Sources/SpreadsheetUI/Shared/Clipboard.swift | 10 ++++ .../SpreadsheetUI/Shared/GridController.swift | 22 ++++++++ .../SpreadsheetUI/Shared/GridRenderer.swift | 6 +++ Sources/SpreadsheetUI/Shared/Platform.swift | 14 +++++ Sources/SpreadsheetUI/iOS/GridView.swift | 3 +- .../CalculationEngineTests.swift | 30 +++++++++++ .../FunctionLogicalTextTests.swift | 10 ++++ Tests/SpreadsheetFilesTests/XLSXTests.swift | 14 +++++ .../SpreadsheetUITests/GridEditingTests.swift | 18 +++++++ docs/APP-STORE-LISTING.md | 4 +- docs/FUNCTIONS.md | 5 +- docs/PLAN.md | 2 +- docs/RESEARCH.md | 2 +- 17 files changed, 206 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7973839..c8c3a8e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A native spreadsheet app for the Mac and iPad, written entirely in Swift. Native file format is XLSX; CSV imports and exports. The formula engine covers Google Sheets' -core feature set — 157 functions, real coercion semantics, incremental +core feature set — 158 functions, real coercion semantics, incremental recalculation. The spreadsheet stack (model, formula engine, XLSX/ZIP/CSV I/O, grid) is built from scratch with no third-party libraries; the sole external dependency is [Sparkle](https://sparkle-project.org) for software updates @@ -158,7 +158,7 @@ cd iOS && xcodegen && open SimpleSpread.xcodeproj # the iPad app testing strategy, roadmap. - [docs/RESEARCH.md](docs/RESEARCH.md) — the feature-set research (formula semantics, XLSX internals, editing UX, CSV) the implementation follows. -- [docs/FUNCTIONS.md](docs/FUNCTIONS.md) — all 157 functions with semantics +- [docs/FUNCTIONS.md](docs/FUNCTIONS.md) — all 158 functions with semantics notes and known deviations. - [docs/PIVOTS.md](docs/PIVOTS.md) — using pivot tables: creating, the Fields panel, grouping, refreshing, and Excel features not supported. diff --git a/Sources/SpreadsheetCore/CalculationEngine.swift b/Sources/SpreadsheetCore/CalculationEngine.swift index b0e6c2c..79099de 100644 --- a/Sources/SpreadsheetCore/CalculationEngine.swift +++ b/Sources/SpreadsheetCore/CalculationEngine.swift @@ -423,6 +423,59 @@ public final class CalculationEngine { asts[addr] != nil || workbook.sheet(withID: addr.sheetID)?.cells[addr.address]?.formula != nil } + // MARK: Hyperlinks + + /// True if the cell's formula is a HYPERLINK call (the grid draws it as a link). + public func isHyperlink(at addr: AbsoluteAddress) -> Bool { + hyperlinkTarget(at: addr) != nil + } + + /// The URL a HYPERLINK formula at `addr` opens, or nil. Only a formula + /// whose outermost call is HYPERLINK is a link (as in Google Sheets); the + /// URL argument is evaluated in the cell's context, so it follows the + /// cells it reads. + public func hyperlinkURL(at addr: AbsoluteAddress) -> URL? { + guard let target = hyperlinkTarget(at: addr) else { return nil } + let context = EvalContext(workbook: workbook, sheetID: addr.sheetID, address: addr.address, clock: clock) + guard case .string(let text) = FormulaEvaluator.evaluate(target, context: context) else { return nil } + return Self.hyperlinkURL(from: text) + } + + /// A link's text as a URL a click may open: `http://` is assumed when + /// there's no scheme (as in Sheets), and only web and mail links are + /// allowed, so a workbook can't launch files or other apps. + public static func hyperlinkURL(from text: String) -> URL? { + let trimmed = text.trimmingCharacters(in: .whitespacesAndNewlines) + guard !trimmed.isEmpty, !trimmed.contains(where: \.isWhitespace) else { return nil } + let lower = trimmed.lowercased() + let hasScheme = ["http://", "https://", "mailto:"].contains { lower.hasPrefix($0) } + // Any other "scheme:" is refused rather than read as a host; a colon + // and digits after a host name are a port ("example.com:8080"). + if !hasScheme, let colon = lower.firstIndex(of: ":") { + let host = lower[.. FormulaExpr? { + var expr = asts[addr] + while let e = expr { + switch e { + case .paren(let inner), .definedName(_, let inner): expr = inner + case .function("HYPERLINK", let args) where !args.isEmpty: return args[0] + default: return nil + } + } + return nil + } + // MARK: Graph maintenance private func installFormula(_ text: String, at addr: AbsoluteAddress, replacing: Bool = true) { diff --git a/Sources/SpreadsheetCore/FunctionsText.swift b/Sources/SpreadsheetCore/FunctionsText.swift index a556fea..6827cca 100644 --- a/Sources/SpreadsheetCore/FunctionsText.swift +++ b/Sources/SpreadsheetCore/FunctionsText.swift @@ -235,6 +235,15 @@ enum TextFunctions { withTemplate: replacement) return .string(result) }, + // The label (or the URL); the grid opens the URL from the formula + // (CalculationEngine.hyperlinkURL). A number label stays a number. + .eager("HYPERLINK", min: 1, max: 2) { args, _ in + let url = try strArg(args[0]) + guard args.count > 1 else { return .string(url) } + let label = try args[1].toScalar() + if case .error(let e) = label { throw e } + return label.isEmpty ? .string(url) : label + }, ] private static func joinAll(_ args: [EvalValue], separator: String) throws -> String { diff --git a/Sources/SpreadsheetUI/Mac/SpreadsheetGridView.swift b/Sources/SpreadsheetUI/Mac/SpreadsheetGridView.swift index 38e8910..41f6bc9 100644 --- a/Sources/SpreadsheetUI/Mac/SpreadsheetGridView.swift +++ b/Sources/SpreadsheetUI/Mac/SpreadsheetGridView.swift @@ -97,6 +97,11 @@ final class SpreadsheetGridView: NSView, NSTextFieldDelegate { } window?.makeFirstResponder(self) let point = convert(event.locationInWindow, from: nil) + // ⌘-click opens a HYPERLINK cell; a plain click only selects it. + if event.modifierFlags.contains(.command), let url = controller.hyperlink(at: point) { + LinkOpener.open(url) + return + } let result = controller.press(at: point, extend: event.modifierFlags.contains(.shift), clickCount: event.clickCount) if case .showFilter(let columnOffset, let cell) = result { @@ -117,11 +122,12 @@ final class SpreadsheetGridView: NSView, NSTextFieldDelegate { // MARK: Context menu - /// Right-click on a chart (edit, copy, delete), or on a row/column - /// header (insert, delete, hide or unhide). + /// Right-click on a chart (edit, copy, delete), on a row/column + /// header (insert, delete, hide or unhide), or on a link cell (open, copy). override func menu(for event: NSEvent) -> NSMenu? { let point = convert(event.locationInWindow, from: nil) - guard let sections = controller.chartMenu(at: point) ?? controller.headerMenu(at: point) else { + let link = controller.hyperlink(at: point).map { [controller.linkMenuItems(for: $0)] } + guard let sections = controller.chartMenu(at: point) ?? controller.headerMenu(at: point) ?? link else { return nil } let menu = NSMenu() diff --git a/Sources/SpreadsheetUI/Shared/Clipboard.swift b/Sources/SpreadsheetUI/Shared/Clipboard.swift index 3bd1644..1227b0a 100644 --- a/Sources/SpreadsheetUI/Shared/Clipboard.swift +++ b/Sources/SpreadsheetUI/Shared/Clipboard.swift @@ -75,6 +75,16 @@ enum SystemPasteboard { #endif } + /// Plain text alone (a copied link). + static func write(text: String) { + #if os(macOS) + NSPasteboard.general.clearContents() + NSPasteboard.general.setString(text, forType: .string) + #else + UIPasteboard.general.string = text + #endif + } + /// A picture (a copied chart), as PNG. static func write(png: Data) { #if os(macOS) diff --git a/Sources/SpreadsheetUI/Shared/GridController.swift b/Sources/SpreadsheetUI/Shared/GridController.swift index cbf830f..70c068a 100644 --- a/Sources/SpreadsheetUI/Shared/GridController.swift +++ b/Sources/SpreadsheetUI/Shared/GridController.swift @@ -454,6 +454,28 @@ final class GridController { let action: () -> Void } + /// The URL of the HYPERLINK formula in the cell at a view point (the + /// top-left cell of a merge), or nil. + func hyperlink(at point: CGPoint) -> URL? { + guard document != nil else { return nil } + let geometry = self.geometry + guard geometry.region(at: point) == .cells, chart(at: point) == nil else { return nil } + return hyperlink(in: geometry.address(at: point)) + } + + /// The URL of the HYPERLINK formula in a cell of the active sheet, or nil. + func hyperlink(in address: CellAddress) -> URL? { + guard let document else { return nil } + let cell = document.activeSheet.mergedRange(containing: address)?.start ?? address + return document.engine.hyperlinkURL(at: AbsoluteAddress(sheetID: document.activeSheetID, address: cell)) + } + + /// "Open Link" and "Copy Link" for a link cell's context menu. + func linkMenuItems(for url: URL) -> [MenuItem] { + [MenuItem(title: "Open Link") { LinkOpener.open(url) }, + MenuItem(title: "Copy Link") { SystemPasteboard.write(text: url.absoluteString) }] + } + /// The menu for a right-click (or long press) on a row or column /// header: insert, delete, hide or unhide, in sections. Like Excel, /// pressing outside the current selection selects that row/column diff --git a/Sources/SpreadsheetUI/Shared/GridRenderer.swift b/Sources/SpreadsheetUI/Shared/GridRenderer.swift index f128885..8b330ea 100644 --- a/Sources/SpreadsheetUI/Shared/GridRenderer.swift +++ b/Sources/SpreadsheetUI/Shared/GridRenderer.swift @@ -544,6 +544,12 @@ struct GridRenderer { .foregroundColor: Self.textColor(for: style), ] if style.underline { attributes[.underlineStyle] = NSUnderlineStyle.single.rawValue } + // A HYPERLINK formula looks like a link unless the cell sets its own colour. + if cell.formula != nil, cell.value.errorValue == nil, + document.engine.isHyperlink(at: AbsoluteAddress(sheetID: document.activeSheetID, address: address)) { + attributes[.underlineStyle] = NSUnderlineStyle.single.rawValue + if style.textColor == nil { attributes[.foregroundColor] = SystemColors.link } + } if style.strikethrough { attributes[.strikethroughStyle] = NSUnderlineStyle.single.rawValue } let paragraph = NSMutableParagraphStyle() diff --git a/Sources/SpreadsheetUI/Shared/Platform.swift b/Sources/SpreadsheetUI/Shared/Platform.swift index 12f73d4..2c9d746 100644 --- a/Sources/SpreadsheetUI/Shared/Platform.swift +++ b/Sources/SpreadsheetUI/Shared/Platform.swift @@ -32,6 +32,7 @@ enum SystemColors { static var controlBackground: PlatformColor { .controlBackgroundColor } static var separator: PlatformColor { .separatorColor } static var accent: PlatformColor { .controlAccentColor } + static var link: PlatformColor { .linkColor } static var text: PlatformColor { .textColor } static var label: PlatformColor { .labelColor } static var secondaryLabel: PlatformColor { .secondaryLabelColor } @@ -42,6 +43,7 @@ enum SystemColors { static var controlBackground: PlatformColor { .systemBackground } static var separator: PlatformColor { .separator } static var accent: PlatformColor { .tintColor } + static var link: PlatformColor { .link } static var text: PlatformColor { .label } static var label: PlatformColor { .label } static var secondaryLabel: PlatformColor { .secondaryLabel } @@ -60,6 +62,18 @@ enum SystemColors { } } +/// Opening a link from a cell in the default browser or mail app. +@MainActor +enum LinkOpener { + static func open(_ url: URL) { + #if os(macOS) + NSWorkspace.shared.open(url) + #else + UIApplication.shared.open(url) + #endif + } +} + extension PlatformColor { /// A cell's stored colour. convenience init(rgba c: RGBAColor) { diff --git a/Sources/SpreadsheetUI/iOS/GridView.swift b/Sources/SpreadsheetUI/iOS/GridView.swift index 1feec1e..dd57133 100644 --- a/Sources/SpreadsheetUI/iOS/GridView.swift +++ b/Sources/SpreadsheetUI/iOS/GridView.swift @@ -671,7 +671,8 @@ extension GridView: UIContextMenuInteractionDelegate { if SpreadsheetDocument.pasteboardHasContent { clipboard.append(Item(title: "Paste") { [weak c] in c?.paste() }) } - return [ + let link = c.document.flatMap { c.hyperlink(in: $0.selection.activeCell) } + return (link.map { [c.linkMenuItems(for: $0)] } ?? []) + [ clipboard, [doc("Fill Down") { $0.fillDown() }, doc("Fill Right") { $0.fillRight() }, diff --git a/Tests/SpreadsheetCoreTests/CalculationEngineTests.swift b/Tests/SpreadsheetCoreTests/CalculationEngineTests.swift index 76145d0..90f3f4d 100644 --- a/Tests/SpreadsheetCoreTests/CalculationEngineTests.swift +++ b/Tests/SpreadsheetCoreTests/CalculationEngineTests.swift @@ -1,3 +1,4 @@ +import Foundation import Testing @testable import SpreadsheetCore @@ -331,4 +332,33 @@ struct WorkbookOperationTests { #expect(WorkbookOperations.translatedFormula("A1", byRows: -5, columns: 0) == "#REF!") #expect(WorkbookOperations.translatedFormula("1+", byRows: 1, columns: 0) == "1+") // unparseable unchanged } + + // MARK: Hyperlinks + + @Test func hyperlinkURLFollowsTheFormula() { + let h = Harness(cells: ["A1": "https://example.com/a", "B1": "=HYPERLINK(A1,\"Link\")", + "B2": "=(HYPERLINK(\"example.com:8080/x\"))", "B3": "=UPPER(HYPERLINK(A1))", + "B4": "=A1"]) + func url(_ a1: String) -> URL? { + h.engine.hyperlinkURL(at: AbsoluteAddress(sheetID: h.sheetID, address: CellAddress(a1: a1)!)) + } + #expect(url("B1")?.absoluteString == "https://example.com/a") + #expect(url("B2")?.absoluteString == "http://example.com:8080/x") // no scheme: http + #expect(url("B3") == nil) // HYPERLINK isn't the outermost call + #expect(url("B4") == nil) + #expect(url("A1") == nil) + #expect(h.engine.isHyperlink(at: AbsoluteAddress(sheetID: h.sheetID, address: CellAddress(a1: "B1")!))) + h.set("A1", "https://example.org/b") + #expect(url("B1")?.absoluteString == "https://example.org/b") + } + + @Test func hyperlinkURLAllowsOnlyWebAndMailLinks() { + #expect(CalculationEngine.hyperlinkURL(from: " HTTPS://example.com ")?.absoluteString == "HTTPS://example.com") + #expect(CalculationEngine.hyperlinkURL(from: "mailto:someone@example.com") != nil) + #expect(CalculationEngine.hyperlinkURL(from: "www.example.com")?.absoluteString == "http://www.example.com") + for refused in ["javascript:alert(1)", "file:///etc/passwd", "ftp://example.com", "tel:123", + "x-apple-reminder://", "", "two words", "https://"] { + #expect(CalculationEngine.hyperlinkURL(from: refused) == nil, "\(refused)") + } + } } diff --git a/Tests/SpreadsheetCoreTests/FunctionLogicalTextTests.swift b/Tests/SpreadsheetCoreTests/FunctionLogicalTextTests.swift index 9700de6..554eb45 100644 --- a/Tests/SpreadsheetCoreTests/FunctionLogicalTextTests.swift +++ b/Tests/SpreadsheetCoreTests/FunctionLogicalTextTests.swift @@ -70,6 +70,16 @@ struct LogicalFunctionTests { @Suite("Text functions") struct TextFunctionTests { + @Test func hyperlinkShowsItsLabel() { + #expect(evalString("HYPERLINK(\"https://example.com\",\"Example\")") == "Example") + #expect(evalString("HYPERLINK(\"https://example.com\")") == "https://example.com") + #expect(evalString("HYPERLINK(\"https://example.com\",A1)") == "https://example.com") // blank label + #expect(evalNumber("HYPERLINK(\"https://example.com\",42)") == 42) + #expect(evalError("HYPERLINK(1/0,\"x\")") == .div0) + #expect(evalError("HYPERLINK(\"https://example.com\",NA())") == .na) + #expect(evalString("HYPERLINK(A1,\"Docs\")", cells: ["A1": "example.com"]) == "Docs") + } + @Test func concatenateAndJoin() { #expect(evalString("CONCATENATE(\"a\",\"b\",1)") == "ab1") #expect(evalString("CONCAT(\"x\",\"y\")") == "xy") diff --git a/Tests/SpreadsheetFilesTests/XLSXTests.swift b/Tests/SpreadsheetFilesTests/XLSXTests.swift index 1c1404f..9ddddf8 100644 --- a/Tests/SpreadsheetFilesTests/XLSXTests.swift +++ b/Tests/SpreadsheetFilesTests/XLSXTests.swift @@ -54,6 +54,20 @@ struct XLSXRoundTripTests { } } + @Test func hyperlinkFormulaRoundTripsWithoutPrefix() throws { + let wb = Workbook.newDocument() + let engine = CalculationEngine(workbook: wb) + let addr = AbsoluteAddress(sheetID: wb.sheets[0].id, address: CellAddress(a1: "A1")!) + engine.setCellFormula("HYPERLINK(\"https://example.com\",\"Example\")", at: addr) + let data = try XLSXWriter.data(for: wb) + let xml = String(decoding: try ZipArchiveReader(data: data).contents(named: "xl/worksheets/sheet1.xml"), as: UTF8.self) + #expect(xml.contains("HYPERLINK")) + #expect(!xml.contains("_xlfn.HYPERLINK")) + let read = try roundTrip(wb) + #expect(read.sheets[0].cell(at: addr.address).formula == "HYPERLINK(\"https://example.com\",\"Example\")") + #expect(read.sheets[0].value(at: addr.address) == .string("Example")) + } + @Test func formulasRoundTripWithCachedValues() throws { let wb = Workbook.newDocument() let engine = CalculationEngine(workbook: wb) diff --git a/Tests/SpreadsheetUITests/GridEditingTests.swift b/Tests/SpreadsheetUITests/GridEditingTests.swift index 29714d3..1c278bf 100644 --- a/Tests/SpreadsheetUITests/GridEditingTests.swift +++ b/Tests/SpreadsheetUITests/GridEditingTests.swift @@ -27,6 +27,24 @@ struct GridEditingTests { keyCode: keyCode)! } + // MARK: Hyperlinks + + @Test func hyperlinkIsFoundUnderThePointer() { + let (doc, grid) = makeGrid() + doc.commitInput("=HYPERLINK(\"https://example.com\",\"Example\")", at: a("B2")) + doc.commitInput("plain", at: a("C2")) + let geometry = grid.controller.geometry + func center(_ a1: String) -> CGPoint { + let rect = geometry.cellRect(a(a1)) + return CGPoint(x: rect.midX, y: rect.midY) + } + #expect(grid.controller.hyperlink(at: center("B2"))?.absoluteString == "https://example.com") + #expect(grid.controller.hyperlink(at: center("C2")) == nil) + #expect(grid.controller.hyperlink(in: a("B2")) != nil) + #expect(grid.controller.linkMenuItems(for: URL(string: "https://example.com")!).map(\.title) + == ["Open Link", "Copy Link"]) + } + // MARK: The editor's target (#7) @Test func editCommitsToTheSheetItWasTypedOn() { diff --git a/docs/APP-STORE-LISTING.md b/docs/APP-STORE-LISTING.md index ccbc66a..a76d2ee 100644 --- a/docs/APP-STORE-LISTING.md +++ b/docs/APP-STORE-LISTING.md @@ -26,7 +26,7 @@ Rules this text follows: Can be changed at any time without a new build. - Open Excel files, work them with 157 functions, then chart and pivot the results, in an app that starts in under a second. One purchase covers Mac and iPad. + Open Excel files, work them with 158 functions, then chart and pivot the results, in an app that starts in under a second. One purchase covers Mac and iPad. ## Keywords (100) @@ -46,7 +46,7 @@ aren't repeated. • Imports CSV safely: it works out the delimiter and the text encoding, keeps leading zeros, and never runs a formula hidden in the data. FORMULAS - • 157 functions, including SUMIFS, XLOOKUP, VLOOKUP, INDEX and MATCH, TEXTJOIN, NETWORKDAYS and IRR. + • 158 functions, including SUMIFS, XLOOKUP, VLOOKUP, INDEX and MATCH, TEXTJOIN, NETWORKDAYS and IRR. • The same results and rules as Google Sheets, with Excel's operator precedence. • Fill handle, Fill Down and Fill Right, with references that adjust as they should. diff --git a/docs/FUNCTIONS.md b/docs/FUNCTIONS.md index 5e65f40..bb7a2f8 100644 --- a/docs/FUNCTIONS.md +++ b/docs/FUNCTIONS.md @@ -1,6 +1,6 @@ # SimpleSpread — Function Reference -157 built-in functions. Names are case-insensitive; arguments in square +158 built-in functions. Names are case-insensitive; arguments in square brackets are optional; `...` is variadic. Semantics follow Google Sheets / Excel shared behavior (see docs/RESEARCH.md for the coercion and criteria rules that apply across all functions). @@ -94,7 +94,7 @@ Rules that apply across the library: | TRUE(), FALSE() | | | SWITCH(subject, case1, val1, ..., [default]) | Case-insensitive equality; lazy | -## Text (26) +## Text (27) | Function | Notes | |---|---| @@ -117,6 +117,7 @@ Rules that apply across the library: | CHAR(n), CODE(text) | Unicode scalars | | T(value) | Text passes through, else "" | | REGEXMATCH / REGEXEXTRACT / REGEXREPLACE(text, pattern, [replacement]) | ICU regex (NSRegularExpression), not RE2; EXTRACT returns first capture group if present, miss → #N/A; REPLACE supports $1 templates | +| HYPERLINK(url, [link_label]) | Shows the label (or the URL when it's omitted or blank; a number label stays a number). The cell is drawn as a link; ⌘-click it on the Mac, or use Open Link in its context menu, to open the URL. Only when HYPERLINK is the formula's outermost call. A URL without a scheme gets `http://`; only http, https and mailto links open | ## Date & time (24) diff --git a/docs/PLAN.md b/docs/PLAN.md index 9ef5da2..76ace05 100644 --- a/docs/PLAN.md +++ b/docs/PLAN.md @@ -89,7 +89,7 @@ Sources/ FormulaEvaluator.swift EvalValue, resolved ranges, operator semantics Coercion.swift the coercion table + criteria evaluator FunctionRegistry.swift registry, GridArg, shared arg helpers - Functions*.swift 9 category files, 157 functions + Functions*.swift 9 category files, 158 functions CalculationEngine.swift dependency graph, dirty propagation, cycles RangeDependencyIndex.swift large-range dependents: per-column interval trees WorkbookOperations.swift structural edits with formula rewriting diff --git a/docs/RESEARCH.md b/docs/RESEARCH.md index a30aeb6..8600fba 100644 --- a/docs/RESEARCH.md +++ b/docs/RESEARCH.md @@ -15,7 +15,7 @@ real-world formulas use only operators plus a small set — SUM, IF, NOW, AVERAGE, VLOOKUP, ROUND, TODAY, MONTH/YEAR, ISERROR, INDEX/MATCH. ~25 functions cover >90% of usage; ~120 covers essentially everything a non-specialist writes. **Conclusion: invest in operator/coercion correctness -and the high-traffic functions before breadth.** SimpleSpread ships 157. +and the high-traffic functions before breadth.** SimpleSpread ships 158. ### Coercion table (the part clones get wrong) - Arithmetic operators and *direct literal* arguments coerce: TRUE→1,