Skip to content

Commit 6a8282b

Browse files
committed
Port code to Swift 4.2.
1 parent 709ae16 commit 6a8282b

File tree

11 files changed

+26
-25
lines changed

11 files changed

+26
-25
lines changed

Cartfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "objecthub/swift-numberkit" ~> 2.2.1
2-
github "objecthub/swift-commandlinekit" ~> 0.2.3
1+
github "objecthub/swift-numberkit" ~> 2.2.4
2+
github "objecthub/swift-commandlinekit" ~> 0.2.5

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "objecthub/swift-commandlinekit" "0.2.3"
2-
github "objecthub/swift-numberkit" "2.2.1"
1+
github "objecthub/swift-commandlinekit" "0.2.5"
2+
github "objecthub/swift-numberkit" "2.2.4"

LispKit.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@
14241424
SWIFT_OBJC_BRIDGING_HEADER = Sources/LispKitRepl/LispKitReplBridgingHeader.h;
14251425
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
14261426
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1427-
SWIFT_VERSION = 4.0;
1427+
SWIFT_VERSION = 4.2;
14281428
};
14291429
name = Debug;
14301430
};
@@ -1444,7 +1444,7 @@
14441444
PRODUCT_NAME = "$(TARGET_NAME)";
14451445
SWIFT_OBJC_BRIDGING_HEADER = Sources/LispKitRepl/LispKitReplBridgingHeader.h;
14461446
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1447-
SWIFT_VERSION = 4.0;
1447+
SWIFT_VERSION = 4.2;
14481448
};
14491449
name = Release;
14501450
};
@@ -1501,7 +1501,7 @@
15011501
SDKROOT = macosx;
15021502
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
15031503
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1504-
SWIFT_VERSION = 4.0;
1504+
SWIFT_VERSION = 4.2;
15051505
VERSIONING_SYSTEM = "apple-generic";
15061506
VERSION_INFO_PREFIX = "";
15071507
};
@@ -1554,7 +1554,7 @@
15541554
SDKROOT = macosx;
15551555
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
15561556
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1557-
SWIFT_VERSION = 4.0;
1557+
SWIFT_VERSION = 4.2;
15581558
VERSIONING_SYSTEM = "apple-generic";
15591559
VERSION_INFO_PREFIX = "";
15601560
};
@@ -1584,7 +1584,7 @@
15841584
SWIFT_OBJC_BRIDGING_HEADER = "";
15851585
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
15861586
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1587-
SWIFT_VERSION = 4.0;
1587+
SWIFT_VERSION = 4.2;
15881588
};
15891589
name = Debug;
15901590
};
@@ -1610,7 +1610,7 @@
16101610
SKIP_INSTALL = YES;
16111611
SWIFT_OBJC_BRIDGING_HEADER = "";
16121612
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1613-
SWIFT_VERSION = 4.0;
1613+
SWIFT_VERSION = 4.2;
16141614
};
16151615
name = Release;
16161616
};
@@ -1627,7 +1627,7 @@
16271627
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.LispKitTests;
16281628
PRODUCT_NAME = "$(TARGET_NAME)";
16291629
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1630-
SWIFT_VERSION = 4.0;
1630+
SWIFT_VERSION = 4.2;
16311631
};
16321632
name = Debug;
16331633
};
@@ -1644,7 +1644,7 @@
16441644
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.LispKitTests;
16451645
PRODUCT_NAME = "$(TARGET_NAME)";
16461646
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1647-
SWIFT_VERSION = 4.0;
1647+
SWIFT_VERSION = 4.2;
16481648
};
16491649
name = Release;
16501650
};

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:4.1
1+
// swift-tools-version:4.2
22
//
33
// Package.swift
44
// LispKit
@@ -37,7 +37,7 @@ let package = Package(
3737
.executable(name: "LispKitRepl", targets: ["LispKitRepl"])
3838
],
3939
dependencies: [
40-
.package(url: "https://github.com/objecthub/swift-numberkit.git", from: "2.2.1"),
40+
.package(url: "https://github.com/objecthub/swift-numberkit.git", from: "2.2.2"),
4141
.package(url: "https://github.com/objecthub/swift-commandlinekit.git", from: "0.2.3")
4242
],
4343
targets: [
@@ -48,5 +48,6 @@ let package = Package(
4848
exclude: ["BuildMetadata.m", "BuildMetadata.h"]),
4949
.testTarget(name: "LispKitTests",
5050
dependencies: ["LispKit"])
51-
]
51+
],
52+
swiftLanguageVersions: [.v4_2]
5253
)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
========================
33

