Code Quotations

Pass around F# code as a dynamic expression. Untyped quotations are a little faster to process.
1: 
2: 
3: 
4: 
5: 
6: 
open Microsoft.FSharp.Quotations

let expr: Expr<int> = <@ 1 + 1 @> // Typed code quotation
let expr2: Expr = <@@ 1 + 1 @@> // Untyped code quotation

<@ let f x = x + 1 in f 20 @>

or

1: 
2: 
3: 
4: 
<@
  let f x = x + 1
  f 20
@>

Splicing

1: 
2: 
3: 
4: 
<@ 1 + %expr @> // Add typed expression `expr` to quotation
<@@ 1 + %%expr2 @@> // Add untyped expression `expr2` to quotation

// TODO: More concrete example needed