Closed GoogleCodeExporter closed 9 years ago
let ``locally redefined standard infix op sprinted as infix op when fully
applied`` () =
let (+) x y = x + y : int
<@ 1 + 1 @>
``locally redefined standard infix op sprinted as infix op when fully applied``
();;
val it : Quotations.Expr<int> =
Application (Application (Value (<fun:op_Addition@1128-1>), Value (1)),
Value (1))
Original comment by stephen....@gmail.com
on 12 May 2012 at 4:00
A bit of a revelation:
let (+) x y z = x + y + z : int
<@ (1 + 2) 3 @>
is valid. That is,
let (+) x y z = x + y + z
is semantically equivalent to
let (+) x y = fun z -> x + y + z
(of course, we knew this as it relates to currying in general, but didn't make
the leap that it applies to operators as well. the lesson being that
definitions of (+) are always infix operators, even if they appear to take more
than two args at the definition point.).
Original comment by stephen....@gmail.com
on 13 May 2012 at 12:56
This issue was closed by revision r535.
Original comment by stephen....@gmail.com
on 13 May 2012 at 3:11
Original comment by stephen....@gmail.com
on 20 May 2012 at 4:23
Original issue reported on code.google.com by
stephen....@gmail.com
on 30 Apr 2012 at 12:05