Last active
October 25, 2016 11:34
-
-
Save jonathanpenn/c69e7b8485e29ffff598 to your computer and use it in GitHub Desktop.
So the JavaScript developers feel right at home...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NaNClass {} | |
let NaN = NaNClass() | |
@infix func == (n1: NaNClass, n2: NaNClass) -> Bool { | |
return false | |
} | |
@infix func != (n1: NaNClass, n2: NaNClass) -> Bool { | |
return true | |
} | |
@infix func + (a1: Array<Any>, a2: Array<Any>) -> String { | |
return "" | |
} | |
NaN == NaN // -> false | |
NaN != NaN // -> true | |
[] + [] // -> "" |
kevin1
commented
Jun 6, 2014
now swift is ready to scale
web scale™
@kevin1 fixed!
import Foundation // Is there another way to get the C standard library?
let a = atan(4)
a == a // false
a === a // error, although to be fair it does the wrong thing in JS
a is a // meaningless in Swift, does the right thing in JS Harmony
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment