Closed GoogleCodeExporter closed 5 years ago
Original comment by stephen....@gmail.com
on 23 Mar 2015 at 6:39
Well, actually will take a bit of work. Consider the following FSI session
(note difference in quotation AST depending on order of args):
> type R1 = { A:int; B:int };;
type R1 =
{A: int;
B: int;}
> unquote <@ { A=1;B=2 } @>;;
val it : UnquotedExpression =
NewRecord (R1, Value (1), Value (2))
{A = 1;
B = 2;}
> unquote <@ { A=1+2;B=2+3+4 } @>;;
val it : UnquotedExpression =
NewRecord (R1, Call (None, op_Addition, [Value (1), Value (2)]),
Call (None, op_Addition,
[Call (None, op_Addition, [Value (2), Value (3)]), Value (4)]))
NewRecord (R1, Value (3), Call (None, op_Addition, [Value (5), Value (4)]))
NewRecord (R1, Value (3), Value (9))
{A = 3;
B = 9;}
> unquote <@ { B=2+3+4; A=1+2 } @>;;
val it : UnquotedExpression =
let B = 2 + 3 + 4 in NewRecord (R1, Call (None, op_Addition, [Value (1), Value
(2)]), B)
let B = 5 + 4 in NewRecord (R1, Call (None, op_Addition, [Value (1), Value
(2)]), B)
let B = 9 in NewRecord (R1, Call (None, op_Addition, [Value (1), Value (2)]), B)
{A = 3;
B = 9;}
Original comment by stephen....@gmail.com
on 9 Apr 2015 at 2:32
This is addressed by #150 👍
Complete and merged into fs46 branch / PR
Original issue reported on code.google.com by
stephen....@gmail.com
on 23 Mar 2015 at 6:38