Define prefix operator

Category:
Defining Operator
Description: Define prefix operator
Code:
let DefineOperator2() =
let inline (~+.) x = x+1
let a = 9
let r = (+.a)
printfn "%d" r
Assert.AreEqual(r, 10)

Execution Result:
10
both elements are equal

Last edited Sep 14, 2011 at 3:00 AM by ttliu2000, version 1

Comments

No comments yet.