Skip to content

Instantly share code, notes, and snippets.

@vincent-pradeilles
Last active July 10, 2019 18:32
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 vincent-pradeilles/8bafc32cf717ab635be5be9dba21ca1e to your computer and use it in GitHub Desktop.
Save vincent-pradeilles/8bafc32cf717ab635be5be9dba21ca1e to your computer and use it in GitHub Desktop.
let cachedCos = cached { (x: Double) in cos(x) }
cachedCos(2 * .pi) // result of cos(2π) is now cached
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment