├── .gitattributes ├── .gitignore ├── Assets ├── bar-chart-params.png ├── lispkit-repl-ios.png ├── lispkit_logo_small.png ├── sample-graph.png └── thread-states.png ├── CHANGELOG.md ├── File.txt ├── LICENSE ├── LispKit.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── swiftpm │ │ └── Package.resolved └── xcshareddata │ └── xcschemes │ ├── LispKit iOS.xcscheme │ ├── LispKit.xcscheme │ ├── LispKitRepl iOS.xcscheme │ ├── LispKitRepl.xcscheme │ └── LispKitTools.xcscheme ├── Makefile ├── Package.resolved ├── Package.swift ├── README.md ├── Sources ├── LispKit iOS │ ├── Info.plist │ └── LispKit_iOS.h ├── LispKit │ ├── Base │ │ ├── Bitset.swift │ │ ├── Boxes.swift │ │ ├── Compression.swift │ │ ├── Data.swift │ │ ├── Global.swift │ │ ├── Locks.swift │ │ ├── ManagedObject.swift │ │ ├── ManagedObjectPool.swift │ │ ├── MethodProfiler.swift │ │ ├── MultiMap.swift │ │ ├── OAuth2DeviceGrantLK.swift │ │ ├── ObjectPool.swift │ │ ├── Owners.swift │ │ ├── Reference.swift │ │ ├── ScanBuffer.swift │ │ ├── String.swift │ │ ├── StringBuilder.swift │ │ ├── Sysctl.swift │ │ ├── Timer.swift │ │ └── TrackedObject.swift │ ├── Compiler │ │ ├── BindingGroup.swift │ │ ├── CaptureGroup.swift │ │ ├── Checkpointer.swift │ │ ├── Compiler.swift │ │ ├── Env.swift │ │ ├── EvalError.swift │ │ ├── LexicalError.swift │ │ ├── Parser.swift │ │ ├── RuntimeError.swift │ │ ├── Scanner.swift │ │ ├── SourcePosition.swift │ │ └── SyntaxError.swift │ ├── Data │ │ ├── Cell.swift │ │ ├── CharSet.swift │ │ ├── Collection.swift │ │ ├── CustomExpr.swift │ │ ├── Environment.swift │ │ ├── Equality.swift │ │ ├── Expr.swift │ │ ├── Exprs.swift │ │ ├── Hash.swift │ │ ├── HashTable.swift │ │ ├── NativeObject.swift │ │ ├── Port.swift │ │ ├── Procedure.swift │ │ ├── Promise.swift │ │ ├── Serialization.swift │ │ ├── SpecialForm.swift │ │ ├── Symbol.swift │ │ ├── Tuple.swift │ │ └── Type.swift │ ├── Graphics │ │ ├── Barcode.swift │ │ ├── Color.swift │ │ ├── Drawing.swift │ │ ├── DrawingDocument.swift │ │ ├── Drawing_iOS.swift │ │ ├── Shape.swift │ │ ├── Transformation.swift │ │ └── Transformation_iOS.swift │ ├── IO │ │ ├── BinaryInput.swift │ │ ├── BinaryInputSource.swift │ │ ├── BinaryOutput.swift │ │ ├── TextInput.swift │ │ ├── TextInputSource.swift │ │ ├── TextOutput.swift │ │ └── TextOutputTarget.swift │ ├── Info.plist │ ├── LispKit.h │ ├── Primitives │ │ ├── BaseLibrary.swift │ │ ├── BitsetLibrary.swift │ │ ├── BoxLibrary.swift │ │ ├── BytevectorLibrary.swift │ │ ├── CharLibrary.swift │ │ ├── CharSetLibrary.swift │ │ ├── ControlFlowLibrary.swift │ │ ├── CoreLibrary.swift │ │ ├── CryptoLibrary.swift │ │ ├── DateTimeLibrary.swift │ │ ├── DebugLibrary.swift │ │ ├── DrawBarcodeLibrary.swift │ │ ├── DrawingLibrary.swift │ │ ├── DrawingLibrary_iOS.swift │ │ ├── DynamicControlLibrary.swift │ │ ├── EnumLibrary.swift │ │ ├── FormatLibrary.swift │ │ ├── GrowableVectorLibrary.swift │ │ ├── HTTPLibrary.swift │ │ ├── HTTPOAuthLibrary.swift │ │ ├── HTTPServerLibrary.swift │ │ ├── HashTableLibrary.swift │ │ ├── ImageLibrary.swift │ │ ├── InternalLibrary.swift │ │ ├── JSONLibrary.swift │ │ ├── JSONSchemaLibrary.swift │ │ ├── KeychainLibrary.swift │ │ ├── LibraryRegistry.swift │ │ ├── ListLibrary.swift │ │ ├── MarkdownLibrary.swift │ │ ├── MathLibrary.swift │ │ ├── PDFLibrary.swift │ │ ├── PasteboardLibrary.swift │ │ ├── PasteboardLibrary_iOS.swift │ │ ├── PortLibrary.swift │ │ ├── RecordLibrary.swift │ │ ├── RegexpLibrary.swift │ │ ├── SQLiteLibrary.swift │ │ ├── SerializeLibrary.swift │ │ ├── SharedQueueLibrary.swift │ │ ├── StringLibrary.swift │ │ ├── StyledTextLibrary.swift │ │ ├── SystemCallLibrary.swift │ │ ├── SystemLibrary.swift │ │ ├── TarArchiveLibrary.swift │ │ ├── ThreadFutureLibrary.swift │ │ ├── ThreadLibrary.swift │ │ ├── TypeLibrary.swift │ │ ├── URLLibrary.swift │ │ ├── VectorLibrary.swift │ │ ├── VisionLibrary.swift │ │ └── ZipArchiveLibrary.swift │ ├── Resources │ │ ├── Assets │ │ │ ├── ColorLists │ │ │ │ └── HtmlColors.plist │ │ │ ├── Datasets │ │ │ │ └── Covid │ │ │ │ │ ├── 2020-01-22.data │ │ │ │ │ ├── 2020-01-23.data │ │ │ │ │ ├── 2020-01-24.data │ │ │ │ │ ├── 2020-01-25.data │ │ │ │ │ ├── 2020-01-26.data │ │ │ │ │ ├── 2020-01-27.data │ │ │ │ │ ├── 2020-01-28.data │ │ │ │ │ ├── 2020-01-29.data │ │ │ │ │ ├── 2020-01-30.data │ │ │ │ │ ├── 2020-01-31.data │ │ │ │ │ ├── 2020-02-01.data │ │ │ │ │ ├── 2020-02-02.data │ │ │ │ │ ├── 2020-02-03.data │ │ │ │ │ ├── 2020-02-04.data │ │ │ │ │ ├── 2020-02-05.data │ │ │ │ │ ├── 2020-02-06.data │ │ │ │ │ ├── 2020-02-07.data │ │ │ │ │ ├── 2020-02-08.data │ │ │ │ │ ├── 2020-02-09.data │ │ │ │ │ ├── 2020-02-10.data │ │ │ │ │ ├── 2020-02-11.data │ │ │ │ │ ├── 2020-02-12.data │ │ │ │ │ ├── 2020-02-13.data │ │ │ │ │ ├── 2020-02-14.data │ │ │ │ │ ├── 2020-02-15.data │ │ │ │ │ ├── 2020-02-16.data │ │ │ │ │ ├── 2020-02-17.data │ │ │ │ │ ├── 2020-02-18.data │ │ │ │ │ ├── 2020-02-19.data │ │ │ │ │ ├── 2020-02-20.data │ │ │ │ │ ├── 2020-02-21.data │ │ │ │ │ ├── 2020-02-22.data │ │ │ │ │ ├── 2020-02-23.data │ │ │ │ │ ├── 2020-02-24.data │ │ │ │ │ ├── 2020-02-25.data │ │ │ │ │ ├── 2020-02-26.data │ │ │ │ │ ├── 2020-02-27.data │ │ │ │ │ ├── 2020-02-28.data │ │ │ │ │ ├── 2020-02-29.data │ │ │ │ │ ├── 2020-03-01.data │ │ │ │ │ ├── 2020-03-02.data │ │ │ │ │ ├── 2020-03-03.data │ │ │ │ │ ├── 2020-03-04.data │ │ │ │ │ ├── 2020-03-05.data │ │ │ │ │ ├── 2020-03-06.data │ │ │ │ │ ├── 2020-03-07.data │ │ │ │ │ ├── 2020-03-08.data │ │ │ │ │ ├── 2020-03-09.data │ │ │ │ │ ├── 2020-03-10.data │ │ │ │ │ ├── 2020-03-11.data │ │ │ │ │ ├── 2020-03-12.data │ │ │ │ │ ├── 2020-03-13.data │ │ │ │ │ ├── 2020-03-14.data │ │ │ │ │ ├── 2020-03-15.data │ │ │ │ │ ├── 2020-03-16.data │ │ │ │ │ ├── 2020-03-17.data │ │ │ │ │ ├── 2020-03-18.data │ │ │ │ │ ├── 2020-03-19.data │ │ │ │ │ ├── 2020-03-20.data │ │ │ │ │ ├── 2020-03-21.data │ │ │ │ │ ├── 2020-03-22.data │ │ │ │ │ ├── 2020-03-23.data │ │ │ │ │ ├── 2020-03-24.data │ │ │ │ │ ├── 2020-03-25.data │ │ │ │ │ ├── 2020-03-26.data │ │ │ │ │ ├── 2020-03-27.data │ │ │ │ │ ├── 2020-03-28.data │ │ │ │ │ ├── 2020-03-29.data │ │ │ │ │ ├── 2020-03-30.data │ │ │ │ │ ├── 2020-03-31.data │ │ │ │ │ ├── 2020-04-01.data │ │ │ │ │ ├── 2020-04-02.data │ │ │ │ │ ├── 2020-04-03.data │ │ │ │ │ ├── 2020-04-04.data │ │ │ │ │ ├── 2020-04-05.data │ │ │ │ │ ├── 2020-04-06.data │ │ │ │ │ ├── 2020-04-07.data │ │ │ │ │ ├── 2020-04-08.data │ │ │ │ │ ├── 2020-04-09.data │ │ │ │ │ ├── 2020-04-10.data │ │ │ │ │ ├── 2020-04-11.data │ │ │ │ │ ├── 2020-04-12.data │ │ │ │ │ ├── 2020-04-13.data │ │ │ │ │ ├── 2020-04-14.data │ │ │ │ │ ├── 2020-04-15.data │ │ │ │ │ ├── 2020-04-16.data │ │ │ │ │ ├── 2020-04-17.data │ │ │ │ │ ├── 2020-04-18.data │ │ │ │ │ ├── 2020-04-19.data │ │ │ │ │ ├── 2020-04-20.data │ │ │ │ │ ├── 2020-04-21.data │ │ │ │ │ ├── 2020-04-22.data │ │ │ │ │ ├── 2020-04-23.data │ │ │ │ │ ├── 2020-04-24.data │ │ │ │ │ ├── 2020-04-25.data │ │ │ │ │ ├── 2020-04-26.data │ │ │ │ │ ├── 2020-04-27.data │ │ │ │ │ ├── 2020-04-28.data │ │ │ │ │ ├── 2020-04-29.data │ │ │ │ │ ├── 2020-04-30.data │ │ │ │ │ ├── 2020-05-01.data │ │ │ │ │ ├── 2020-05-02.data │ │ │ │ │ ├── 2020-05-03.data │ │ │ │ │ ├── 2020-05-04.data │ │ │ │ │ ├── 2020-05-05.data │ │ │ │ │ ├── 2020-05-06.data │ │ │ │ │ ├── 2020-05-07.data │ │ │ │ │ ├── 2020-05-08.data │ │ │ │ │ ├── 2020-05-09.data │ │ │ │ │ ├── 2020-05-10.data │ │ │ │ │ ├── 2020-05-11.data │ │ │ │ │ ├── 2020-05-12.data │ │ │ │ │ ├── 2020-05-13.data │ │ │ │ │ ├── 2020-05-14.data │ │ │ │ │ ├── 2020-05-15.data │ │ │ │ │ ├── 2020-05-16.data │ │ │ │ │ ├── 2020-05-17.data │ │ │ │ │ ├── 2020-05-18.data │ │ │ │ │ ├── 2020-05-19.data │ │ │ │ │ ├── 2020-05-20.data │ │ │ │ │ ├── 2020-05-21.data │ │ │ │ │ ├── 2020-05-22.data │ │ │ │ │ ├── 2020-05-23.data │ │ │ │ │ ├── 2020-05-24.data │ │ │ │ │ ├── 2020-05-25.data │ │ │ │ │ ├── 2020-05-26.data │ │ │ │ │ ├── 2020-05-27.data │ │ │ │ │ ├── 2020-05-28.data │ │ │ │ │ ├── 2020-05-29.data │ │ │ │ │ ├── 2020-05-30.data │ │ │ │ │ ├── 2020-05-31.data │ │ │ │ │ ├── 2020-06-01.data │ │ │ │ │ ├── 2020-06-02.data │ │ │ │ │ ├── 2020-06-03.data │ │ │ │ │ ├── 2020-06-04.data │ │ │ │ │ ├── 2020-06-05.data │ │ │ │ │ ├── 2020-06-06.data │ │ │ │ │ ├── 2020-06-07.data │ │ │ │ │ ├── 2020-06-08.data │ │ │ │ │ ├── 2020-06-09.data │ │ │ │ │ ├── 2020-06-10.data │ │ │ │ │ ├── 2020-06-11.data │ │ │ │ │ ├── 2020-06-12.data │ │ │ │ │ ├── 2020-06-13.data │ │ │ │ │ ├── 2020-06-14.data │ │ │ │ │ ├── 2020-06-15.data │ │ │ │ │ ├── 2020-06-16.data │ │ │ │ │ ├── 2020-06-17.data │ │ │ │ │ ├── 2020-06-18.data │ │ │ │ │ ├── 2020-06-19.data │ │ │ │ │ ├── 2020-06-20.data │ │ │ │ │ ├── 2020-06-21.data │ │ │ │ │ ├── 2020-06-22.data │ │ │ │ │ ├── 2020-06-23.data │ │ │ │ │ ├── 2020-06-24.data │ │ │ │ │ ├── 2020-06-25.data │ │ │ │ │ ├── 2020-06-26.data │ │ │ │ │ ├── 2020-06-27.data │ │ │ │ │ ├── 2020-06-28.data │ │ │ │ │ ├── 2020-06-29.data │ │ │ │ │ ├── 2020-06-30.data │ │ │ │ │ └── Covid.sqlite3 │ │ │ ├── Images │ │ │ │ ├── Billboard.jpg │ │ │ │ ├── Diagram.pdf │ │ │ │ ├── Inga.jpg │ │ │ │ ├── LispkitLogo.png │ │ │ │ └── Page.jpg │ │ │ └── JSON │ │ │ │ ├── Schema │ │ │ │ ├── 2020-12 │ │ │ │ │ ├── meta │ │ │ │ │ │ ├── applicator │ │ │ │ │ │ ├── content │ │ │ │ │ │ ├── core │ │ │ │ │ │ ├── format-annotation │ │ │ │ │ │ ├── meta-data │ │ │ │ │ │ ├── unevaluated │ │ │ │ │ │ └── validation │ │ │ │ │ └── schema │ │ │ │ └── Custom │ │ │ │ │ └── person │ │ │ │ └── Tests │ │ │ │ └── 2020-12 │ │ │ │ ├── LICENSE │ │ │ │ ├── additionalProperties.json │ │ │ │ ├── allOf.json │ │ │ │ ├── anchor.json │ │ │ │ ├── anyOf.json │ │ │ │ ├── boolean_schema.json │ │ │ │ ├── const.json │ │ │ │ ├── contains.json │ │ │ │ ├── content.json │ │ │ │ ├── debug.json │ │ │ │ ├── default.json │ │ │ │ ├── defs.json │ │ │ │ ├── dependentRequired.json │ │ │ │ ├── dependentSchemas.json │ │ │ │ ├── dynamicRef.json │ │ │ │ ├── enum.json │ │ │ │ ├── exclusiveMaximum.json │ │ │ │ ├── exclusiveMinimum.json │ │ │ │ ├── format.json │ │ │ │ ├── id.json │ │ │ │ ├── if-then-else.json │ │ │ │ ├── infinite-loop-detection.json │ │ │ │ ├── items.json │ │ │ │ ├── maxContains.json │ │ │ │ ├── maxItems.json │ │ │ │ ├── maxLength.json │ │ │ │ ├── maxProperties.json │ │ │ │ ├── maximum.json │ │ │ │ ├── minContains.json │ │ │ │ ├── minItems.json │ │ │ │ ├── minLength.json │ │ │ │ ├── minProperties.json │ │ │ │ ├── minimum.json │ │ │ │ ├── multipleOf.json │ │ │ │ ├── not.json │ │ │ │ ├── oneOf.json │ │ │ │ ├── pattern.json │ │ │ │ ├── patternProperties.json │ │ │ │ ├── prefixItems.json │ │ │ │ ├── properties.json │ │ │ │ ├── propertyNames.json │ │ │ │ ├── ref.json │ │ │ │ ├── required.json │ │ │ │ ├── type.json │ │ │ │ ├── unevaluatedItems.json │ │ │ │ ├── unevaluatedProperties.json │ │ │ │ └── uniqueItems.json │ │ ├── Examples │ │ │ ├── AvlTrees.scm │ │ │ ├── Blockchain.scm │ │ │ ├── Channels.scm │ │ │ ├── Compiler.scm │ │ │ ├── Coroutines.scm │ │ │ ├── Covid.scm │ │ │ ├── DrawBarCharts.scm │ │ │ ├── DrawTrees.scm │ │ │ ├── EUStats.scm │ │ │ ├── EditDistance.scm │ │ │ ├── HTTP.scm │ │ │ ├── ImageComposition.scm │ │ │ ├── JSON.scm │ │ │ ├── Keychain.scm │ │ │ ├── Math.scm │ │ │ ├── Maze.scm │ │ │ ├── OCR.scm │ │ │ ├── ObjectOrientation.scm │ │ │ ├── PDF.scm │ │ │ ├── Pi.scm │ │ │ ├── Plot.scm │ │ │ ├── Polynomials.scm │ │ │ ├── Prolog.scm │ │ │ ├── Queens.scm │ │ │ ├── Schelog.scm │ │ │ ├── Simplifier.scm │ │ │ ├── SpellNumbers.scm │ │ │ ├── Streams.scm │ │ │ ├── StyledTextDoc.scm │ │ │ ├── Sudoku.scm │ │ │ ├── Topological.scm │ │ │ ├── Turtle.scm │ │ │ ├── VisualizePointSets.scm │ │ │ ├── WebAPIs.scm │ │ │ ├── Webserver.scm │ │ │ └── paip │ │ │ │ ├── patmatch.sld │ │ │ │ ├── simplifier.sld │ │ │ │ └── util.sld │ │ ├── Libraries │ │ │ ├── lispkit │ │ │ │ ├── clos.sld │ │ │ │ ├── clos │ │ │ │ │ └── support.sld │ │ │ │ ├── combinator.sld │ │ │ │ ├── comparator.sld │ │ │ │ ├── csv.sld │ │ │ │ ├── datatype.sld │ │ │ │ ├── disjoint-set.sld │ │ │ │ ├── draw │ │ │ │ │ ├── chart │ │ │ │ │ │ └── bar.sld │ │ │ │ │ └── turtle.sld │ │ │ │ ├── enum │ │ │ │ │ └── r6rs.sld │ │ │ │ ├── graph.sld │ │ │ │ ├── heap.sld │ │ │ │ ├── image │ │ │ │ │ └── process.sld │ │ │ │ ├── iterate.sld │ │ │ │ ├── json │ │ │ │ │ └── deprecated.sld │ │ │ │ ├── list │ │ │ │ │ └── set.sld │ │ │ │ ├── log.sld │ │ │ │ ├── log │ │ │ │ │ └── internal.sld │ │ │ │ ├── logic.sld │ │ │ │ ├── match.sld │ │ │ │ ├── math │ │ │ │ │ ├── matrix.sld │ │ │ │ │ ├── stats.sld │ │ │ │ │ └── util.sld │ │ │ │ ├── object.sld │ │ │ │ ├── pdf │ │ │ │ │ └── legacy.sld │ │ │ │ ├── prettify.sld │ │ │ │ ├── prolog.sld │ │ │ │ ├── queue.sld │ │ │ │ ├── set.sld │ │ │ │ ├── stack.sld │ │ │ │ ├── stream.sld │ │ │ │ ├── sxml.sld │ │ │ │ ├── sxml │ │ │ │ │ ├── html.sld │ │ │ │ │ └── xml.sld │ │ │ │ ├── test.sld │ │ │ │ ├── text-table.sld │ │ │ │ ├── thread │ │ │ │ │ └── channel.sld │ │ │ │ └── wt-tree.sld │ │ │ ├── scheme │ │ │ │ ├── base.sld │ │ │ │ ├── bitwise.sld │ │ │ │ ├── box.sld │ │ │ │ ├── case-lambda.sld │ │ │ │ ├── char.sld │ │ │ │ ├── charset.sld │ │ │ │ ├── comparator.sld │ │ │ │ ├── complex.sld │ │ │ │ ├── cxr.sld │ │ │ │ ├── division.sld │ │ │ │ ├── eval.sld │ │ │ │ ├── file.sld │ │ │ │ ├── fixnum.sld │ │ │ │ ├── flonum.sld │ │ │ │ ├── generator.sld │ │ │ │ ├── hash-table.sld │ │ │ │ ├── ideque.sld │ │ │ │ ├── inexact.sld │ │ │ │ ├── lazy.sld │ │ │ │ ├── list.sld │ │ │ │ ├── load.sld │ │ │ │ ├── mapping.sld │ │ │ │ ├── process-context.sld │ │ │ │ ├── r5rs-syntax.sld │ │ │ │ ├── r5rs.sld │ │ │ │ ├── read.sld │ │ │ │ ├── red.sld │ │ │ │ ├── repl.sld │ │ │ │ ├── rlist.sld │ │ │ │ ├── set.sld │ │ │ │ ├── sort.sld │ │ │ │ ├── stream.sld │ │ │ │ ├── text.sld │ │ │ │ ├── time.sld │ │ │ │ ├── vector.sld │ │ │ │ └── write.sld │ │ │ ├── srfi │ │ │ │ ├── 14 │ │ │ │ │ └── ascii.sld │ │ │ │ ├── 41 │ │ │ │ │ ├── derived.sld │ │ │ │ │ └── primitive.sld │ │ │ │ ├── 69 │ │ │ │ │ └── internal.sld │ │ │ │ ├── 135 │ │ │ │ │ └── kernel0.sld │ │ │ │ ├── 146 │ │ │ │ │ └── rbtree.sld │ │ │ │ ├── 166 │ │ │ │ │ ├── base.sld │ │ │ │ │ ├── color.sld │ │ │ │ │ ├── columnar.sld │ │ │ │ │ ├── pretty.sld │ │ │ │ │ └── unicode.sld │ │ │ │ ├── 167 │ │ │ │ │ ├── engine.sld │ │ │ │ │ ├── memory.sld │ │ │ │ │ └── pack.sld │ │ │ │ ├── 1.sld │ │ │ │ ├── 101.sld │ │ │ │ ├── 102.sld │ │ │ │ ├── 11.sld │ │ │ │ ├── 111.sld │ │ │ │ ├── 112.sld │ │ │ │ ├── 113.sld │ │ │ │ ├── 118.sld │ │ │ │ ├── 121.sld │ │ │ │ ├── 125.sld │ │ │ │ ├── 128.sld │ │ │ │ ├── 129.sld │ │ │ │ ├── 131.sld │ │ │ │ ├── 132.sld │ │ │ │ ├── 133.sld │ │ │ │ ├── 134.sld │ │ │ │ ├── 135.sld │ │ │ │ ├── 137.sld │ │ │ │ ├── 14.sld │ │ │ │ ├── 141.sld │ │ │ │ ├── 142.sld │ │ │ │ ├── 143.sld │ │ │ │ ├── 144.sld │ │ │ │ ├── 145.sld │ │ │ │ ├── 146.sld │ │ │ │ ├── 149.sld │ │ │ │ ├── 151.sld │ │ │ │ ├── 152.sld │ │ │ │ ├── 154.sld │ │ │ │ ├── 155.sld │ │ │ │ ├── 158.sld │ │ │ │ ├── 16.sld │ │ │ │ ├── 161.sld │ │ │ │ ├── 162.sld │ │ │ │ ├── 165.sld │ │ │ │ ├── 166.sld │ │ │ │ ├── 17.sld │ │ │ │ ├── 173.sld │ │ │ │ ├── 174.sld │ │ │ │ ├── 175.sld │ │ │ │ ├── 177.sld │ │ │ │ ├── 18.sld │ │ │ │ ├── 180.sld │ │ │ │ ├── 189.sld │ │ │ │ ├── 19.sld │ │ │ │ ├── 194.sld │ │ │ │ ├── 195.sld │ │ │ │ ├── 196.sld │ │ │ │ ├── 2.sld │ │ │ │ ├── 204.sld │ │ │ │ ├── 208.sld │ │ │ │ ├── 209.sld │ │ │ │ ├── 210.sld │ │ │ │ ├── 214.sld │ │ │ │ ├── 215.sld │ │ │ │ ├── 216.sld │ │ │ │ ├── 217.sld │ │ │ │ ├── 219.sld │ │ │ │ ├── 221.sld │ │ │ │ ├── 222.sld │ │ │ │ ├── 223.sld │ │ │ │ ├── 224.sld │ │ │ │ ├── 227.sld │ │ │ │ ├── 228.sld │ │ │ │ ├── 229.sld │ │ │ │ ├── 23.sld │ │ │ │ ├── 230.sld │ │ │ │ ├── 232.sld │ │ │ │ ├── 233.sld │ │ │ │ ├── 235.sld │ │ │ │ ├── 236.sld │ │ │ │ ├── 239.sld │ │ │ │ ├── 258.sld │ │ │ │ ├── 26.sld │ │ │ │ ├── 27.sld │ │ │ │ ├── 28.sld │ │ │ │ ├── 31.sld │ │ │ │ ├── 33.sld │ │ │ │ ├── 34.sld │ │ │ │ ├── 35.sld │ │ │ │ ├── 39.sld │ │ │ │ ├── 41.sld │ │ │ │ ├── 46.sld │ │ │ │ ├── 48.sld │ │ │ │ ├── 51.sld │ │ │ │ ├── 54.sld │ │ │ │ ├── 55.sld │ │ │ │ ├── 6.sld │ │ │ │ ├── 63.sld │ │ │ │ ├── 64.sld │ │ │ │ ├── 69.sld │ │ │ │ ├── 8.sld │ │ │ │ ├── 87.sld │ │ │ │ ├── 9.sld │ │ │ │ ├── 95.sld │ │ │ │ ├── 98.sld │ │ │ │ └── sicp.sld │ │ │ └── third-party │ │ │ │ └── adapton │ │ │ │ ├── memoization.sld │ │ │ │ ├── micro.sld │ │ │ │ ├── mini.sld │ │ │ │ └── set.sld │ │ ├── Prelude.scm │ │ └── Tests │ │ │ ├── All.scm │ │ │ ├── Import.scm │ │ │ ├── LispKit-Channel.scm │ │ │ ├── LispKit-Control.scm │ │ │ ├── LispKit-Enum.scm │ │ │ ├── LispKit-JSON-Schema.scm │ │ │ ├── LispKit-List-Set.scm │ │ │ ├── LispKit-Match.scm │ │ │ ├── LispKit-Record.scm │ │ │ ├── LispKit-Shared-Queue.scm │ │ │ ├── LispKit-WT-Tree.scm │ │ │ ├── R7RS.scm │ │ │ ├── SRFI-101.scm │ │ │ ├── SRFI-125.scm │ │ │ ├── SRFI-128.scm │ │ │ ├── SRFI-14.scm │ │ │ ├── SRFI-143.scm │ │ │ ├── SRFI-144.scm │ │ │ ├── SRFI-146.scm │ │ │ ├── SRFI-154.scm │ │ │ ├── SRFI-155.scm │ │ │ ├── SRFI-165.scm │ │ │ ├── SRFI-166.scm │ │ │ ├── SRFI-167.scm │ │ │ ├── SRFI-173.scm │ │ │ ├── SRFI-174.scm │ │ │ ├── SRFI-175.scm │ │ │ ├── SRFI-18.scm │ │ │ ├── SRFI-189.scm │ │ │ ├── SRFI-194.scm │ │ │ ├── SRFI-196.scm │ │ │ ├── SRFI-204.scm │ │ │ ├── SRFI-209.scm │ │ │ ├── SRFI-210.scm │ │ │ ├── SRFI-214.scm │ │ │ ├── SRFI-217.scm │ │ │ ├── SRFI-219.scm │ │ │ ├── SRFI-221.scm │ │ │ ├── SRFI-222.scm │ │ │ ├── SRFI-223.scm │ │ │ ├── SRFI-224.scm │ │ │ ├── SRFI-227.scm │ │ │ ├── SRFI-228.scm │ │ │ ├── SRFI-229.scm │ │ │ ├── SRFI-232.scm │ │ │ ├── SRFI-233.scm │ │ │ ├── SRFI-235.scm │ │ │ └── SRFI-258.scm │ └── Runtime │ │ ├── Code.swift │ │ ├── Context.swift │ │ ├── ContextDelegate.swift │ │ ├── Evaluator.swift │ │ ├── FeatureRequirement.swift │ │ ├── Features.swift │ │ ├── FileHandler.swift │ │ ├── Formatter.swift │ │ ├── GarbageCollector.swift │ │ ├── Heap.swift │ │ ├── ImportSet.swift │ │ ├── Instruction.swift │ │ ├── Library.swift │ │ ├── LibraryManager.swift │ │ ├── LispKitContext.swift │ │ ├── NativeLibrary.swift │ │ ├── Registers.swift │ │ ├── SourceManager.swift │ │ ├── SymbolTable.swift │ │ ├── SyntaxRules.swift │ │ ├── Threads │ │ ├── EvalCondition.swift │ │ ├── EvalMutex.swift │ │ ├── EvalThread.swift │ │ └── ThreadManager.swift │ │ ├── VirtualMachine.swift │ │ └── VirtualMachineState.swift ├── LispKitRepl iOS │ ├── Assets.xcassets │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── ConsoleOutput.swift │ ├── ConsoleView.swift │ ├── ContentView.swift │ ├── Info.plist │ ├── Interpreter.swift │ ├── LispKitReplApp.swift │ ├── LispKitReplOAuthConfig.swift │ ├── PortableURL.swift │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ └── UIApplication.swift ├── LispKitRepl │ ├── AppInfo.swift │ ├── AppInfo.tmpl │ └── LispKitRepl.swift └── LispKitTools │ ├── Info.plist │ ├── LispKitRepl.swift │ └── LispKitTools.h ├── TODO.md ├── Tests └── LispKitTests │ ├── Code │ ├── CallCC.scm │ ├── ControlFlow.scm │ ├── Datatypes.scm │ ├── Definitions.scm │ ├── DelayedEvaluation.scm │ ├── DynamicWind.scm │ ├── Environments.scm │ ├── Format.scm │ ├── HashTables.scm │ ├── JSON.scm │ ├── Libraries.scm │ ├── LightweightTypes.scm │ ├── LocalSyntaxRules.scm │ ├── Logic.scm │ ├── Markdown.scm │ ├── Math.scm │ ├── Parameters.scm │ ├── Ports.scm │ ├── Procedures.scm │ ├── Records.scm │ ├── SQLite.scm │ ├── SRFI113.scm │ ├── SRFI121.scm │ ├── SRFI132.scm │ ├── SRFI133.scm │ ├── SRFI134.scm │ ├── SRFI135.scm │ ├── SRFI152.scm │ ├── SRFI19.scm │ ├── SRFI35.scm │ ├── SRFI69.scm │ ├── SyntaxRules.scm │ └── Vectors.scm │ ├── Info.plist │ ├── LispKitTestCase.swift │ ├── RegressionTests.swift │ └── SmallTests.swift └── _config.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | Sources/LispKit/Resources/* linguist-vendored 2 | Tests/LispKitTests/Code/* linguist-vendored 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | *.dSYM.zip 30 | *.dSYM 31 | 32 | ## Playgrounds 33 | timeline.xctimeline 34 | playground.xcworkspace 35 | 36 | # Swift Package Manager 37 | .build/ 38 | Packages/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | Carthage/Checkouts 50 | Carthage/Build 51 | 52 | # macOS 53 | .DS_Store 54 | 55 | # edit 56 | .*.swp 57 | 58 | # ObjectHub defaults 59 | SCRATCH 60 | -------------------------------------------------------------------------------- /Assets/bar-chart-params.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Assets/bar-chart-params.png -------------------------------------------------------------------------------- /Assets/lispkit-repl-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Assets/lispkit-repl-ios.png -------------------------------------------------------------------------------- /Assets/lispkit_logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Assets/lispkit_logo_small.png -------------------------------------------------------------------------------- /Assets/sample-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Assets/sample-graph.png -------------------------------------------------------------------------------- /Assets/thread-states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Assets/thread-states.png -------------------------------------------------------------------------------- /File.txt: -------------------------------------------------------------------------------- 1 | static let burnInAnnotationsOption: PDFDocumentWriteOption 2 | static let optimizeImagesForScreenOption: PDFDocumentWriteOption 3 | static let saveImagesAsJPEGOption: PDFDocumentWriteOption 4 | static let saveTextFromOCROption: PDFDocumentWriteOption 5 | -------------------------------------------------------------------------------- /LispKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LispKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean run debug release clean 2 | 3 | all: run 4 | 5 | run: debug 6 | ifeq ($(program),) 7 | .build/debug/LispKitRepl -x -r Sources/LispKit/Resources -d LispKit 8 | else 9 | .build/debug/LispKitRepl -x -r Sources/LispKit/Resources -d LispKit $(program) 10 | endif 11 | 12 | debug: replinfo 13 | swift build 14 | 15 | repl: release 16 | ifeq ($(program),) 17 | .build/release/LispKitRepl -x -r Sources/LispKit/Resources -d LispKit 18 | else 19 | .build/release/LispKitRepl -x -r Sources/LispKit/Resources -d LispKit $(program) 20 | endif 21 | 22 | release: replinfo 23 | swift build -c release 24 | 25 | replinfo: 26 | sed "s/CURRENT-DATE/$(shell date +%s)/" Sources/LispKitRepl/AppInfo.tmpl > Sources/LispKitRepl/AppInfo.swift 27 | 28 | test: 29 | swift test 30 | 31 | update: 32 | carthage update --platform macOS 33 | 34 | clean: 35 | rm -rf .build 36 | -------------------------------------------------------------------------------- /Sources/LispKit iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en_US 7 | CFBundleDisplayName 8 | LispKit 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2016–2025 Matthias Zenger. All rights reserved. 25 | 26 | 27 | -------------------------------------------------------------------------------- /Sources/LispKit iOS/LispKit_iOS.h: -------------------------------------------------------------------------------- 1 | // 2 | // LispKit_iOS.h 3 | // LispKit iOS 4 | // 5 | // Created by Matthias Zenger on 23/02/2021. 6 | // Copyright © 2021 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | #import 22 | 23 | //! Project version number for LispKit_iOS. 24 | FOUNDATION_EXPORT double LispKit_iOSVersionNumber; 25 | 26 | //! Project version string for LispKit_iOS. 27 | FOUNDATION_EXPORT const unsigned char LispKit_iOSVersionString[]; 28 | 29 | // In this header, you should import all the public headers of your framework using statements like #import 30 | -------------------------------------------------------------------------------- /Sources/LispKit/Base/Boxes.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Boxes.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 03/02/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | /// 22 | /// Generic box for value and reference types. 23 | /// 24 | public final class ImmutableBox: Reference { 25 | public let value: T 26 | 27 | public init(_ value: T) { 28 | self.value = value 29 | } 30 | } 31 | 32 | /// 33 | /// Generic mutable box for value and reference types. 34 | /// 35 | public final class MutableBox: Reference { 36 | public var value: T 37 | 38 | public init(_ value: T) { 39 | self.value = value 40 | } 41 | } 42 | 43 | /// 44 | /// Generic weak, mutable box for reference types. 45 | /// 46 | public final class WeakBox: Reference { 47 | public weak var value: T? 48 | 49 | public init(_ value: T?) { 50 | self.value = value 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Sources/LispKit/Base/Data.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Data.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 18/02/2023. 6 | // Copyright © 2023 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | extension Data { 24 | 25 | func hexEncodedString(upperCase: Bool = false) -> String { 26 | let utf8Digits = Array((upperCase ? "0123456789ABCDEF" : "0123456789abcdef").utf8) 27 | return String(unsafeUninitializedCapacity: 2 * self.count) { (ptr) -> Int in 28 | var p = ptr.baseAddress! 29 | for byte in self { 30 | p[0] = utf8Digits[Int(byte / 16)] 31 | p[1] = utf8Digits[Int(byte % 16)] 32 | p += 2 33 | } 34 | return 2 * self.count 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Sources/LispKit/Base/Global.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Global.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 12/04/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | infix operator %%: MultiplicationPrecedence 22 | 23 | func %%(lhs: T, rhs: T) -> T { 24 | let rem = lhs % rhs 25 | return (rem < 0) == (rhs < 0) ? rem : rem + rhs 26 | } 27 | 28 | internal func log(_ str: String) { 29 | #if LOG 30 | print(str) 31 | #endif 32 | } 33 | -------------------------------------------------------------------------------- /Sources/LispKit/Base/ManagedObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ManagedObject.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 20/03/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | /// 22 | /// A managed object can be registered with a managed object pool. Once registered, the 23 | /// `managed` property will be set to true. As soon as there is no reference pointing at this 24 | /// object anymore, `clean` will be called to reset the object and break any strong cyclic 25 | /// references. 26 | /// 27 | /// Managed objects are currently: 28 | /// - Cells 29 | /// - Tuples 30 | /// - Vectors 31 | /// - Records 32 | /// - Hashtables 33 | /// - Futures 34 | /// 35 | open class ManagedObject: Reference { 36 | 37 | /// Used internally to declare that a managed object is registered in a managed object pool. 38 | internal final var managed: Bool = false 39 | 40 | /// A tag that defines the last GC cyle in which this object was marked (by following the 41 | /// root set references). 42 | internal final var tag: UInt8 = 0 43 | 44 | /// Clean up the object; i.e. remove possible cycles to free up the object for 45 | /// garbage collection. 46 | open func clean() {} 47 | } 48 | -------------------------------------------------------------------------------- /Sources/LispKit/Base/MethodProfiler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MethodProfiler.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 01/01/2022. 6 | // Copyright © 2022 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | public final class MethodProfiler { 24 | let className: String 25 | var open: [Double] = [] 26 | var stats: [String : (Int, Double)] = [:] 27 | 28 | init(_ className: String) { 29 | self.className = className 30 | } 31 | 32 | func enter() { 33 | open.append(Timer.absoluteTimeInSec) 34 | } 35 | 36 | func exit(_ name: String) { 37 | let time = Timer.absoluteTimeInSec - open.last! 38 | open.removeLast() 39 | if let (count, average) = stats[name] { 40 | stats[name] = (count + 1, (average * Double(count) + time)/Double(count + 1)) 41 | } else { 42 | stats[name] = (1, time) 43 | } 44 | } 45 | 46 | public func printStats() { 47 | Swift.print("==== \(self.className) ================") 48 | for (name, (count, average)) in self.stats { 49 | Swift.print("\(name),\(count),\(average),\(average * Double(count))") 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Sources/LispKit/Base/MultiMap.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultiMap.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 18/09/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | /// 22 | /// Minimalistic multi map implementation. 23 | /// 24 | public struct MultiMap: CustomStringConvertible { 25 | private var map: [Key : [Value]] 26 | 27 | public init() { 28 | self.map = [:] 29 | } 30 | 31 | public var keys: Dictionary.Keys { 32 | return map.keys 33 | } 34 | 35 | public func hasValues(for key: Key) -> Bool { 36 | return self.map[key] != nil 37 | } 38 | 39 | public func values(for key: Key) -> [Value] { 40 | return self.map[key] ?? [] 41 | } 42 | 43 | public mutating func insert(_ key: Key, mapsTo value: Value) { 44 | if self.map[key] == nil { 45 | self.map[key] = [value] 46 | } else { 47 | self.map[key]!.append(value) 48 | } 49 | } 50 | 51 | public var description: String { 52 | var builder = StringBuilder(prefix: "{", postfix: "}", separator: ", ") 53 | for (key, value) in self.map { 54 | builder.append("\(key) → \(value)") 55 | } 56 | return builder.description 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Sources/LispKit/Base/Reference.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Reference.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 06/03/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | /// 22 | /// A `Reference` is a hashable object whose identity is used for the definition of 23 | /// equality and the hash value. 24 | /// 25 | open class Reference: Hashable { 26 | 27 | public final var identity: UInt { 28 | return UInt(bitPattern: ObjectIdentifier(self)) 29 | } 30 | 31 | public final var identityString: String { 32 | return String(self.identity, radix: 16) 33 | } 34 | 35 | public final func hash(into hasher: inout Hasher) { 36 | hasher.combine(ObjectIdentifier(self)) 37 | } 38 | 39 | open var typeDescription: String { 40 | return "reference" 41 | } 42 | 43 | public static func ==(lhs: Reference, rhs: Reference) -> Bool { 44 | return lhs === rhs 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Sources/LispKit/Base/Timer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Timer.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 20/03/2016. 6 | // Copyright © 2016-2022 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | /// 24 | /// Timer utilities based on Darwin framework. 25 | /// 26 | public struct Timer { 27 | 28 | private static let (TIME_NUMER, TIME_DENOM): (UInt64, UInt64) = { 29 | var info: mach_timebase_info = mach_timebase_info(numer: 0, denom: 0) 30 | mach_timebase_info(&info) 31 | return (UInt64(info.numer), UInt64(info.denom)) 32 | }() 33 | 34 | /// Returns a current time measurement in seconds, as a Double. This is only useful for 35 | /// measuring short time intervals. 36 | public static var absoluteTimeInSec: Double { 37 | return Double(mach_absolute_time() * Timer.TIME_NUMER / Timer.TIME_DENOM) / 1e9 38 | } 39 | 40 | /// Returns a current time measurement in milliseconds, as a UInt64. This is only useful for 41 | /// measuring short time intervals. 42 | public static var absoluteTimeInMSec: UInt64 { 43 | return (mach_absolute_time() * Timer.TIME_NUMER) / (Timer.TIME_DENOM * 1000000) 44 | } 45 | 46 | /// Returns the current time in seconds using standard UNIX data structures. 47 | public static var currentTimeInSec: Double { 48 | var tv = timeval(tv_sec: 0, tv_usec: 0) 49 | gettimeofday(&tv, nil) 50 | return Double(tv.tv_sec) + (Double(tv.tv_usec) / 1000000.0) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Sources/LispKit/Base/TrackedObject.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TrackedObject.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 29/03/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | /// 22 | /// Objects inheriting from `TrackedObject` can be registered in `ManagedObjectPool` 23 | /// instances for tracking managed objects. LispKit currently defines three subclasses 24 | /// of `TrackedObject`: 25 | /// - `Heap` 26 | /// - `VirtualMachine` 27 | /// - `LibraryManager` 28 | /// 29 | open class TrackedObject { 30 | open func mark(in: GarbageCollector) {} 31 | } 32 | -------------------------------------------------------------------------------- /Sources/LispKit/Compiler/SyntaxError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SyntaxError.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 01/03/2018. 6 | // Copyright © 2018 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | /// 24 | /// Enumeration `SyntaxError` represents syntactical errors emitted by the parser. 25 | /// 26 | public enum SyntaxError: Int, Hashable, Codable { 27 | case empty 28 | case closingParenthesisMissing 29 | case unexpectedClosingParenthesis 30 | case unexpectedDot 31 | case notAByteValue 32 | case syntaxNotYetSupported 33 | 34 | public var message: String { 35 | switch self { 36 | case .empty: 37 | return "empty input" 38 | case .closingParenthesisMissing: 39 | return "closing parenthesis missing" 40 | case .unexpectedClosingParenthesis: 41 | return "unexpected closing parenthesis" 42 | case .unexpectedDot: 43 | return "unexpected dot" 44 | case .notAByteValue: 45 | return "bytevector element not a byte" 46 | case .syntaxNotYetSupported: 47 | return "syntax not yet supported" 48 | } 49 | } 50 | 51 | public static func ==(_ lhs: SyntaxError, _ rhs: SyntaxError) -> Bool { 52 | return lhs.rawValue == rhs.rawValue 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Sources/LispKit/Data/Cell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Cell.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 07/02/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | /// 22 | /// `Cell` implements a mutable expression. 23 | /// 24 | public class Cell: ManagedObject, CustomStringConvertible { 25 | 26 | /// The current value of the cell. 27 | public var value: Expr 28 | 29 | /// Create a new cell with a given initial value. 30 | public init(_ value: Expr) { 31 | self.value = value 32 | } 33 | 34 | /// Clear cell value. 35 | public override func clean() { 36 | self.value = .undef 37 | } 38 | 39 | /// A string representation of this cell. 40 | public var description: String { 41 | return "«cell \(self.value)»" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Sources/LispKit/Data/CustomExpr.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomExpr.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 05/05/2024. 6 | // Copyright © 2024 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | /// 24 | /// Protocol implementing custom values. 25 | /// 26 | public protocol CustomExpr: Hashable { 27 | var type: Type { get } 28 | var typeDescription: String { get } 29 | var string: String { get } 30 | var tagString: String { get } 31 | var isAtom: Bool { get } 32 | var hash: Int { get } 33 | func equals(to expr: Expr) -> Bool 34 | func eqv(to expr: Expr) -> Bool 35 | func eq(to expr: Expr) -> Bool 36 | func mark(in gc: GarbageCollector) 37 | func unpack(in context: Context) -> Exprs 38 | } 39 | 40 | extension CustomExpr { 41 | public var string: String { 42 | return "#<\(self.tagString)>" 43 | } 44 | 45 | public var typeDescription: String { 46 | return self.type.description 47 | } 48 | 49 | public var isAtom: Bool { 50 | return true 51 | } 52 | 53 | public func eqv(to expr: Expr) -> Bool { 54 | return self.equals(to: expr) 55 | } 56 | 57 | public func eq(to expr: Expr) -> Bool { 58 | return self.equals(to: expr) 59 | } 60 | 61 | public func mark(in gc: GarbageCollector) { 62 | // do nothing by default 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Sources/LispKit/Data/Exprs.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Exprs.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 24/01/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | 22 | /// A sequence of expressions, represented as an array. 23 | public typealias Exprs = ContiguousArray 24 | 25 | /// An immutable empty set of expressions 26 | public let noExprs = Exprs() 27 | 28 | /// Equality function for sequences of expressions. 29 | public func ==(lhs: Exprs, rhs: Exprs) -> Bool { 30 | guard lhs.count == rhs.count else { 31 | return false 32 | } 33 | for i in lhs.indices { 34 | guard lhs[i] == rhs[i] else { 35 | return false 36 | } 37 | } 38 | return true 39 | } 40 | -------------------------------------------------------------------------------- /Sources/LispKit/Data/Tuple.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tuple.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 15/07/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | /// 22 | /// `Tuple` implements a mutable pair of expressions. 23 | /// 24 | public final class Tuple: ManagedObject, CustomStringConvertible { 25 | 26 | /// The current value of the variable. 27 | public var fst: Expr 28 | public var snd: Expr 29 | 30 | /// Create a new tuple with initial values for `fst` and `snd`. 31 | public init(_ fst: Expr = .undef, _ snd: Expr = .undef) { 32 | self.fst = fst 33 | self.snd = snd 34 | } 35 | 36 | /// Clear tuple 37 | public override func clean() { 38 | self.fst = .undef 39 | self.snd = .undef 40 | } 41 | 42 | /// A string representation of this tuple. 43 | public var description: String { 44 | return "«tuple \(self.fst), \(self.snd)»" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Sources/LispKit/IO/TextInputSource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TextInputSource.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 19/06/2016. 6 | // Copyright © 2016-2017 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | import Foundation 22 | 23 | /// 24 | /// Generalized source for a `TextInput` object. 25 | /// 26 | public protocol TextInputSource { 27 | var nextReadMightBlock: Bool { get } 28 | mutating func readString() -> String? 29 | } 30 | 31 | /// 32 | /// Default `TextInputSource` implementation for decoding UTF8 from a `BinaryInput` object. 33 | /// 34 | public struct UTF8EncodedSource: TextInputSource { 35 | private var input: BinaryInput 36 | private let length: Int 37 | private var codec: UTF8 38 | 39 | public init(input: BinaryInput, length: Int) { 40 | self.input = input 41 | self.length = length 42 | self.codec = UTF8() 43 | } 44 | 45 | public var nextReadMightBlock: Bool { 46 | return self.input.readMightBlock 47 | } 48 | 49 | /// Decodes the binary input as UTF8 and returns strings of at most 50 | /// `length` characters (where a character is a unicode scalar). 51 | public mutating func readString() -> String? { 52 | var str = "" 53 | for _ in 0.. Bool 28 | func writeString(_ str: String) -> Bool 29 | } 30 | 31 | /// 32 | /// Default `TextOutputSource` implementation for encoding strings via UTF8 into a 33 | /// `BinaryOutput` object. 34 | /// 35 | public struct UTF8EncodedTarget: TextOutputTarget { 36 | private let output: BinaryOutput 37 | 38 | public init(output: BinaryOutput) { 39 | self.output = output 40 | } 41 | 42 | @discardableResult public func flush(_ completely: Bool = false) -> Bool { 43 | return self.output.flush(completely) 44 | } 45 | 46 | public func writeString(_ str: String) -> Bool { 47 | for byte in str.utf8 { 48 | guard self.output.write(byte) else { 49 | return false 50 | } 51 | } 52 | return true 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Sources/LispKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en_US 7 | CFBundleDisplayName 8 | LispKit 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | NSHumanReadableCopyright 31 | Copyright © 2016–2025 Matthias Zenger. All rights reserved. 32 | NSPrincipalClass 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Sources/LispKit/LispKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // LispKit.h 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 14/01/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | #import 22 | 23 | // In this header, you should import all the public headers of your 24 | // framework using statements like #import 25 | 26 | //! Project version number for LispKit. 27 | FOUNDATION_EXPORT double LispKitVersionNumber; 28 | 29 | //! Project version string for LispKit. 30 | FOUNDATION_EXPORT const unsigned char LispKitVersionString[]; 31 | -------------------------------------------------------------------------------- /Sources/LispKit/Primitives/BaseLibrary.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseLibrary.swift 3 | // LispKit 4 | // 5 | // Created by Matthias Zenger on 23/01/2016. 6 | // Copyright © 2016 ObjectHub. All rights reserved. 7 | // 8 | // Licensed under the Apache License, Version 2.0 (the "License"); 9 | // you may not use this file except in compliance with the License. 10 | // You may obtain a copy of the License at 11 | // 12 | // http://www.apache.org/licenses/LICENSE-2.0 13 | // 14 | // Unless required by applicable law or agreed to in writing, software 15 | // distributed under the License is distributed on an "AS IS" BASIS, 16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | // See the License for the specific language governing permissions and 18 | // limitations under the License. 19 | // 20 | 21 | 22 | public final class BaseLibrary: NativeLibrary { 23 | 24 | /// Name of the library. 25 | public override class var name: [String] { 26 | return ["lispkit", "base"] 27 | } 28 | 29 | /// Exported definitions. 30 | public override func reexports() throws { 31 | try self.exportAll() 32 | } 33 | 34 | /// Dependencies of the library. 35 | public override func dependencies() { 36 | self.import(from: CoreLibrary.name) 37 | self.import(from: ControlFlowLibrary.name) 38 | self.import(from: SystemLibrary.name) 39 | self.import(from: BoxLibrary.name) 40 | self.import(from: MathLibrary.name) 41 | self.import(from: ListLibrary.name) 42 | self.import(from: HashTableLibrary.name) 43 | self.import(from: DynamicControlLibrary.name) 44 | self.import(from: TypeLibrary.name) 45 | self.import(from: VectorLibrary.name) 46 | self.import(from: RecordLibrary.name) 47 | self.import(from: BytevectorLibrary.name) 48 | self.import(from: CharLibrary.name) 49 | self.import(from: StringLibrary.name) 50 | self.import(from: PortLibrary.name) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/ColorLists/HtmlColors.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Sources/LispKit/Resources/Assets/ColorLists/HtmlColors.plist -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/Datasets/Covid/Covid.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Sources/LispKit/Resources/Assets/Datasets/Covid/Covid.sqlite3 -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/Images/Billboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Sources/LispKit/Resources/Assets/Images/Billboard.jpg -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/Images/Diagram.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Sources/LispKit/Resources/Assets/Images/Diagram.pdf -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/Images/Inga.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Sources/LispKit/Resources/Assets/Images/Inga.jpg -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/Images/LispkitLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Sources/LispKit/Resources/Assets/Images/LispkitLogo.png -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/Images/Page.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/objecthub/swift-lispkit/513544c7977270211daa4f766d7383f592ac88e7/Sources/LispKit/Resources/Assets/Images/Page.jpg -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Schema/2020-12/meta/applicator: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://json-schema.org/draft/2020-12/meta/applicator", 4 | "$dynamicAnchor": "meta", 5 | 6 | "title": "Applicator vocabulary meta-schema", 7 | "type": ["object", "boolean"], 8 | "properties": { 9 | "prefixItems": { "$ref": "#/$defs/schemaArray" }, 10 | "items": { "$dynamicRef": "#meta" }, 11 | "contains": { "$dynamicRef": "#meta" }, 12 | "additionalProperties": { "$dynamicRef": "#meta" }, 13 | "properties": { 14 | "type": "object", 15 | "additionalProperties": { "$dynamicRef": "#meta" }, 16 | "default": {} 17 | }, 18 | "patternProperties": { 19 | "type": "object", 20 | "additionalProperties": { "$dynamicRef": "#meta" }, 21 | "propertyNames": { "format": "regex" }, 22 | "default": {} 23 | }, 24 | "dependentSchemas": { 25 | "type": "object", 26 | "additionalProperties": { "$dynamicRef": "#meta" }, 27 | "default": {} 28 | }, 29 | "propertyNames": { "$dynamicRef": "#meta" }, 30 | "if": { "$dynamicRef": "#meta" }, 31 | "then": { "$dynamicRef": "#meta" }, 32 | "else": { "$dynamicRef": "#meta" }, 33 | "allOf": { "$ref": "#/$defs/schemaArray" }, 34 | "anyOf": { "$ref": "#/$defs/schemaArray" }, 35 | "oneOf": { "$ref": "#/$defs/schemaArray" }, 36 | "not": { "$dynamicRef": "#meta" } 37 | }, 38 | "$defs": { 39 | "schemaArray": { 40 | "type": "array", 41 | "minItems": 1, 42 | "items": { "$dynamicRef": "#meta" } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Schema/2020-12/meta/content: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://json-schema.org/draft/2020-12/meta/content", 4 | "$dynamicAnchor": "meta", 5 | 6 | "title": "Content vocabulary meta-schema", 7 | 8 | "type": ["object", "boolean"], 9 | "properties": { 10 | "contentEncoding": { "type": "string" }, 11 | "contentMediaType": { "type": "string" }, 12 | "contentSchema": { "$dynamicRef": "#meta" } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Schema/2020-12/meta/core: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://json-schema.org/draft/2020-12/meta/core", 4 | "$dynamicAnchor": "meta", 5 | 6 | "title": "Core vocabulary meta-schema", 7 | "type": ["object", "boolean"], 8 | "properties": { 9 | "$id": { 10 | "$ref": "#/$defs/uriReferenceString", 11 | "$comment": "Non-empty fragments not allowed.", 12 | "pattern": "^[^#]*#?$" 13 | }, 14 | "$schema": { "$ref": "#/$defs/uriString" }, 15 | "$ref": { "$ref": "#/$defs/uriReferenceString" }, 16 | "$anchor": { "$ref": "#/$defs/anchorString" }, 17 | "$dynamicRef": { "$ref": "#/$defs/uriReferenceString" }, 18 | "$dynamicAnchor": { "$ref": "#/$defs/anchorString" }, 19 | "$vocabulary": { 20 | "type": "object", 21 | "propertyNames": { "$ref": "#/$defs/uriString" }, 22 | "additionalProperties": { 23 | "type": "boolean" 24 | } 25 | }, 26 | "$comment": { 27 | "type": "string" 28 | }, 29 | "$defs": { 30 | "type": "object", 31 | "additionalProperties": { "$dynamicRef": "#meta" } 32 | } 33 | }, 34 | "$defs": { 35 | "anchorString": { 36 | "type": "string", 37 | "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" 38 | }, 39 | "uriString": { 40 | "type": "string", 41 | "format": "uri" 42 | }, 43 | "uriReferenceString": { 44 | "type": "string", 45 | "format": "uri-reference" 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Schema/2020-12/meta/format-annotation: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation", 4 | "$dynamicAnchor": "meta", 5 | 6 | "title": "Format vocabulary meta-schema for annotation results", 7 | "type": ["object", "boolean"], 8 | "properties": { 9 | "format": { "type": "string" } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Schema/2020-12/meta/meta-data: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://json-schema.org/draft/2020-12/meta/meta-data", 4 | "$dynamicAnchor": "meta", 5 | 6 | "title": "Meta-data vocabulary meta-schema", 7 | 8 | "type": ["object", "boolean"], 9 | "properties": { 10 | "title": { 11 | "type": "string" 12 | }, 13 | "description": { 14 | "type": "string" 15 | }, 16 | "default": true, 17 | "deprecated": { 18 | "type": "boolean", 19 | "default": false 20 | }, 21 | "readOnly": { 22 | "type": "boolean", 23 | "default": false 24 | }, 25 | "writeOnly": { 26 | "type": "boolean", 27 | "default": false 28 | }, 29 | "examples": { 30 | "type": "array", 31 | "items": true 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Schema/2020-12/meta/unevaluated: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", 3 | "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated", 4 | "$dynamicAnchor": "meta", 5 | 6 | "title": "Unevaluated applicator vocabulary meta-schema", 7 | "type": ["object", "boolean"], 8 | "properties": { 9 | "unevaluatedItems": { "$dynamicRef": "#meta" }, 10 | "unevaluatedProperties": { "$dynamicRef": "#meta" } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Schema/Custom/person: -------------------------------------------------------------------------------- 1 | { 2 | "$id": "https://lisppad.app/schema/person", 3 | "$schema": "https://json-schema.org/draft/2020-12/schema", 4 | "title": "person", 5 | "type": "object", 6 | "properties": { 7 | "name": { 8 | "type": "string", 9 | "minLength": 1 10 | }, 11 | "birthday": { 12 | "type": "string", 13 | "format": "date" 14 | }, 15 | "numChildren": { 16 | "type": "integer", 17 | "default": 0 18 | }, 19 | "address": { 20 | "oneOf": [ 21 | { 22 | "type": "string", 23 | "default": "12345 Mcity" 24 | }, 25 | { 26 | "$ref": "#address", 27 | "default": { 28 | "city": "Mcity", 29 | "postalCode": "12345" 30 | } 31 | } 32 | ] 33 | }, 34 | "email": { 35 | "type": "array", 36 | "maxItems": 3, 37 | "items": { 38 | "type": "string", 39 | "format": "email" 40 | } 41 | } 42 | }, 43 | "required": ["name", "birthday"], 44 | "$defs": { 45 | "address": { 46 | "$anchor": "address", 47 | "type": "object", 48 | "properties": { 49 | "street": { 50 | "type": "string" 51 | }, 52 | "city": { 53 | "type": "string" 54 | }, 55 | "postalCode": { 56 | "type": "string", 57 | "pattern": "\\d{5}" 58 | } 59 | }, 60 | "required": ["city", "postalCode"] 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Julian Berman 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/debug.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "order of evaluation: $id and $anchor and $ref", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "$id": "https://example.com/draft2020-12/ref-and-id2/base.json", 7 | "$ref": "#bigint", 8 | "$defs": { 9 | "bigint": { 10 | "$anchor": "bigint", 11 | "maximum": 10 12 | }, 13 | "smallint": { 14 | "$id": "https://example.com/draft2020-12/ref-and-id2/", 15 | "$anchor": "bigint", 16 | "maximum": 2 17 | } 18 | } 19 | }, 20 | "tests": [ 21 | { 22 | "description": "data is valid against first definition", 23 | "data": 5, 24 | "valid": true 25 | }, 26 | { 27 | "description": "data is invalid against first definition", 28 | "data": 50, 29 | "valid": false 30 | } 31 | ] 32 | } 33 | ] 34 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/defs.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "validate definition against metaschema", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "$ref": "https://json-schema.org/draft/2020-12/schema" 7 | }, 8 | "tests": [ 9 | { 10 | "description": "valid definition schema", 11 | "data": {"$defs": {"foo": {"type": "integer"}}}, 12 | "valid": true 13 | }, 14 | { 15 | "description": "invalid definition schema", 16 | "data": {"$defs": {"foo": {"type": 1}}}, 17 | "valid": false 18 | } 19 | ] 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/exclusiveMaximum.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "exclusiveMaximum validation", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "exclusiveMaximum": 3.0 7 | }, 8 | "tests": [ 9 | { 10 | "description": "below the exclusiveMaximum is valid", 11 | "data": 2.2, 12 | "valid": true 13 | }, 14 | { 15 | "description": "boundary point is invalid", 16 | "data": 3.0, 17 | "valid": false 18 | }, 19 | { 20 | "description": "above the exclusiveMaximum is invalid", 21 | "data": 3.5, 22 | "valid": false 23 | }, 24 | { 25 | "description": "ignores non-numbers", 26 | "data": "x", 27 | "valid": true 28 | } 29 | ] 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/exclusiveMinimum.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "exclusiveMinimum validation", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "exclusiveMinimum": 1.1 7 | }, 8 | "tests": [ 9 | { 10 | "description": "above the exclusiveMinimum is valid", 11 | "data": 1.2, 12 | "valid": true 13 | }, 14 | { 15 | "description": "boundary point is invalid", 16 | "data": 1.1, 17 | "valid": false 18 | }, 19 | { 20 | "description": "below the exclusiveMinimum is invalid", 21 | "data": 0.6, 22 | "valid": false 23 | }, 24 | { 25 | "description": "ignores non-numbers", 26 | "data": "x", 27 | "valid": true 28 | } 29 | ] 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/infinite-loop-detection.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "evaluating the same schema location against the same data location twice is not a sign of an infinite loop", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "$defs": { 7 | "int": { "type": "integer" } 8 | }, 9 | "allOf": [ 10 | { 11 | "properties": { 12 | "foo": { 13 | "$ref": "#/$defs/int" 14 | } 15 | } 16 | }, 17 | { 18 | "additionalProperties": { 19 | "$ref": "#/$defs/int" 20 | } 21 | } 22 | ] 23 | }, 24 | "tests": [ 25 | { 26 | "description": "passing case", 27 | "data": { "foo": 1 }, 28 | "valid": true 29 | }, 30 | { 31 | "description": "failing case", 32 | "data": { "foo": "a string" }, 33 | "valid": false 34 | } 35 | ] 36 | } 37 | ] 38 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/maxItems.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "maxItems validation", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "maxItems": 2 7 | }, 8 | "tests": [ 9 | { 10 | "description": "shorter is valid", 11 | "data": [1], 12 | "valid": true 13 | }, 14 | { 15 | "description": "exact length is valid", 16 | "data": [1, 2], 17 | "valid": true 18 | }, 19 | { 20 | "description": "too long is invalid", 21 | "data": [1, 2, 3], 22 | "valid": false 23 | }, 24 | { 25 | "description": "ignores non-arrays", 26 | "data": "foobar", 27 | "valid": true 28 | } 29 | ] 30 | }, 31 | { 32 | "description": "maxItems validation with a decimal", 33 | "schema": { 34 | "$schema": "https://json-schema.org/draft/2020-12/schema", 35 | "maxItems": 2.0 36 | }, 37 | "tests": [ 38 | { 39 | "description": "shorter is valid", 40 | "data": [1], 41 | "valid": true 42 | }, 43 | { 44 | "description": "too long is invalid", 45 | "data": [1, 2, 3], 46 | "valid": false 47 | } 48 | ] 49 | } 50 | ] 51 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/maxLength.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "maxLength validation", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "maxLength": 2 7 | }, 8 | "tests": [ 9 | { 10 | "description": "shorter is valid", 11 | "data": "f", 12 | "valid": true 13 | }, 14 | { 15 | "description": "exact length is valid", 16 | "data": "fo", 17 | "valid": true 18 | }, 19 | { 20 | "description": "too long is invalid", 21 | "data": "foo", 22 | "valid": false 23 | }, 24 | { 25 | "description": "ignores non-strings", 26 | "data": 100, 27 | "valid": true 28 | }, 29 | { 30 | "description": "two graphemes is long enough", 31 | "data": "\uD83D\uDCA9\uD83D\uDCA9", 32 | "valid": true 33 | } 34 | ] 35 | }, 36 | { 37 | "description": "maxLength validation with a decimal", 38 | "schema": { 39 | "$schema": "https://json-schema.org/draft/2020-12/schema", 40 | "maxLength": 2.0 41 | }, 42 | "tests": [ 43 | { 44 | "description": "shorter is valid", 45 | "data": "f", 46 | "valid": true 47 | }, 48 | { 49 | "description": "too long is invalid", 50 | "data": "foo", 51 | "valid": false 52 | } 53 | ] 54 | } 55 | ] 56 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/maximum.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "maximum validation", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "maximum": 3.0 7 | }, 8 | "tests": [ 9 | { 10 | "description": "below the maximum is valid", 11 | "data": 2.6, 12 | "valid": true 13 | }, 14 | { 15 | "description": "boundary point is valid", 16 | "data": 3.0, 17 | "valid": true 18 | }, 19 | { 20 | "description": "above the maximum is invalid", 21 | "data": 3.5, 22 | "valid": false 23 | }, 24 | { 25 | "description": "ignores non-numbers", 26 | "data": "x", 27 | "valid": true 28 | } 29 | ] 30 | }, 31 | { 32 | "description": "maximum validation with unsigned integer", 33 | "schema": { 34 | "$schema": "https://json-schema.org/draft/2020-12/schema", 35 | "maximum": 300 36 | }, 37 | "tests": [ 38 | { 39 | "description": "below the maximum is invalid", 40 | "data": 299.97, 41 | "valid": true 42 | }, 43 | { 44 | "description": "boundary point integer is valid", 45 | "data": 300, 46 | "valid": true 47 | }, 48 | { 49 | "description": "boundary point float is valid", 50 | "data": 300.00, 51 | "valid": true 52 | }, 53 | { 54 | "description": "above the maximum is invalid", 55 | "data": 300.5, 56 | "valid": false 57 | } 58 | ] 59 | } 60 | ] 61 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/minItems.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "minItems validation", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "minItems": 1 7 | }, 8 | "tests": [ 9 | { 10 | "description": "longer is valid", 11 | "data": [1, 2], 12 | "valid": true 13 | }, 14 | { 15 | "description": "exact length is valid", 16 | "data": [1], 17 | "valid": true 18 | }, 19 | { 20 | "description": "too short is invalid", 21 | "data": [], 22 | "valid": false 23 | }, 24 | { 25 | "description": "ignores non-arrays", 26 | "data": "", 27 | "valid": true 28 | } 29 | ] 30 | }, 31 | { 32 | "description": "minItems validation with a decimal", 33 | "schema": { 34 | "$schema": "https://json-schema.org/draft/2020-12/schema", 35 | "minItems": 1.0 36 | }, 37 | "tests": [ 38 | { 39 | "description": "longer is valid", 40 | "data": [1, 2], 41 | "valid": true 42 | }, 43 | { 44 | "description": "too short is invalid", 45 | "data": [], 46 | "valid": false 47 | } 48 | ] 49 | } 50 | ] 51 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/minLength.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "minLength validation", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "minLength": 2 7 | }, 8 | "tests": [ 9 | { 10 | "description": "longer is valid", 11 | "data": "foo", 12 | "valid": true 13 | }, 14 | { 15 | "description": "exact length is valid", 16 | "data": "fo", 17 | "valid": true 18 | }, 19 | { 20 | "description": "too short is invalid", 21 | "data": "f", 22 | "valid": false 23 | }, 24 | { 25 | "description": "ignores non-strings", 26 | "data": 1, 27 | "valid": true 28 | }, 29 | { 30 | "description": "one grapheme is not long enough", 31 | "data": "\uD83D\uDCA9", 32 | "valid": false 33 | } 34 | ] 35 | }, 36 | { 37 | "description": "minLength validation with a decimal", 38 | "schema": { 39 | "$schema": "https://json-schema.org/draft/2020-12/schema", 40 | "minLength": 2.0 41 | }, 42 | "tests": [ 43 | { 44 | "description": "longer is valid", 45 | "data": "foo", 46 | "valid": true 47 | }, 48 | { 49 | "description": "too short is invalid", 50 | "data": "f", 51 | "valid": false 52 | } 53 | ] 54 | } 55 | ] 56 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/minProperties.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "minProperties validation", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "minProperties": 1 7 | }, 8 | "tests": [ 9 | { 10 | "description": "longer is valid", 11 | "data": {"foo": 1, "bar": 2}, 12 | "valid": true 13 | }, 14 | { 15 | "description": "exact length is valid", 16 | "data": {"foo": 1}, 17 | "valid": true 18 | }, 19 | { 20 | "description": "too short is invalid", 21 | "data": {}, 22 | "valid": false 23 | }, 24 | { 25 | "description": "ignores arrays", 26 | "data": [], 27 | "valid": true 28 | }, 29 | { 30 | "description": "ignores strings", 31 | "data": "", 32 | "valid": true 33 | }, 34 | { 35 | "description": "ignores other non-objects", 36 | "data": 12, 37 | "valid": true 38 | } 39 | ] 40 | }, 41 | { 42 | "description": "minProperties validation with a decimal", 43 | "schema": { 44 | "$schema": "https://json-schema.org/draft/2020-12/schema", 45 | "minProperties": 1.0 46 | }, 47 | "tests": [ 48 | { 49 | "description": "longer is valid", 50 | "data": {"foo": 1, "bar": 2}, 51 | "valid": true 52 | }, 53 | { 54 | "description": "too short is invalid", 55 | "data": {}, 56 | "valid": false 57 | } 58 | ] 59 | } 60 | ] 61 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/minimum.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "minimum validation", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "minimum": 1.1 7 | }, 8 | "tests": [ 9 | { 10 | "description": "above the minimum is valid", 11 | "data": 2.6, 12 | "valid": true 13 | }, 14 | { 15 | "description": "boundary point is valid", 16 | "data": 1.1, 17 | "valid": true 18 | }, 19 | { 20 | "description": "below the minimum is invalid", 21 | "data": 0.6, 22 | "valid": false 23 | }, 24 | { 25 | "description": "ignores non-numbers", 26 | "data": "x", 27 | "valid": true 28 | } 29 | ] 30 | }, 31 | { 32 | "description": "minimum validation with signed integer", 33 | "schema": { 34 | "$schema": "https://json-schema.org/draft/2020-12/schema", 35 | "minimum": -2 36 | }, 37 | "tests": [ 38 | { 39 | "description": "negative above the minimum is valid", 40 | "data": -1, 41 | "valid": true 42 | }, 43 | { 44 | "description": "positive above the minimum is valid", 45 | "data": 0, 46 | "valid": true 47 | }, 48 | { 49 | "description": "boundary point is valid", 50 | "data": -2, 51 | "valid": true 52 | }, 53 | { 54 | "description": "boundary point with float is valid", 55 | "data": -2.0, 56 | "valid": true 57 | }, 58 | { 59 | "description": "float below the minimum is invalid", 60 | "data": -2.0001, 61 | "valid": false 62 | }, 63 | { 64 | "description": "int below the minimum is invalid", 65 | "data": -3, 66 | "valid": false 67 | }, 68 | { 69 | "description": "ignores non-numbers", 70 | "data": "x", 71 | "valid": true 72 | } 73 | ] 74 | } 75 | ] 76 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Assets/JSON/Tests/2020-12/pattern.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "pattern validation", 4 | "schema": { 5 | "$schema": "https://json-schema.org/draft/2020-12/schema", 6 | "pattern": "^a*$" 7 | }, 8 | "tests": [ 9 | { 10 | "description": "a matching pattern is valid", 11 | "data": "aaa", 12 | "valid": true 13 | }, 14 | { 15 | "description": "a non-matching pattern is invalid", 16 | "data": "abc", 17 | "valid": false 18 | }, 19 | { 20 | "description": "ignores booleans", 21 | "data": true, 22 | "valid": true 23 | }, 24 | { 25 | "description": "ignores integers", 26 | "data": 123, 27 | "valid": true 28 | }, 29 | { 30 | "description": "ignores floats", 31 | "data": 1.0, 32 | "valid": true 33 | }, 34 | { 35 | "description": "ignores objects", 36 | "data": {}, 37 | "valid": true 38 | }, 39 | { 40 | "description": "ignores arrays", 41 | "data": [], 42 | "valid": true 43 | }, 44 | { 45 | "description": "ignores null", 46 | "data": null, 47 | "valid": true 48 | } 49 | ] 50 | }, 51 | { 52 | "description": "pattern is not anchored", 53 | "schema": { 54 | "$schema": "https://json-schema.org/draft/2020-12/schema", 55 | "pattern": "a+" 56 | }, 57 | "tests": [ 58 | { 59 | "description": "matches a substring", 60 | "data": "xxaayy", 61 | "valid": true 62 | } 63 | ] 64 | } 65 | ] 66 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Examples/HTTP.scm: -------------------------------------------------------------------------------- 1 | ;;; HTTP GET demo 2 | ;;; 3 | ;;; This is a small example for how to use the LispKit-specific `http-get` 4 | ;;; function. `http-get` expects two parameters `url` and `timeout`. `url` 5 | ;;; refers to the URL from which content should be fetched. `timeout` is a 6 | ;;; floating point number defining the time in seconds it should take at 7 | ;;; most for receiving a response. `http-get` returns two values: the HTTP 8 | ;;; headers in form of an alist, and the content in form of a bytevector. 9 | ;;; The example below assumes that the content is a UTF8 encoded string. 10 | ;;; 11 | ;;; With the example functions below, it is possible to display this example 12 | ;;; code by fetching it from GitHub: 13 | ;;; (display (http-get-content "https://raw.githubusercontent.com/objecthub/swift-lispkit/master/Sources/LispKit/Resources/Examples/HTTP.scm")) 14 | ;;; 15 | ;;; There is also a way to open a web page in a browser by using the 16 | ;;; `open-url` function. The following code opens the GitHub page of LispKit 17 | ;;; in a browser: (open-url "https://github.com/objecthub/swift-lispkit") 18 | ;;; 19 | ;;; For more control and an asynchronous API, the library `(lispkit http)` 20 | ;;; provides a dedicated API for handling the HTTP protocol. 21 | ;;; 22 | ;;; Author: Matthias Zenger 23 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 24 | ;;; 25 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may 26 | ;;; not use this file except in compliance with the License. You may obtain 27 | ;;; a copy of the License at 28 | ;;; 29 | ;;; http://www.apache.org/licenses/LICENSE-2.0 30 | ;;; 31 | ;;; Unless required by applicable law or agreed to in writing, software 32 | ;;; distributed under the License is distributed on an "AS IS" BASIS, 33 | ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 34 | ;;; See the License for the specific language governing permissions and 35 | ;;; limitations under the License. 36 | 37 | (import (lispkit base)) 38 | 39 | (define (http-get-header url) 40 | (let-values (((header _) (http-get url))) 41 | header)) 42 | 43 | (define (http-get-content url) 44 | (let-values (((header content) (http-get url))) 45 | (utf8->string content))) 46 | 47 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Examples/Pi.scm: -------------------------------------------------------------------------------- 1 | ;;; Approximate Pi 2 | ;;; 3 | ;;; Example usage: (pi-as-string 200) 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may 9 | ;;; not use this file except in compliance with the License. You may obtain 10 | ;;; a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software 15 | ;;; distributed under the License is distributed on an "AS IS" BASIS, 16 | ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | ;;; See the License for the specific language governing permissions and 18 | ;;; limitations under the License. 19 | 20 | (import (lispkit base)) 21 | 22 | ;; Returns a string representation of pi with `n` decimal digits 23 | (define (pi-as-string n) 24 | (pi->string (approx-pi n))) 25 | 26 | ;; Returns a list of `n` decimal digits of pi 27 | (define (approx-pi n) 28 | (let ((u 0) (y 0) (j (+ n 2))) 29 | (do ((q 1 (* 10 q i (- (* 2 i) 1))) 30 | (r 180 (* 10 (- (+ (* q (- (* 5 i) 2)) r) (* y t)) u)) 31 | (t 60 (* t u)) 32 | (i 2 (+ i 1)) 33 | (res '() (cons y res))) 34 | ((> i j) (reverse res)) 35 | (set! u (* 3 (+ (* 3 i) 1) (+ (* 3 i) 2))) 36 | (set! y (floor-quotient (+ (* q (- (* 27 i) 12)) (* 5 r)) (* 5 t)))))) 37 | 38 | ;; Converts a list of decimal digits into a string representation of pi 39 | (define (pi->string xs) 40 | (let ((out (open-output-string))) 41 | (write-string "3." out) 42 | (for-each (lambda (x) (write x out)) (cdr xs)) 43 | (get-output-string out))) 44 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Examples/Queens.scm: -------------------------------------------------------------------------------- 1 | ;;; Solve n-queens problem 2 | ;;; 3 | ;;; Author: Matthias Zenger 4 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 5 | ;;; 6 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may 7 | ;;; not use this file except in compliance with the License. You may obtain 8 | ;;; a copy of the License at 9 | ;;; 10 | ;;; http://www.apache.org/licenses/LICENSE-2.0 11 | ;;; 12 | ;;; Unless required by applicable law or agreed to in writing, software 13 | ;;; distributed under the License is distributed on an "AS IS" BASIS, 14 | ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | ;;; See the License for the specific language governing permissions and 16 | ;;; limitations under the License. 17 | 18 | (import (lispkit base)) 19 | 20 | (define (queens n) 21 | (let try ((x 0) (y 0) (ps '()) (pss '())) 22 | (cond ((>= y n) ; all solutions found 23 | pss) 24 | ((>= x n) ; new solution found 25 | (cons (reverse ps) pss)) 26 | ((safe? (cons x y) ps) ; is the current position safe? 27 | (try x (+ y 1) ps (try (+ x 1) 0 (cons (cons x y) ps) pss))) 28 | (else 29 | (try x (+ y 1) ps pss))))) 30 | 31 | (define (safe? q ps) 32 | (cond ((null? ps) #t) 33 | ((reach? (car q) (cdr q) (caar ps) (cdar ps)) #f) 34 | (else (safe? q (cdr ps))))) 35 | 36 | (define (reach? x1 y1 x2 y2) 37 | (or (= x1 x2) (= y1 y2) (= (abs (- x1 x2)) (abs (- y1 y2))))) 38 | 39 | (define (pp-solutions pss n) 40 | (define (index p) (+ (* n (cdr p)) (car p))) 41 | (define (pp-board ps) 42 | (let ((board (make-vector (square n) "."))) 43 | (for-each (lambda (queen) (vector-set! board (index queen) "x")) ps) 44 | (let loop ((x 0) (y 0)) 45 | (cond ((>= y n) (newline)) 46 | ((>= x n) (newline) 47 | (loop 0 (+ 1 y))) 48 | (else (display (vector-ref board (index (cons x y)))) 49 | (loop (+ 1 x) y)))))) 50 | (display (string-append (number->string (length pss)) " SOLUTIONS FOR N = " (number->string n))) 51 | (newline) 52 | (newline) 53 | (for-each pp-board pss)) 54 | 55 | (do ((i 4 (+ i 1))) 56 | ((= i 9)) 57 | (pp-solutions (queens i) i)) 58 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/bitwise.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME BITWISE 2 | ;;; 3 | ;;; Library implementing bitwise numeric arithmetic. This library is part of the Scheme Tangerine 4 | ;;; edition of the R7RS large language. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2021 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme bitwise) 20 | 21 | (export bitwise-not 22 | bitwise-and 23 | bitwise-ior 24 | bitwise-xor 25 | bitwise-eqv 26 | bitwise-nand 27 | bitwise-nor 28 | bitwise-andc1 29 | bitwise-andc2 30 | bitwise-orc1 31 | bitwise-orc2 32 | arithmetic-shift 33 | bit-count 34 | integer-length 35 | bitwise-if 36 | bit-set? 37 | copy-bit 38 | bit-swap 39 | any-bit-set? 40 | every-bit-set? 41 | first-set-bit 42 | bit-field 43 | bit-field-any? 44 | bit-field-every? 45 | bit-field-clear 46 | bit-field-set 47 | bit-field-replace 48 | bit-field-replace-same 49 | bit-field-rotate 50 | bit-field-reverse 51 | bits->list 52 | list->bits 53 | bits->vector 54 | vector->bits 55 | bits 56 | bitwise-fold 57 | bitwise-for-each 58 | bitwise-unfold 59 | make-bitwise-generator) 60 | 61 | (import (srfi 151)) 62 | ) 63 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/box.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME BOX 2 | ;;; 3 | ;;; Scheme box library. This library is part of the Scheme Red edition of the R7RS 4 | ;;; large language. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme box) 20 | 21 | (export box 22 | box? 23 | unbox 24 | set-box!) 25 | 26 | (import (lispkit box)) 27 | ) 28 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/case-lambda.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME CASE-LAMBDA 2 | ;;; 3 | ;;; Library exporting the `case-lambda` form. This library is part of the R7RS standard. 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | ;;; except in compliance with the License. You may obtain a copy of the License at 10 | ;;; 11 | ;;; http://www.apache.org/licenses/LICENSE-2.0 12 | ;;; 13 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 14 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 15 | ;;; either express or implied. See the License for the specific language governing permissions 16 | ;;; and limitations under the License. 17 | 18 | (define-library (scheme case-lambda) 19 | 20 | (export case-lambda) 21 | 22 | (import (lispkit core)) 23 | ) 24 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/char.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME CHAR 2 | ;;; 3 | ;;; Library exporting character-related functions. This library is part of the R7RS standard. 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | ;;; except in compliance with the License. You may obtain a copy of the License at 10 | ;;; 11 | ;;; http://www.apache.org/licenses/LICENSE-2.0 12 | ;;; 13 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 14 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 15 | ;;; either express or implied. See the License for the specific language governing permissions 16 | ;;; and limitations under the License. 17 | 18 | (define-library (scheme char) 19 | (export char-alphabetic? 20 | char-ci<=? 21 | char-ci=? 24 | char-ci>? 25 | char-downcase 26 | char-foldcase 27 | char-lower-case? 28 | char-numeric? 29 | char-upcase 30 | char-upper-case? 31 | char-whitespace? 32 | digit-value 33 | string-ci<=? 34 | string-ci=? 37 | string-ci>? 38 | string-downcase 39 | string-foldcase 40 | string-upcase) 41 | 42 | (import (lispkit char) 43 | (lispkit string)) 44 | ) 45 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/comparator.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME COMPARATOR 2 | ;;; 3 | ;;; Library implementing comparators. This library is part of the Scheme Red edition of the 4 | ;;; R7RS large language. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme comparator) 20 | 21 | (export comparator? 22 | comparator-ordered? 23 | comparator-hashable? 24 | make-comparator 25 | make-pair-comparator 26 | make-list-comparator 27 | make-vector-comparator 28 | make-eq-comparator 29 | make-eqv-comparator 30 | make-equal-comparator 31 | boolean-hash 32 | char-hash 33 | char-ci-hash 34 | string-hash 35 | string-ci-hash 36 | symbol-hash 37 | number-hash 38 | hash-bound 39 | hash-salt 40 | make-default-comparator 41 | default-hash 42 | comparator-register-default! 43 | comparator-type-test-predicate 44 | comparator-equality-predicate 45 | comparator-ordering-predicate 46 | comparator-hash-function 47 | comparator-test-type 48 | comparator-check-type 49 | comparator-hash 50 | =? 51 | ? 53 | <=? 54 | >=? 55 | comparator-if<=>) 56 | 57 | (import (srfi 128)) 58 | ) 59 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/complex.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME COMPLEX 2 | ;;; 3 | ;;; Library exporting functions for handling complex numbers. This library is part of the 4 | ;;; R7RS standard. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme complex) 20 | 21 | (export angle 22 | imag-part 23 | magnitude 24 | make-polar 25 | make-rectangular 26 | real-part) 27 | 28 | (import (lispkit math)) 29 | ) 30 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/cxr.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME CXR 2 | ;;; 3 | ;;; Library exporting shortcuts for combinations of `car` and `cdr`. This library is part of 4 | ;;; the R7RS standard. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme cxr) 20 | 21 | (export caaar 22 | caadr 23 | cadar 24 | caddr 25 | cdaar 26 | cdadr 27 | cddar 28 | cdddr 29 | caaaar 30 | caaadr 31 | caadar 32 | caaddr 33 | cadaar 34 | cadadr 35 | caddar 36 | cadddr 37 | cdaaar 38 | cdaadr 39 | cdadar 40 | cdaddr 41 | cddaar 42 | cddadr 43 | cdddar 44 | cddddr) 45 | 46 | (import (lispkit list)) 47 | ) 48 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/eval.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME EVAL 2 | ;;; 3 | ;;; Library exporting `eval` and `environment`. This library is part of the R7RS standard. 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | ;;; except in compliance with the License. You may obtain a copy of the License at 10 | ;;; 11 | ;;; http://www.apache.org/licenses/LICENSE-2.0 12 | ;;; 13 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 14 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 15 | ;;; either express or implied. See the License for the specific language governing permissions 16 | ;;; and limitations under the License. 17 | 18 | (define-library (scheme eval) 19 | 20 | (export eval 21 | environment) 22 | 23 | (import (lispkit core)) 24 | ) 25 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/file.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME FILE 2 | ;;; 3 | ;;; Library exporting file-related functions. This library is part of the R7RS standard. 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | ;;; except in compliance with the License. You may obtain a copy of the License at 10 | ;;; 11 | ;;; http://www.apache.org/licenses/LICENSE-2.0 12 | ;;; 13 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 14 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 15 | ;;; either express or implied. See the License for the specific language governing permissions 16 | ;;; and limitations under the License. 17 | 18 | (define-library (scheme file) 19 | 20 | (export call-with-input-file 21 | call-with-output-file 22 | delete-file 23 | file-exists? 24 | open-binary-input-file 25 | open-binary-output-file 26 | open-input-file 27 | open-output-file 28 | with-input-from-file 29 | with-output-to-file) 30 | 31 | (import (lispkit port) 32 | (lispkit system)) 33 | ) 34 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/fixnum.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME FIXNUM 2 | ;;; 3 | ;;; Scheme fixnum library. This library is part of the Scheme Tangerine edition of the R7RS 4 | ;;; large language. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2021 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme fixnum) 20 | 21 | (export fx-width 22 | fx-greatest 23 | fx-least 24 | fixnum? 25 | fx=? 26 | fx? 28 | fx<=? 29 | fx>=? 30 | fxzero? 31 | fxpositive? 32 | fxnegative? 33 | fxodd? 34 | fxeven? 35 | fxmax 36 | fxmin 37 | fxneg 38 | fx+ 39 | fx- 40 | fx* 41 | fxquotient 42 | fxremainder 43 | fxabs 44 | fxsquare 45 | fxsqrt 46 | fx+/carry 47 | fx-/carry 48 | fx*/carry 49 | fxnot 50 | fxand 51 | fxior 52 | fxxor 53 | fxarithmetic-shift 54 | fxarithmetic-shift-left 55 | fxarithmetic-shift-right 56 | fxbit-count 57 | fxlength 58 | fxif 59 | fxbit-set? 60 | fxcopy-bit 61 | fxfirst-set-bit 62 | fxbit-field 63 | fxbit-field-rotate 64 | fxbit-field-reverse) 65 | 66 | (import (srfi 143)) 67 | ) 68 | 69 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/generator.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME GENERATOR 2 | ;;; 3 | ;;; Library implementing generators. This library is part of the Scheme Red edition of the 4 | ;;; R7RS large language. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme generator) 20 | 21 | (export generator 22 | make-iota-generator 23 | make-range-generator 24 | make-coroutine-generator 25 | list->generator 26 | vector->generator 27 | reverse-vector->generator 28 | string->generator 29 | bytevector->generator 30 | make-for-each-generator 31 | make-unfold-generator 32 | gcons* 33 | gappend 34 | gcombine 35 | gfilter 36 | gremove 37 | gtake 38 | gdrop 39 | gtake-while 40 | gdrop-while 41 | gdelete 42 | gdelete-neighbor-dups 43 | gindex 44 | gselect 45 | generator->list 46 | generator->reverse-list 47 | generator->vector 48 | generator->vector! 49 | generator->string 50 | generator-fold 51 | generator-for-each 52 | generator-find 53 | generator-count 54 | generator-any 55 | generator-every 56 | generator-unfold) 57 | 58 | (import (srfi 121)) 59 | ) 60 | 61 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/hash-table.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME HASH-TABLE 2 | ;;; 3 | ;;; Scheme hashtable library. This library is part of the Scheme Red edition of the R7RS 4 | ;;; large language. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme hash-table) 20 | 21 | (export make-hash-table 22 | hash-table 23 | hash-table-unfold 24 | alist->hash-table 25 | hash-table? 26 | hash-table-contains? 27 | hash-table-exists? 28 | hash-table-empty? 29 | hash-table=? 30 | hash-table-mutable? 31 | hash-table-ref 32 | hash-table-ref/default 33 | hash-table-set! 34 | hash-table-delete! 35 | hash-table-intern! 36 | hash-table-update! 37 | hash-table-update!/default 38 | hash-table-pop! 39 | hash-table-clear! 40 | hash-table-size 41 | hash-table-keys 42 | hash-table-values 43 | hash-table-entries 44 | hash-table-find 45 | hash-table-count 46 | hash-table-map 47 | hash-table-for-each 48 | hash-table-walk 49 | hash-table-map! 50 | hash-table-map->list 51 | hash-table-fold 52 | hash-table-prune! 53 | hash-table-copy 54 | hash-table-empty-copy 55 | hash-table->alist 56 | hash-table-union! 57 | hash-table-merge! 58 | hash-table-intersection! 59 | hash-table-difference! 60 | hash-table-xor! 61 | hash 62 | string-hash 63 | string-ci-hash 64 | hash-by-identity 65 | hash-table-equivalence-function 66 | hash-table-hash-function) 67 | 68 | (import (srfi 125)) 69 | ) 70 | 71 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/ideque.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME IDEQUE 2 | ;;; 3 | ;;; Library implementing immutable deques. This library is part of the Scheme Red edition of 4 | ;;; the R7RS large language. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme ideque) 20 | 21 | (export ideque 22 | ideque-tabulate 23 | ideque-unfold 24 | ideque-unfold-right 25 | ideque? 26 | ideque-empty? 27 | ideque= 28 | ideque-any 29 | ideque-every 30 | ideque-front 31 | ideque-add-front 32 | ideque-remove-front 33 | ideque-back 34 | ideque-add-back 35 | ideque-remove-back 36 | ideque-ref 37 | ideque-take 38 | ideque-take-right 39 | ideque-drop 40 | ideque-drop-right 41 | ideque-split-at 42 | ideque-length 43 | ideque-append 44 | ideque-reverse 45 | ideque-count 46 | ideque-zip 47 | ideque-map 48 | ideque-filter-map 49 | ideque-for-each 50 | ideque-for-each-right 51 | ideque-fold 52 | ideque-fold-right 53 | ideque-append-map 54 | ideque-filter 55 | ideque-remove 56 | ideque-partition 57 | ideque-find 58 | ideque-find-right 59 | ideque-take-while 60 | ideque-take-while-right 61 | ideque-drop-while 62 | ideque-drop-while-right 63 | ideque-span 64 | ideque-break 65 | list->ideque 66 | ideque->list 67 | generator->ideque 68 | ideque->generator) 69 | 70 | (import (srfi 134)) 71 | ) 72 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/inexact.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME INEXACT 2 | ;;; 3 | ;;; Library exporting inexact mathematical functions. This library is part of the R7RS standard. 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | ;;; except in compliance with the License. You may obtain a copy of the License at 10 | ;;; 11 | ;;; http://www.apache.org/licenses/LICENSE-2.0 12 | ;;; 13 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 14 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 15 | ;;; either express or implied. See the License for the specific language governing permissions 16 | ;;; and limitations under the License. 17 | 18 | (define-library (scheme inexact) 19 | 20 | (export acos 21 | asin 22 | atan 23 | cos 24 | exp 25 | finite? 26 | infinite? 27 | log 28 | nan? 29 | sin 30 | sqrt 31 | tan) 32 | 33 | (import (lispkit math)) 34 | ) 35 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/lazy.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME LAZY 2 | ;;; 3 | ;;; Library implementing promises. This library is part of the R7RS standard. 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | ;;; except in compliance with the License. You may obtain a copy of the License at 10 | ;;; 11 | ;;; http://www.apache.org/licenses/LICENSE-2.0 12 | ;;; 13 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 14 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 15 | ;;; either express or implied. See the License for the specific language governing permissions 16 | ;;; and limitations under the License. 17 | 18 | (define-library (scheme lazy) 19 | 20 | (export delay 21 | delay-force 22 | force 23 | make-promise 24 | promise?) 25 | 26 | (import (lispkit core)) 27 | ) 28 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/load.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME LOAD 2 | ;;; 3 | ;;; Library exporting the `load` function. This library is part of the R7RS standard. 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | ;;; except in compliance with the License. You may obtain a copy of the License at 10 | ;;; 11 | ;;; http://www.apache.org/licenses/LICENSE-2.0 12 | ;;; 13 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 14 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 15 | ;;; either express or implied. See the License for the specific language governing permissions 16 | ;;; and limitations under the License. 17 | 18 | (define-library (scheme load) 19 | 20 | (export load) 21 | 22 | (import (lispkit system)) 23 | ) 24 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/process-context.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME PROCESS-CONTEXT 2 | ;;; 3 | ;;; Library exporting command-line related functions. This library is part of the 4 | ;;; R7RS standard. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme process-context) 20 | 21 | (export command-line 22 | exit 23 | emergency-exit 24 | get-environment-variable 25 | get-environment-variables) 26 | 27 | (import (lispkit system) 28 | (lispkit dynamic)) 29 | ) 30 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/r5rs-syntax.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME R5RS-SYNTAX 2 | ;;; 3 | ;;; Library exporting syntax definitions from R5RS. This library is used to implement 4 | ;;; `null-environment`. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme r5rs-syntax) 20 | 21 | (export and 22 | begin 23 | case 24 | cond 25 | define 26 | define-syntax 27 | delay 28 | do 29 | if 30 | lambda 31 | let 32 | let-syntax 33 | let* 34 | letrec 35 | letrec-syntax 36 | or 37 | quasiquote 38 | quote 39 | set! 40 | syntax-rules) 41 | 42 | (import (lispkit base)) 43 | ) 44 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/read.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME READ 2 | ;;; 3 | ;;; Library exporting `read`. This library is part of the R7RS standard. 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | ;;; except in compliance with the License. You may obtain a copy of the License at 10 | ;;; 11 | ;;; http://www.apache.org/licenses/LICENSE-2.0 12 | ;;; 13 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 14 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 15 | ;;; either express or implied. See the License for the specific language governing permissions 16 | ;;; and limitations under the License. 17 | 18 | (define-library (scheme read) 19 | 20 | (export read) 21 | 22 | (import (lispkit port)) 23 | ) 24 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/repl.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME REPL 2 | ;;; 3 | ;;; Library exporting `interaction-environment`. This library is part of the R7RS standard. 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | ;;; except in compliance with the License. You may obtain a copy of the License at 10 | ;;; 11 | ;;; http://www.apache.org/licenses/LICENSE-2.0 12 | ;;; 13 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 14 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 15 | ;;; either express or implied. See the License for the specific language governing permissions 16 | ;;; and limitations under the License. 17 | 18 | (define-library (scheme repl) 19 | 20 | (export interaction-environment) 21 | 22 | (import (lispkit core)) 23 | ) 24 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/sort.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME SORT 2 | ;;; 3 | ;;; Scheme sorting library. This library is part of the Scheme Red edition of the R7RS 4 | ;;; large language. It is incomplete in that it does not support mutable list-related 5 | ;;; procedures due to LispKit's lists being immutable. The following procedures are 6 | ;;; missing: `list-delete-neighbor-dups!`, `list-merge!`, `list-sort!`, `list-stable-sort!`. 7 | ;;; 8 | ;;; Author: Matthias Zenger 9 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 10 | ;;; 11 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 12 | ;;; except in compliance with the License. You may obtain a copy of the License at 13 | ;;; 14 | ;;; http://www.apache.org/licenses/LICENSE-2.0 15 | ;;; 16 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 17 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 18 | ;;; either express or implied. See the License for the specific language governing permissions 19 | ;;; and limitations under the License. 20 | 21 | (define-library (scheme sort) 22 | 23 | (export list-sorted? 24 | vector-sorted? 25 | list-sort 26 | list-stable-sort 27 | ; list-sort! 28 | ; list-stable-sort! 29 | vector-sort 30 | vector-stable-sort 31 | vector-sort! 32 | vector-stable-sort! 33 | list-merge 34 | ; list-merge! 35 | vector-merge 36 | vector-merge! 37 | list-delete-neighbor-dups 38 | ; list-delete-neighbor-dups! 39 | vector-delete-neighbor-dups 40 | vector-delete-neighbor-dups! 41 | vector-find-median 42 | vector-find-median! 43 | vector-select! 44 | vector-separate!) 45 | 46 | (import (srfi 132)) 47 | ) 48 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/stream.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME STREAM 2 | ;;; 3 | ;;; Scheme stream library. This library is part of the Scheme Red edition of the R7RS 4 | ;;; large language. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme stream) 20 | 21 | (export stream-null 22 | stream-cons 23 | stream? 24 | stream-null? 25 | stream-pair? 26 | stream-car 27 | stream-cdr 28 | stream-lambda 29 | define-stream 30 | list->stream 31 | port->stream 32 | stream 33 | stream->list 34 | stream-append 35 | stream-concat 36 | stream-constant 37 | stream-drop 38 | stream-drop-while 39 | stream-filter 40 | stream-fold 41 | stream-for-each 42 | stream-from 43 | stream-iterate 44 | stream-length 45 | stream-let 46 | stream-map 47 | stream-match 48 | stream-of 49 | stream-range 50 | stream-ref 51 | stream-reverse 52 | stream-scan 53 | stream-take 54 | stream-take-while 55 | stream-unfold 56 | stream-unfolds 57 | stream-zip) 58 | 59 | (import (srfi 41)) 60 | ) 61 | 62 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/time.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME TIME 2 | ;;; 3 | ;;; Library exporting time-related functions. This library is part of the R7RS standard. 4 | ;;; 5 | ;;; Author: Matthias Zenger 6 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 7 | ;;; 8 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 9 | ;;; except in compliance with the License. You may obtain a copy of the License at 10 | ;;; 11 | ;;; http://www.apache.org/licenses/LICENSE-2.0 12 | ;;; 13 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 14 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 15 | ;;; either express or implied. See the License for the specific language governing permissions 16 | ;;; and limitations under the License. 17 | 18 | (define-library (scheme time) 19 | 20 | (export current-jiffy 21 | current-second 22 | jiffies-per-second) 23 | 24 | (import (lispkit system)) 25 | ) 26 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/vector.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME VECTOR 2 | ;;; 3 | ;;; Scheme vector library. This library is part of the Scheme Red edition of the R7RS 4 | ;;; large language. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme vector) 20 | 21 | (export make-vector 22 | vector 23 | vector-unfold 24 | vector-unfold-right 25 | vector-copy 26 | vector-reverse-copy 27 | vector-append 28 | vector-concatenate 29 | vector-append-subvectors 30 | vector? 31 | vector-empty? 32 | vector= 33 | vector-ref 34 | vector-length 35 | vector-fold 36 | vector-fold-right 37 | vector-map 38 | vector-map! 39 | vector-for-each 40 | vector-count 41 | vector-cumulate 42 | vector-index 43 | vector-index-right 44 | vector-skip 45 | vector-skip-right 46 | vector-binary-search 47 | vector-any vector-every 48 | vector-partition 49 | vector-set! 50 | vector-swap! 51 | vector-fill! 52 | vector-reverse! 53 | vector-copy! 54 | vector-reverse-copy! 55 | vector-unfold! 56 | vector-unfold-right! 57 | vector->list 58 | reverse-vector->list 59 | list->vector 60 | reverse-list->vector 61 | vector->string 62 | string->vector) 63 | 64 | (import (except (lispkit vector) vector-map!) 65 | (srfi 133)) 66 | ) 67 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/scheme/write.sld: -------------------------------------------------------------------------------- 1 | ;;; SCHEME WRITE 2 | ;;; 3 | ;;; Library exporting functions for writing data structures. This library is part of 4 | ;;; the R7RS standard. 5 | ;;; 6 | ;;; Author: Matthias Zenger 7 | ;;; Copyright © 2017 Matthias Zenger. All rights reserved. 8 | ;;; 9 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 10 | ;;; except in compliance with the License. You may obtain a copy of the License at 11 | ;;; 12 | ;;; http://www.apache.org/licenses/LICENSE-2.0 13 | ;;; 14 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 15 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 16 | ;;; either express or implied. See the License for the specific language governing permissions 17 | ;;; and limitations under the License. 18 | 19 | (define-library (scheme write) 20 | 21 | (export display 22 | write 23 | write-shared 24 | write-simple) 25 | 26 | (import (lispkit port)) 27 | ) 28 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/srfi/102.sld: -------------------------------------------------------------------------------- 1 | ;;; SRFI 102 2 | ;;; Procedure Arity Inspection 3 | ;;; 4 | ;;; This SRFI identifies a common, core set of operations that make it possible to 5 | ;;; inspect the arity of procedures and determine if a given procedure accepts a 6 | ;;; given number of arguments. 7 | ;;; 8 | ;;; Author of spec: David Van Horn 9 | ;;; 10 | ;;; Copyright © 2021 Matthias Zenger. All rights reserved. 11 | ;;; 12 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 13 | ;;; except in compliance with the License. You may obtain a copy of the License at 14 | ;;; 15 | ;;; http://www.apache.org/licenses/LICENSE-2.0 16 | ;;; 17 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 18 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 19 | ;;; either express or implied. See the License for the specific language governing permissions 20 | ;;; and limitations under the License. 21 | 22 | (define-library (srfi 102) 23 | 24 | (export procedure-arity 25 | arity-at-least? 26 | arity-at-least-value 27 | procedure-arity-includes?) 28 | 29 | (import (lispkit core)) 30 | ) 31 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/srfi/11.sld: -------------------------------------------------------------------------------- 1 | ;;; SRFI 11 2 | ;;; Syntax for receiving multiple values 3 | ;;; 4 | ;;; The SRFI introduces syntactic forms `let-values` and `let*-values` that bind the values 5 | ;;; of expressions that return multiple values. 6 | ;;; 7 | ;;; Author of spec: Lars T Hansen 8 | ;;; 9 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 10 | ;;; 11 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 12 | ;;; except in compliance with the License. You may obtain a copy of the License at 13 | ;;; 14 | ;;; http://www.apache.org/licenses/LICENSE-2.0 15 | ;;; 16 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 17 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 18 | ;;; either express or implied. See the License for the specific language governing permissions 19 | ;;; and limitations under the License. 20 | 21 | (define-library (srfi 11) 22 | 23 | (export let-values 24 | let*-values) 25 | 26 | (import (lispkit control)) 27 | 28 | ;; Both forms are implemented natively in library `(lispkit control)` 29 | ) 30 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/srfi/111.sld: -------------------------------------------------------------------------------- 1 | ;;; SRFI 111 2 | ;;; Boxes 3 | ;;; 4 | ;;; Boxes are objects with a single mutable state. Several Schemes have them, sometimes 5 | ;;; called cells. A constructor, predicate, accessor, and mutator are provided. 6 | ;;; 7 | ;;; Copyright © 2013 John Cowan. All rights reserved. 8 | ;;; 9 | ;;; Permission is hereby granted, free of charge, to any person obtaining a copy of this 10 | ;;; software and associated documentation files (the "Software"), to deal in the Software 11 | ;;; without restriction, including without limitation the rights to use, copy, modify, merge, 12 | ;;; publish, distribute, sublicense, and/or sell copies of the Software, and to permit 13 | ;;; persons to whom the Software is furnished to do so, subject to the following conditions: 14 | ;;; 15 | ;;; The above copyright notice and this permission notice shall be included in all copies or 16 | ;;; substantial portions of the Software. 17 | ;;; 18 | ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 19 | ;;; INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 20 | ;;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 21 | ;;; FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 22 | ;;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | ;;; DEALINGS IN THE SOFTWARE. 24 | ;;; 25 | ;;; Adaptation to LispKit 26 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 27 | 28 | (define-library (srfi 111) 29 | (export box? 30 | box 31 | unbox 32 | set-box!) 33 | (import (lispkit base)) 34 | ) 35 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/srfi/112.sld: -------------------------------------------------------------------------------- 1 | ;;; SRFI 112 2 | ;;; Environment Inquiry 3 | ;;; 4 | ;;; This is a library supporting environment inquiry, providing human-readable information 5 | ;;; at run time about the hardware and software configuration on which a Scheme program is 6 | ;;; being executed. They are mostly based on Common Lisp, with additions from the Posix 7 | ;;; `uname()` system call. 8 | ;;; 9 | ;;; Copyright © 2013 John Cowan. All rights reserved. 10 | ;;; 11 | ;;; Permission is hereby granted, free of charge, to any person obtaining a copy of this 12 | ;;; software and associated documentation files (the "Software"), to deal in the Software 13 | ;;; without restriction, including without limitation the rights to use, copy, modify, merge, 14 | ;;; publish, distribute, sublicense, and/or sell copies of the Software, and to permit 15 | ;;; persons to whom the Software is furnished to do so, subject to the following conditions: 16 | ;;; 17 | ;;; The above copyright notice and this permission notice shall be included in all copies or 18 | ;;; substantial portions of the Software. 19 | ;;; 20 | ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 21 | ;;; INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 22 | ;;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 23 | ;;; FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 24 | ;;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | ;;; DEALINGS IN THE SOFTWARE. 26 | ;;; 27 | ;;; Adaptation to LispKit 28 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 29 | 30 | (define-library (srfi 112) 31 | (export implementation-name 32 | implementation-version 33 | cpu-architecture 34 | machine-name 35 | os-type 36 | os-version) 37 | (import (lispkit base)) 38 | ) 39 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/srfi/118.sld: -------------------------------------------------------------------------------- 1 | ;;; SRFI 118 2 | ;;; Simple adjustable-size strings 3 | ;;; 4 | ;;; Scheme specifies mutable fixed-length strings. We add two procedures 5 | ;;; `string-append!` and `string-replace!` which allow the size of the string 6 | ;;; to change. We also require that the standard Scheme procedures `make-string` 7 | ;;; and `string-copy` return variable-size strings. 8 | ;;; 9 | ;;; Specification: 10 | ;;; Copyright © 2015 Per Bothner. All rights reserved. 11 | ;;; 12 | ;;; Implementation: 13 | ;;; Copyright © 2022 Matthias Zenger. All rights reserved. 14 | ;;; 15 | ;;; Permission is hereby granted, free of charge, to any person obtaining a copy 16 | ;;; of this software and associated documentation files (the "Software"), to deal 17 | ;;; in the Software without restriction, including without limitation the rights 18 | ;;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | ;;; copies of the Software, and to permit persons to whom the Software is 20 | ;;; furnished to do so, subject to the following conditions: 21 | ;;; 22 | ;;; The above copyright notice and this permission notice shall be included in 23 | ;;; all copies or substantial portions of the Software. 24 | ;;; 25 | ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | ;;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | ;;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | ;;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | ;;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 30 | ;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 31 | ;;; DEALINGS IN THE SOFTWARE. 32 | 33 | (define-library (srfi 118) 34 | 35 | (export string-append! 36 | string-replace!) 37 | 38 | (import (except (lispkit base) string-replace!)) 39 | 40 | (begin 41 | (define (string-replace! dst dst-start dst-end src . args) 42 | (let-optionals args ((start 0) 43 | (end (string-length src))) 44 | (string-insert! dst (substring src start end) dst-start dst-end))) 45 | ) 46 | ) 47 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/srfi/131.sld: -------------------------------------------------------------------------------- 1 | ;;; SRFI 131 2 | ;;; ERR5RS Record Syntax (reduced) 3 | ;;; 4 | ;;; This SRFI is a reduced version of the SRFI 99 syntactic layer that can be 5 | ;;; implemented with syntax-rules without requiring low-level macros. Like 6 | ;;; SRFI-99's syntax layer, it is backward compatible with the `define-record-type` 7 | ;;; macro from SRFI 9 or R7RS-small. It is forward compatible with SRFI 99. 8 | ;;; 9 | ;;; Author of spec: John Cowan, Will Clinger 10 | ;;; 11 | ;;; Copyright © 2023 Matthias Zenger. All rights reserved. 12 | ;;; 13 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 14 | ;;; except in compliance with the License. You may obtain a copy of the License at 15 | ;;; 16 | ;;; http://www.apache.org/licenses/LICENSE-2.0 17 | ;;; 18 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 19 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 20 | ;;; either express or implied. See the License for the specific language governing permissions 21 | ;;; and limitations under the License. 22 | 23 | (define-library (srfi 131) 24 | 25 | (export define-record-type) 26 | 27 | (import (lispkit record)) 28 | 29 | ;; The form is implemented natively in library `(lispkit record)` 30 | ) 31 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/srfi/137.sld: -------------------------------------------------------------------------------- 1 | ;;; SRFI 137 2 | ;;; Minimal Unique Types 3 | ;;; 4 | ;;; This SRFI is intended to standardize a primitive run-time mechanism to create 5 | ;;; disjoint types. This mechanism provides a simple hook to create new data types at 6 | ;;; run time that are disjoint from all existing types. allowing portable libraries to 7 | ;;; implement SRFI 9, SRFI 99, SRFI 131, SRFI 135, R6RS records, Chicken records, CLOS, 8 | ;;; persistent databases, remote access to data on servers, and the like on top of it. 9 | ;;; It is also portably implementable and usable entirely separately from any of these. 10 | ;;; 11 | ;;; Note that there is no concept of a type object here: a type is simply a name for a 12 | ;;; group of closely linked procedures that allow the creation and manipulation of type 13 | ;;; instances (which are objects) and subtypes. This SRFI exposes no ambient authority, 14 | ;;; and relies entirely on module exports for access control. 15 | ;;; 16 | ;;; Author of spec: John Cowan, Marc Nieper-Wißkirchen 17 | ;;; 18 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 19 | ;;; 20 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 21 | ;;; except in compliance with the License. You may obtain a copy of the License at 22 | ;;; 23 | ;;; http://www.apache.org/licenses/LICENSE-2.0 24 | ;;; 25 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 26 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 27 | ;;; either express or implied. See the License for the specific language governing permissions 28 | ;;; and limitations under the License. 29 | 30 | (define-library (srfi 137) 31 | (export make-type) 32 | (import (rename (lispkit base) 33 | (make-type native-make-type))) 34 | 35 | (begin 36 | (define (make-make-type mk-type) 37 | (lambda (payload) 38 | (let-values (((tpe constructor predicate accessor mk-subtype) (mk-type payload))) 39 | (values (lambda () payload) 40 | constructor 41 | predicate 42 | accessor 43 | (make-make-type mk-subtype))))) 44 | 45 | (define make-type (make-make-type native-make-type)) 46 | ) 47 | ) 48 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/srfi/145.sld: -------------------------------------------------------------------------------- 1 | ;;; SRFI 145 2 | ;;; Assumptions 3 | ;;; 4 | ;;; This SRFI specifies a means to denote the invalidity of certain code paths in a 5 | ;;; Scheme program. It allows Scheme code to turn the evaluation into a user-defined 6 | ;;; error that need not be signalled by the implementation. Optimizing compilers may 7 | ;;; use these denotations to produce better code and to issue better warnings about 8 | ;;; dead code. 9 | ;;; 10 | ;;; Author of spec: Marc Nieper-Wißkirchen 11 | ;;; 12 | ;;; Copyright © 2018 Matthias Zenger. All rights reserved. 13 | ;;; 14 | ;;; Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 15 | ;;; except in compliance with the License. You may obtain a copy of the License at 16 | ;;; 17 | ;;; http://www.apache.org/licenses/LICENSE-2.0 18 | ;;; 19 | ;;; Unless required by applicable law or agreed to in writing, software distributed under the 20 | ;;; License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 21 | ;;; either express or implied. See the License for the specific language governing permissions 22 | ;;; and limitations under the License. 23 | 24 | (define-library (srfi 145) 25 | (export assume) 26 | (import (lispkit base)) 27 | 28 | (begin 29 | (define-syntax assume 30 | (syntax-rules () 31 | ((_ expression message ...) 32 | (unless expression (error "invalid assumption" (quote expression) message ...))))) 33 | ) 34 | ) 35 | -------------------------------------------------------------------------------- /Sources/LispKit/Resources/Libraries/srfi/149.sld: -------------------------------------------------------------------------------- 1 | ;;; SRFI 149 2 | ;;; Basic syntax-rules template extensions 3 | ;;; 4 | ;;; The rules for valid `