Skip to content

Instantly share code, notes, and snippets.

@callionica
Last active May 21, 2016 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callionica/56455e0167a1d4498a9d5fd6b576b5c0 to your computer and use it in GitHub Desktop.
Save callionica/56455e0167a1d4498a9d5fd6b576b5c0 to your computer and use it in GitHub Desktop.
// Code generation!
let props = ["name", "value", "thing"]
for prop in props {
print([
"if local.\(prop) != remote.\(prop) {",
" local.\(prop) = remote.\(prop)",
" changes[\(prop)Key] = remote.\(prop)",
"}",
""
].joined(separator:"\n"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment