Extracted from https://docs.swift.org/swift-book/ReferenceManual/zzSummaryOfTheGrammar.html on 2018/27/11
Copyright © 2018 Apple Inc.
import "engine_sim.mr" | |
// Honda RC211V 75.5° V5 - used in MotoGP from ~2001-2004 | |
// Reference for some of the numbers in the design: https://patents.google.com/patent/US6745730B2/en | |
// Potential firing order referenced from: https://youtu.be/U5_wWC2cURU?t=260 | |
/* | |
- Running engine: | |
- main.mr: |
Extracted from https://docs.swift.org/swift-book/ReferenceManual/zzSummaryOfTheGrammar.html on 2018/27/11
Copyright © 2018 Apple Inc.
Based on some source I don't exactly remember right now but will add a link to later.
// When used on instances, allows changing fields directly using keypaths (handy way to avoid 'lazy var' property closures!)
let label
= UILabel()
.with(\.text, setTo: "Hello!")
.with(\.textColor, setTo: UIColor.darkGray)
/// Retries the given throwing `block` as a promise `tries` times, | |
/// re-calling `block` another time until exhausting the tries. | |
func retry<T>(tries count: Int, block: () throws -> T) -> Promise<T> { | |
return Promise().thenRetry(tries: count, block: block) | |
} | |
/// Retries the given promise-returning `block` as a promise `tries` times, | |
/// re-calling `block` another time until exhausting the tries. | |
func retry<T>(tries count: Int, block: () -> Promise<T>) -> Promise<T> { | |
return Promise().thenRetry(tries: count, block: block) |
import Foundation | |
/// A protocol to be implemented by self-contained, recursive binary-tree data structures | |
protocol BinaryTreeType: SequenceType, CustomStringConvertible { | |
/// The type of element stored in this binary tree. This value must implement the Comparable protocol | |
typealias Element: Comparable | |
/// Gets the value in this binary tree element | |
var value: Element? { get } |
void Main() | |
{ | |
var tests = new IndexTests(); | |
tests.CanIndexAndQuery(); | |
tests.CanUpdate(); | |
} | |
// Internal doc class | |
class Document |
using System; | |
using System.Diagnostics; | |
using System.Windows.Forms; | |
namespace Test | |
{ | |
static class Program | |
{ | |
[STAThread] | |
static void Main(string[] args) |