44
[![Platform: macOS](https://img.shields.io/badge/Platform-macOS-blue.svg?style=flat)](https://developer.apple.com/osx/)
5-
[![Language: Swift 4.1](https://img.shields.io/badge/Language-Swift%204.1-green.svg?style=flat)](https://developer.apple.com/swift/)
6-
[![IDE: Xcode 9.4](https://img.shields.io/badge/IDE-Xcode%209.4-orange.svg?style=flat)](https://developer.apple.com/xcode/)
5+
[![Language: Swift 4.2](https://img.shields.io/badge/Language-Swift%204.2-green.svg?style=flat)](https://developer.apple.com/swift/)
6+
[![IDE: Xcode 10.0](https://img.shields.io/badge/IDE-Xcode%2010.0-orange.svg?style=flat)](https://developer.apple.com/xcode/)
77
[![Carthage: compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
88
[![License: Apache](http://img.shields.io/badge/License-Apache-lightgrey.svg?style=flat)](https://raw.githubusercontent.com/objecthub/swift-lispkit/master/LICENSE)
99

Sources/LispKit/Base/ObjectPool.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public final class ObjectPool<T: AnyObject>: Sequence, CustomStringConvertible {
6060
}
6161

6262
/// Returns true if the object pool is empty.
63-
open var isEmpty: Bool {
63+
public var isEmpty: Bool {
6464
return self.count == 0
6565
}
6666

Sources/LispKit/Data/Port.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ open class Port: Reference, CustomStringConvertible {
2929
case binaryOutputPort(BinaryOutput)
3030
}
3131

32-
open let kind: Kind
32+
public let kind: Kind
3333
open var isOpen: Bool = true
3434

3535
public init(input: TextInput) {

Sources/LispKit/Graphics/Drawing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ public enum DrawingInstruction {
385385
.font: font ?? NSFont.systemFont(ofSize: NSFont.systemFontSize),
386386
.foregroundColor: (color ?? Color.black).nsColor,
387387
.paragraphStyle: pstyle,
388-
] as [NSAttributedStringKey: Any]
388+
] as [NSAttributedString.Key: Any]
389389
let textRect: NSRect
390390
switch location {
391391
case .position(let point):

Sources/LispKit/Graphics/Shape.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public enum ShapePrototype {
320320
case .glyphs(let str, let rect, let font, let flipped):
321321
let bezierPath = NSBezierPath()
322322
bezierPath.move(to: rect.origin)
323-
let storage = NSTextStorage(string: str, attributes: [NSAttributedStringKey.font : font])
323+
let storage = NSTextStorage(string: str, attributes: [NSAttributedString.Key.font : font])
324324
let manager = NSLayoutManager()
325325
let container = NSTextContainer(size: rect.size)
326326
storage.addLayoutManager(manager)
@@ -442,7 +442,7 @@ public enum InterpolationMethod {
442442
let d2 = pointLength(pointSub(p2, p1))
443443
let d3 = pointLength(pointSub(p3, p2))
444444
var b1: NSPoint
445-
if fabs(d1) < InterpolationMethod.epsilon {
445+
if abs(d1) < InterpolationMethod.epsilon {
446446
b1 = p1
447447
} else {
448448
b1 = pointMult(p2, pow(d1, 2.0 * alpha))
@@ -453,7 +453,7 @@ public enum InterpolationMethod {
453453
b1 = pointMult(b1, 1.0 / (3.0 * pow(d1, alpha) * (pow(d1, alpha) + pow(d2, alpha))))
454454
}
455455
var b2: NSPoint
456-
if fabs(d3) < InterpolationMethod.epsilon {
456+
if abs(d3) < InterpolationMethod.epsilon {
457457
b2 = p2
458458
} else {
459459
b2 = pointMult(p1, pow(d3, 2.0 * alpha))

Sources/LispKit/IO/BinaryOutput.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ open class BinaryOutput {
3737
private var output: OutputStream?
3838

3939
/// The URL for the output stream. `url` is nil whenever `output` is nil.
40-
open let url: URL?
40+
public let url: URL?
4141

4242
/// Relative paths are relative to the documents folder
4343
private static let documentsUrl =

0 commit comments

Comments
 (0)