Skip to content

Instantly share code, notes, and snippets.

@Kametrixom
Last active September 3, 2015 07:01
Show Gist options
  • Save Kametrixom/4e62d83d665e832595b2 to your computer and use it in GitHub Desktop.
Save Kametrixom/4e62d83d665e832595b2 to your computer and use it in GitHub Desktop.
// I really like this one
func doIt(inout s: D) {
if case self = isUniquelyReferenced(&s),
self.`self` = true where self {
self.`self` = { [unowned x = [self, 7] as Self] n in
print(x + n)
} as () -> ()
}
}
@pyrtsa
Copy link

pyrtsa commented Sep 3, 2015

Semicolons for clarity.

import Foundation;typealias D=Bool;extension Bool{var`self`:Any{get{return true}set{}}};var`self`=true;typealias`Self`=NSArray;func+(_:`Self`,_:())->String{return""};func~=(_:Any,_:Bool)->D{return true};func isUniquelyReferenced(inout s:D)->D{return true}

@Kametrixom
Copy link
Author

@pyrtsa This does compile, however the syntax high-lighting doesn't match, good effort though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment