Skip to content

Instantly share code, notes, and snippets.

@dungpa
Created September 13, 2012 20:31
Show Gist options
  • Save dungpa/3717390 to your computer and use it in GitHub Desktop.
Save dungpa/3717390 to your computer and use it in GitHub Desktop.
Common mistake
type Example() =
member __.Getter = doComputation()
// It's clearer if you use the long syntax:
type Example() =
member __.Getter with get() = doComputation()
// What you probably wanted to do is:
type Example() =
let result = doComputation()
member __.Getter = result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment