Swiftpack.co - Package - regexident/Interner

Interner

Fast general-purpose interners for every use case

Interners take complex values and map them to trivially-comparable stand-ins that can later be resolved back to their source values. Interners are often found in software like parsers, language interpreters, and compilers; they can be used whenever a given algorithm compares its inputs by identity only.

Examples

import Interner

let interner = Interner<String>()

let string = "Hello"
let symbol = interner.interned(string)
let resolved = interner.lookup(symbol)

XCTAssert(resolved == string)

License

This project is licensed under the MPL-2.0 – see the LICENSE.md file for details.

Github

link
Stars: 1

Dependencies

Used By

Total: 0