TheAngryDarling / SwiftCustomOperators

A set of custom operators to extend the swift language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Operators

swift >= 4.0 macOS Linux Apache 2

A set of custom operators to extend the swift language

Usage

// XOR operators
var a: Bool = true
let b: Bool = false
a ^^ b // a XOR b ===> true

// Smallest operators
let a: Int = 1
let b: Int = 2
let c: Int? = nil

(a ?< b) // ====> a(1)
(b ?< a) // ====> a(1)
(a ??< c) // ====> a(1)
(c ??< a) // ====> a(1)
(c ??< c) // ====> c(nil)

// Largest operators
let a: Int = 1
let b: Int = 2
let c: Int? = nil

(a ?> b) // ====> b(2)
(b ?> a) // ====> b(2)
(a ??> c) // ====> a(1)
(c ??> a) // ====> a(1)
(c ??> c) // ====> c(nil)

Author

License

This project is licensed under Apache License v2.0 - see the LICENSE.md file for details

About

A set of custom operators to extend the swift language

License:Apache License 2.0


Languages

Language:Swift 100.0%