Commit df784ced authored by Drew's avatar Drew

Rename -> pianissimo

parent b2058c84
DynamicRuntime
pianissimo
© 2016 Drew Crawford.
https://code.sealedabstract.com/drewcrawford/DynamicRuntime
\ No newline at end of file
https://code.sealedabstract.com/drewcrawford/pianissimo
\ No newline at end of file
......@@ -15,28 +15,28 @@
;; The build file for all of the targets of the Anarchy Tools build tool.
(package
:name "DynamicRuntime"
:name "pianissimo"
:version "0.1"
:tasks {
:default {
:tool "atllbuild"
:sources ["src/**.swift"]
:name "DynamicRuntime"
:name "pianissimo"
:output-type "static-library"
:publish-product true
}
:check-build {
:tool "atllbuild"
:sources ["tests/main.swift"]
:name "DynamicRuntimeCheck"
:name "pianissimoCheck"
:output-type "executable"
:link-with-product ["DynamicRuntime.a"]
:link-with-product ["pianissimo.a"]
:dependencies ["default"]
:publish-product true
}
:check {
:tool "shell"
:script "bin/DynamicRuntimeCheck"
:script "bin/pianissimoCheck"
:dependencies ["check-build"]
}
}
......
......@@ -23,19 +23,19 @@ internal final class LegalTextWriter: StaticCallable {
static var selectors: [Selector] { return [Selectors.legalText] }
static func _call(_ selector: Selector, input: Any?) -> Any? {
if selector == Selectors.legalText {
return "DynamicRuntime\n© 2016 Drew Crawford.\nhttps://code.sealedabstract.com/drewcrawford/DynamicRuntime"
return "pianissimo\n© 2016 Drew Crawford.\nhttps://code.sealedabstract.com/drewcrawford/pianissimo"
}
return nil
}
}
private func _setupOnce() {
DynamicRuntime._register(LegalTextWriter.self)
pianissimo._register(LegalTextWriter.self)
}
let setupOnce: Void = _setupOnce()
extension DynamicRuntime {
extension pianissimo {
public static var legalTexts: [String] {
return typesRespondingTo(staticSelector: Selectors.legalText).map{$0.call(Selectors.legalText, input: nil) as String?}.flatMap{$0}
}
......
......@@ -15,4 +15,4 @@ limitations under the License.
*/
///Namespace type
public enum DynamicRuntime { }
\ No newline at end of file
public enum pianissimo { }
\ No newline at end of file
......@@ -27,7 +27,7 @@ public protocol StaticCallable {
static func _call(_ selector: Selector, input: Any?) -> Any?
}
public struct StringSelector: Selector, ExpressibleByStringLiteral {
public struct PianissimoStringSelector: Selector, ExpressibleByStringLiteral {
let string: String
public init(stringLiteral value: StaticString) {
self.string = String(describing: value)
......
......@@ -17,9 +17,9 @@ limitations under the License.
import Dispatch
private var _registeredTypes: [String: Any.Type] = [:]
private let queue = DispatchQueue(label: "DynamicRuntime.Lock")
private let queue = DispatchQueue(label: "pianissimo.Lock")
extension DynamicRuntime {
extension pianissimo {
private static func typeName(of: Any.Type) -> String {
return _typeName(of, qualified: true)
......
/*
Copyright 2016 Drew Crawford
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
extension String {
/*func contains(_ str: String) -> Bool {
//the world's dumbest implementation
var startIndex = self.utf8.startIndex
while startIndex != self.utf8.endIndex {
let viewA = self.utf8[startIndex..<self.utf8.index(startIndex, offsetBy: str.utf8.count, limitBy: self.utf8.endIndex)]
if viewA == str.utf8 { return true }
}
return false
}*/
}
......@@ -14,5 +14,5 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import DynamicRuntime
precondition(DynamicRuntime.legalTexts == ["DynamicRuntime\n© 2016 Drew Crawford.\nhttps://code.sealedabstract.com/drewcrawford/DynamicRuntime"])
\ No newline at end of file
import pianissimo
precondition(pianissimo.legalTexts == ["DynamicRuntime\n© 2016 Drew Crawford.\nhttps://code.sealedabstract.com/drewcrawford/DynamicRuntime"])
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment