Skip to content

Commit 613719c

Browse files
committed
Include (srfi 177). Refactor library list in README.
1 parent 6c14460 commit 613719c

File tree

9 files changed

+141
-25
lines changed

9 files changed

+141
-25
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.8.1 (2019-10-20)
4+
- Update dependency on NumberKit 2.3.2
5+
- New libraries: `(srfi 174)`, `(srfi 177)`
6+
37
## 1.8 (2019-10-17)
48
- Migrated project to Xcode 11.1
59
- Ported code to Swift 5.1

LispKit.xcodeproj/project.pbxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
CC6A3B721C54DF7F00E962E2 /* Exprs.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC6A3B711C54DF7F00E962E2 /* Exprs.swift */; };
160160
CC6AB0871C5C28FE008E9460 /* Equality.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC6AB0861C5C28FE008E9460 /* Equality.swift */; };
161161
CC6BB19A1E60F237009A9091 /* Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC6BB1991E60F237009A9091 /* Random.swift */; };
162+
CC6BB91B235CFC6300D7CAA1 /* 177.sld in Copy pre-installed SRFI libraries */ = {isa = PBXBuildFile; fileRef = CC6BB91A235CFB4700D7CAA1 /* 177.sld */; };
162163
CC703A13218BC4C100E71EA9 /* 23.sld in Copy pre-installed SRFI libraries */ = {isa = PBXBuildFile; fileRef = CC703A12218BC40600E71EA9 /* 23.sld */; };
163164
CC703A14218BC53600E71EA9 /* 14.sld in Copy pre-installed SRFI libraries */ = {isa = PBXBuildFile; fileRef = CCC1DBFB216BA1750019A374 /* 14.sld */; };
164165
CC703A15218BC54800E71EA9 /* 16.sld in Copy pre-installed SRFI libraries */ = {isa = PBXBuildFile; fileRef = CCC1DBFC216BA2600019A374 /* 16.sld */; };
@@ -561,6 +562,7 @@
561562
dstPath = LispKit/Resources/Libraries/srfi;
562563
dstSubfolderSpec = 7;
563564
files = (
565+
CC6BB91B235CFC6300D7CAA1 /* 177.sld in Copy pre-installed SRFI libraries */,
564566
CC5E53082357A2FA00C72CE2 /* 174.sld in Copy pre-installed SRFI libraries */,
565567
CC38528E23140FE0001D5E56 /* 173.sld in Copy pre-installed SRFI libraries */,
566568
CC4A7DC7225A32C400936034 /* 165.sld in Copy pre-installed SRFI libraries */,
@@ -769,6 +771,7 @@
769771
CC6A3B711C54DF7F00E962E2 /* Exprs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Exprs.swift; sourceTree = "<group>"; };
770772
CC6AB0861C5C28FE008E9460 /* Equality.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Equality.swift; sourceTree = "<group>"; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
771773
CC6BB1991E60F237009A9091 /* Random.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Random.swift; sourceTree = "<group>"; };
774+
CC6BB91A235CFB4700D7CAA1 /* 177.sld */ = {isa = PBXFileReference; lastKnownFileType = text; path = 177.sld; sourceTree = "<group>"; };
772775
CC703A12218BC40600E71EA9 /* 23.sld */ = {isa = PBXFileReference; lastKnownFileType = text; path = 23.sld; sourceTree = "<group>"; };
773776
CC703A16218BC61D00E71EA9 /* 34.sld */ = {isa = PBXFileReference; lastKnownFileType = text; path = 34.sld; sourceTree = "<group>"; };
774777
CC703A17218BC7D000E71EA9 /* 39.sld */ = {isa = PBXFileReference; lastKnownFileType = text; path = 39.sld; sourceTree = "<group>"; };
@@ -1188,6 +1191,7 @@
11881191
CC4A7DC6225A021E00936034 /* 165.sld */,
11891192
CC38528C23140CC2001D5E56 /* 173.sld */,
11901193
CC5E530723579CF200C72CE2 /* 174.sld */,
1194+
CC6BB91A235CFB4700D7CAA1 /* 177.sld */,
11911195
);
11921196
path = srfi;
11931197
sourceTree = "<group>";
@@ -2099,7 +2103,7 @@
20992103
repositoryURL = "https://github.com/objecthub/swift-numberkit.git";
21002104
requirement = {
21012105
kind = upToNextMajorVersion;
2102-
minimumVersion = 2.3.1;
2106+
minimumVersion = 2.3.2;
21032107
};
21042108
};
21052109
CC5E53042355AB0700C72CE2 /* XCRemoteSwiftPackageReference "swift-commandlinekit" */ = {

README.md

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,38 +57,49 @@ _LispKit_ provides support for the following core features, many of which are ba
5757
`(scheme rlist)`, `(scheme set)`,
5858
`(scheme sort)`, `(scheme stream)`, `(scheme text)`, `(scheme vector)`
5959
- LispKit-specific libraries:
60+
`(lispkit base)`,
6061
[`(lispkit core)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Core),
6162
[`(lispkit control)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Control),
62-
[`(lispkit dynamic)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Dynamic),
6363
[`(lispkit system)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-System),
64-
[`(lispkit list)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-List),
6564
[`(lispkit box)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Box),
66-
[`(lispkit type)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Type),
65+
[`(lispkit math)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Math),
66+
[`(lispkit list)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-List),
6767
[`(lispkit hashtable)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Hashtable),
68-
`(lispkit log)`,
69-
`(lispkit test)`,
70-
`(lispkit match)`,
71-
[`(lispkit datatype)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Datatype),
72-
[`(lispkit object)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Object),
73-
`(lispkit clos)`,
74-
[`(lispkit enum)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Enum),
75-
`(lispkit comparator)`,
76-
`(lispkit logic)`, `(lispkit iteration)`,
68+
[`(lispkit dynamic)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Dynamic),
69+
[`(lispkit type)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Type),
7770
[`(lispkit vector)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Vector),
7871
[`(lispkit gvector)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Gvector),
79-
[`(lispkit set)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Set),
80-
`(lispkit stack)`, `(lispkit queue)`,
81-
`(lispkit heap)`, `(lispkit graph)`,
82-
`(lispkit wt-tree)`, `(lispkit stream)`,
83-
`(lispkit prettify)`, `(lispkit json)`, `(lispkit csv)`,
84-
[`(lispkit string)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-String),
72+
`(lispkit record)`,
73+
[`(lispkit bytevector)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Bytevector),
8574
[`(lispkit char)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Char),
8675
[`(lispkit char-set)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Char-Set),
87-
[`(lispkit date-time)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Date-Time),
76+
[`(lispkit string)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-String),
8877
`(lispkit regexp)`,
78+
`(lispkit port)`,
79+
[`(lispkit date-time)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Date-Time),
8980
[`(lispkit draw)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Draw),
9081
[`(lispkit draw turtle)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Draw-Turtle),
91-
and `(lispkit pdf)`
82+
[`(lispkit datatype)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Datatype),
83+
[`(lispkit object)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Object),
84+
[`(lispkit enum)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Enum),
85+
`(lispkit stream)`,
86+
`(lispkit graph)`,
87+
`(lispkit match)`,
88+
`(lispkit iteration)`,
89+
`(lispkit log)`,
90+
[`(lispkit set)`](https://github.com/objecthub/swift-lispkit/wiki/LispKit-Set),
91+
`(lispkit stack)`,
92+
`(lispkit queue)`,
93+
`(lispkit heap)`,
94+
`(lispkit wt-tree)`,
95+
`(lispkit comparator)`,
96+
`(lispkit logic)`,
97+
`(lispkit clos)`,
98+
`(lispkit test)`,
99+
`(lispkit prettify)`,
100+
`(lispkit csv)`,
101+
`(lispkit json)`,
102+
and `(lispkit pdf)`.
92103

93104
_LispKit_ is incompatible or incomplete with respect to the following R7RS features:
94105

@@ -148,6 +159,7 @@ framework:
148159
- [SRFI 165: The Environment Monad](https://srfi.schemers.org/srfi-165/srfi-165.html)
149160
- [SRFI 173: Hooks](https://srfi.schemers.org/srfi-173/srfi-173.html)
150161
- [SRFI 174: POSIX Timespecs](https://srfi.schemers.org/srfi-174/srfi-174.html)
162+
- [SRFI 177: Portable keyword arguments](https://srfi.schemers.org/srfi-177/srfi-177.html)
151163

152164

153165
## Architecture

Sources/LispKit/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.8.0</string>
18+
<string>1.8.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Sources/LispKit/Resources/Libraries/srfi/165.sld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
;;; OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3030
;;;
3131
;;; LispKit Port:
32-
;;; Copyright © 2018 Matthias Zenger. All rights reserved.
32+
;;; Copyright © 2019 Matthias Zenger. All rights reserved.
3333

3434
(define-library (srfi 165)
3535

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
;;; SRFI 177
2+
;;; Portable keyword arguments
3+
;;;
4+
;;; Many Scheme implementations have keyword arguments, but they have not been widely
5+
;;; standardized. This SRFI defines the macros `keyword-lambda` and `keyword-call`. They
6+
;;; can be used identically in every major implementation currently in use, making it
7+
;;; safe to use keyword arguments in portable code. The macros expand to native keyword
8+
;;; arguments in Schemes that have them, letting programmers mix portable code and
9+
;;; implementation-specific code.
10+
;;;
11+
;;; Keyword arguments are a very useful tool for managing complexity as programs grow.
12+
;;; They are a natural solution to the "no, wait, this procedure still needs another
13+
;;; argument" problem which is almost guaranteed to pop up many times over the lifetime
14+
;;; of any non-trivial program. Humans simply cannot plan years ahead at this level of
15+
;;; detail, and adding keyword arguments as an afterthought is less objectionable than
16+
;;; accumulating long lists of optional positional arguments or refactoring central APIs
17+
;;; every few years when third-party code depends on them.
18+
;;;
19+
;;; Copyright © 2019 Lassi Kortela. All rights reserved.
20+
;;;
21+
;;; Permission is hereby granted, free of charge, to any person obtaining a copy of this
22+
;;; software and associated documentation files (the "Software"), to deal in the Software
23+
;;; without restriction, including without limitation the rights to use, copy, modify, merge,
24+
;;; publish, distribute, sublicense, and/or sell copies of the Software, and to permit
25+
;;; persons to whom the Software is furnished to do so, subject to the following conditions:
26+
;;;
27+
;;; The above copyright notice and this permission notice shall be included in all copies or
28+
;;; substantial portions of the Software.
29+
;;;
30+
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
31+
;;; INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
32+
;;; PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
33+
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
34+
;;; CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
35+
;;; OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36+
;;;
37+
;;; LispKit Port:
38+
;;; Copyright © 2019 Matthias Zenger. All rights reserved.
39+
40+
(define-library (srfi 177)
41+
42+
(export keyword-lambda
43+
keyword-call)
44+
45+
(import (lispkit base))
46+
47+
(begin
48+
49+
(define-syntax let-false
50+
(syntax-rules ()
51+
((_ () body ...) (begin body ...))
52+
((_ (var) body ...) (let ((var #f)) body ...))
53+
((_ (var vars ...) body ...)
54+
(let ((var #f)) (let-false (vars ...) body ...)))))
55+
56+
(define-syntax kw-setters
57+
(syntax-rules ()
58+
((_ sym val)
59+
(error (if (symbol? sym)
60+
(string-append "keyword not known: " (symbol->string sym))
61+
"keyword is not a symbol")))
62+
((_ sym val keyword keywords ...)
63+
(if (eq? 'keyword sym)
64+
(set! keyword val)
65+
(kw-setters sym val keywords ...)))))
66+
67+
(define-syntax keyword-lambda
68+
(syntax-rules (kv val vals loop i)
69+
((_ (formals ... (keywords ...)) body ...)
70+
(lambda (formals ... . kv)
71+
(let-false (keywords ...)
72+
(let loop ((kv kv))
73+
(cond ((null? kv))
74+
((not (pair? (cdr kv)))
75+
(error "Keyword without value"))
76+
(else
77+
(let ((sym (car kv)) (val (cadr kv)))
78+
(kw-setters sym val keywords ...))
79+
(loop (cddr kv)))))
80+
((lambda () body ...)))))))
81+
82+
(define-syntax kw-call-aux
83+
(syntax-rules ()
84+
((_ kw-lambda (kvs ...) (args ...) ())
85+
(kw-lambda args ... kvs ...))
86+
((_ kw-lambda (kvs ...) (args ...) (key val more-kvs ...))
87+
(kw-call-aux kw-lambda (kvs ... 'key val) (args ...) (more-kvs ...)))))
88+
89+
(define-syntax keyword-call
90+
(syntax-rules ()
91+
((_ kw-lambda args ... (kvs ...))
92+
(kw-call-aux kw-lambda () (args ...) (kvs ...)))))
93+
)
94+
)
95+

Sources/LispKit/Resources/Tests/Import.scm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
(import (srfi 165))
106106
(import (srfi 173))
107107
(import (srfi 174))
108+
(import (srfi 177))
108109

109110
; this needs to be last
110111
(import (srfi 101))

Sources/LispKitRepl/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ var cmdLineArgs = flags.parameters.isEmpty ? [CommandLine.arguments.first!] : fl
128128
#if SPM
129129
let context = Context(delegate: terminal,
130130
implementationName: "LispKit",
131-
implementationVersion: "1.8.0",
131+
implementationVersion: "1.8.1",
132132
commandLineArguments: cmdLineArgs,
133133
includeInternalResources: false,
134134
includeDocumentPath: searchDocs.value)

Tests/LispKitTests/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.8.0</string>
18+
<string>1.8.1</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

0 commit comments

Comments
 (0)