This project is read-only.
Use quotation

Category:
Quotation
Description: Basic quotation sample
Code:
let QuotationSample1() = 
let expr : Expr = <@ 1 + 1 @>
let expr2 : Expr = <@@ 1 + 1 @@>
printfn "expr type is %s" expr.Type.Name
printfn "expr2 type is %s" expr.Type.Name

Execution Result:
expr type is Int32
expr2 type is Int32

Last edited Sep 14, 2011 at 4:02 AM by ttliu2000, version 1

Comments

kerneltrap Aug 16, 2012 at 4:19 AM 
Shouldn't it be
printfn "expr2 type is %s" expr2.Type.Name
instead of
printfn "expr2 type is %s" expr.Type.Name
?