Skip to content

Commit

Permalink
Include (srfi 223). Finalize release 2.0.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
objecthub committed Jul 2, 2021
1 parent d42a7e2 commit 3afabe0
Show file tree
Hide file tree
Showing 10 changed files with 287 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 2.0.1 (2021-07-02)

- New procedures in library `(lispkit draw)`: `bitmap->bytevector`, `bitmap-blur`, `bitmap-crop`
- Support tables and definition lists in library `(lispkit markdown)`
- Support gzip and zlib container formats for deflate compression via library `(lispkit bytevector)`
- Support symlink resolution via procedure `file-path` of library `(lispkit system)`
- Bug fixes in library `(lispkit system)`: `home-directory` also supports a non-sandboxed mode, `file-path` handles tilde correctly
- Bug fixes for a few procedures of library `(lispkit archive zip)`
- Included new libraries: `(srfi 219)`, `(srfi 221)`, `(srfi 223)`

## 2.0.0 (2021-05-01)

- Support for iOS
Expand Down
20 changes: 16 additions & 4 deletions LispKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
CC0E57BF268BB8A100693DD2 /* SRFI-221.scm in Copy tests */ = {isa = PBXBuildFile; fileRef = CC0E57BD268BB80D00693DD2 /* SRFI-221.scm */; };
CC0E57C0268BB8BE00693DD2 /* 221.sld in Copy pre-installed SRFI libraries */ = {isa = PBXBuildFile; fileRef = CC0E57BC268BB7C900693DD2 /* 221.sld */; };
CC0E57C1268BB8D100693DD2 /* SRFI-221.scm in Copy tests */ = {isa = PBXBuildFile; fileRef = CC0E57BD268BB80D00693DD2 /* SRFI-221.scm */; };
CC0E57C4268FAAC100693DD2 /* 223.sld in Copy pre-installed SRFI libraries */ = {isa = PBXBuildFile; fileRef = CC0E57C2268FAA4200693DD2 /* 223.sld */; };
CC0E57C5268FAAD400693DD2 /* SRFI-223.scm in Copy tests */ = {isa = PBXBuildFile; fileRef = CC0E57C3268FAA7800693DD2 /* SRFI-223.scm */; };
CC0E57C6268FAAE800693DD2 /* 223.sld in Copy pre-installed SRFI libraries */ = {isa = PBXBuildFile; fileRef = CC0E57C2268FAA4200693DD2 /* 223.sld */; };
CC0E57C7268FAAFB00693DD2 /* SRFI-223.scm in Copy tests */ = {isa = PBXBuildFile; fileRef = CC0E57C3268FAA7800693DD2 /* SRFI-223.scm */; };
CC0EBFF91ED37FB7004510B2 /* Math.scm in Copy examples */ = {isa = PBXBuildFile; fileRef = CC0EBFF81ED37A76004510B2 /* Math.scm */; };
CC10404D1F53789D0045144A /* pdf.sld in Copy pre-installed LispKit libraries */ = {isa = PBXBuildFile; fileRef = CC10404C1F5378660045144A /* pdf.sld */; };
CC1227391CBFE74500821EB7 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC1227381CBFE74500821EB7 /* main.swift */; };
Expand Down Expand Up @@ -967,6 +971,7 @@
dstPath = Root/LispKit/Tests;
dstSubfolderSpec = 7;
files = (
CC0E57C5268FAAD400693DD2 /* SRFI-223.scm in Copy tests */,
CC0E57BF268BB8A100693DD2 /* SRFI-221.scm in Copy tests */,
CC879888264D49CC006950A7 /* SRFI-219.scm in Copy tests */,
CCD5E566262E348100C45EA0 /* SRFI-189.scm in Copy tests */,
Expand Down Expand Up @@ -1428,6 +1433,7 @@
dstPath = Root/LispKit/Libraries/srfi;
dstSubfolderSpec = 7;
files = (
CC0E57C4268FAAC100693DD2 /* 223.sld in Copy pre-installed SRFI libraries */,
CC0E57BE268BB88700693DD2 /* 221.sld in Copy pre-installed SRFI libraries */,
CC879887264D49B0006950A7 /* 219.sld in Copy pre-installed SRFI libraries */,
CCD5E55C262E342600C45EA0 /* 189.sld in Copy pre-installed SRFI libraries */,
Expand Down Expand Up @@ -1520,6 +1526,7 @@
dstPath = Root/LispKit/Libraries/srfi;
dstSubfolderSpec = 7;
files = (
CC0E57C6268FAAE800693DD2 /* 223.sld in Copy pre-installed SRFI libraries */,
CC0E57C0268BB8BE00693DD2 /* 221.sld in Copy pre-installed SRFI libraries */,
CC879889264D49E5006950A7 /* 219.sld in Copy pre-installed SRFI libraries */,
CCD5E561262E343E00C45EA0 /* 189.sld in Copy pre-installed SRFI libraries */,
Expand Down Expand Up @@ -1851,6 +1858,7 @@
dstPath = Root/LispKit/Tests;
dstSubfolderSpec = 7;
files = (
CC0E57C7268FAAFB00693DD2 /* SRFI-223.scm in Copy tests */,
CC0E57C1268BB8D100693DD2 /* SRFI-221.scm in Copy tests */,
CC87988A264D4A00006950A7 /* SRFI-219.scm in Copy tests */,
CCD5E56B262E34A500C45EA0 /* SRFI-189.scm in Copy tests */,
Expand Down Expand Up @@ -2119,6 +2127,8 @@
CC0D7B392544AF6800FB9301 /* SRFI-210.scm */ = {isa = PBXFileReference; lastKnownFileType = text; path = "SRFI-210.scm"; sourceTree = "<group>"; };
CC0E57BC268BB7C900693DD2 /* 221.sld */ = {isa = PBXFileReference; lastKnownFileType = text; path = 221.sld; sourceTree = "<group>"; };
CC0E57BD268BB80D00693DD2 /* SRFI-221.scm */ = {isa = PBXFileReference; lastKnownFileType = text; path = "SRFI-221.scm"; sourceTree = "<group>"; };
CC0E57C2268FAA4200693DD2 /* 223.sld */ = {isa = PBXFileReference; lastKnownFileType = text; path = 223.sld; sourceTree = "<group>"; };
CC0E57C3268FAA7800693DD2 /* SRFI-223.scm */ = {isa = PBXFileReference; lastKnownFileType = text; path = "SRFI-223.scm"; sourceTree = "<group>"; };
CC0EBFF81ED37A76004510B2 /* Math.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Math.scm; sourceTree = "<group>"; };
CC10404C1F5378660045144A /* pdf.sld */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pdf.sld; sourceTree = "<group>"; };
CC1227361CBFE74500821EB7 /* LispKitRepl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LispKitRepl.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -2659,6 +2669,7 @@
CCD5E55A262E32EE00C45EA0 /* SRFI-214.scm */,
CC879886264D48A3006950A7 /* SRFI-219.scm */,
CC0E57BD268BB80D00693DD2 /* SRFI-221.scm */,
CC0E57C3268FAA7800693DD2 /* SRFI-223.scm */,
);
path = Tests;
sourceTree = "<group>";
Expand Down Expand Up @@ -2977,6 +2988,7 @@
CCD5E559262E31AE00C45EA0 /* 214.sld */,
CC879885264D4739006950A7 /* 219.sld */,
CC0E57BC268BB7C900693DD2 /* 221.sld */,
CC0E57C2268FAA4200693DD2 /* 223.sld */,
);
path = srfi;
sourceTree = "<group>";
Expand Down Expand Up @@ -4158,7 +4170,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.LispKitTools;
Expand Down Expand Up @@ -4194,7 +4206,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.LispKitTools;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
Expand Down Expand Up @@ -4440,7 +4452,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.LispKit;
Expand Down Expand Up @@ -4480,7 +4492,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 2.0.0;
MARKETING_VERSION = 2.0.1;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.LispKit;
PRODUCT_NAME = LispKit;
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ framework:
- [SRFI 214: Flexvectors](https://srfi.schemers.org/srfi-214/srfi-214.html)
- [SRFI 219: Define higher-order lambda](https://srfi.schemers.org/srfi-219/srfi-219.html)
- [SRFI 221: Generator/accumulator sub-library](https://srfi.schemers.org/srfi-221/srfi-221.html)

- [SRFI 223: Generalized binary search procedures](https://srfi.schemers.org/srfi-223/srfi-223.html)


## Project

Expand Down
2 changes: 1 addition & 1 deletion Sources/LispKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<string>2.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
80 changes: 80 additions & 0 deletions Sources/LispKit/Resources/Libraries/srfi/223.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
;;; SRFI 223
;;; Generalized binary search procedures
;;;
;;; Generalized procedures for binary search of vector-like data structures are provided
;;; which can be applied to any sequence type, including ones defined by the user,
;;; together with applications of these procedures for Scheme’s built-in vector and
;;; bytevector types.
;;;
;;; Copyright © 2021 Daphne Preston-Kendal. All rights reserved.
;;;
;;; Permission is hereby granted, free of charge, to any person obtaining a copy of this
;;; software and associated documentation files (the "Software"), to deal in the Software
;;; without restriction, including without limitation the rights to use, copy, modify, merge,
;;; publish, distribute, sublicense, and/or sell copies of the Software, and to permit
;;; persons to whom the Software is furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be included in all copies or
;;; substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
;;; INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
;;; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
;;; FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
;;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
;;;
;;; Adaptation to LispKit
;;; Copyright © 2021 Matthias Zenger. All rights reserved.

(define-library (srfi 223)

(export bisection
bisect-left
bisect-right
vector-bisect-left
vector-bisect-right)

(import (lispkit base))

(begin

(define (bisect-left a val ref less? lo hi)
(if (>= lo hi) lo
(let ((mid (floor-quotient (+ lo hi) 2)))
(if (less? (ref a mid) val)
(bisect-left a val ref less? (+ mid 1) hi)
(bisect-left a val ref less? lo mid)))))

(define (bisect-right a val ref less? lo hi)
(if (>= lo hi) lo
(let ((mid (floor-quotient (+ lo hi) 2)))
(if (less? val (ref a mid))
(bisect-right a val ref less? lo mid)
(bisect-right a val ref less? (+ mid 1) hi)))))

(define bisection
(case-lambda
((ref lo-hi-proc)
(values
(case-lambda
((a val less?)
(let-values (((lo hi) (lo-hi-proc a)))
(bisect-left a val ref less? lo hi)))
((a val less? lo hi)
(bisect-left a val ref less? lo hi)))
(case-lambda
((a val less?)
(let-values (((lo hi) (lo-hi-proc a)))
(bisect-right a val ref less? lo hi)))
((a val less? lo hi)
(bisect-right a val ref less? lo hi)))))
((ref)
(bisection ref
(lambda (a)
(error "both lo and hi arguments must be given to this procedure"))))))

(define-values (vector-bisect-left vector-bisect-right)
(bisection vector-ref (lambda (v) (values 0 (vector-length v)))))
)
)
1 change: 1 addition & 0 deletions Sources/LispKit/Resources/Tests/All.scm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
(load "Tests/SRFI-214")
(load "Tests/SRFI-219")
(load "Tests/SRFI-221")
(load "Tests/SRFI-223")

(test-end)

Expand Down
1 change: 1 addition & 0 deletions Sources/LispKit/Resources/Tests/Import.scm
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
(import (srfi 214))
(import (srfi 219))
(import (srfi 221))
(import (srfi 223))

; this needs to be last
(import (srfi 101))
Loading

0 comments on commit 3afabe0

Please sign in to comment.