SwensenSoftware / unquote

Write F# unit test assertions as quoted expressions, get step-by-step failure messages for free
http://www.swensensoftware.com/unquote
Apache License 2.0
285 stars 26 forks source link

Leading tilda for prefix operator lambdas should only be used when the operator can also be a infix operator #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
e.g. the following is wrong:

> decompile <@ (~~~) @>;;
val it : string = "(~~~~)"

it should obviously decompile to simply (~~~)

Original issue reported on code.google.com by stephen....@gmail.com on 23 Apr 2012 at 2:21

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 23 Apr 2012 at 2:25

GoogleCodeExporter commented 9 years ago
Actually, the rule, from the spec, is 

"The operators +,  -, +., -., %, &, && can be used as both prefix and infix 
operators. When these operators are used as prefix operators, the tilde 
character is prepended to generate the operator name. For example, -x is parsed 
as an application of the operator ~- to the identifier x. This generated name 
is also used in definitions for these prefix operators, so the following prefix 
operators are defined with the ~ character added"

Original comment by stephen....@gmail.com on 29 Apr 2012 at 4:52

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 29 Apr 2012 at 5:07

GoogleCodeExporter commented 9 years ago
Note that the spec ommits (~%%) as another op requiring leading tilda. But, is 
a moot point since "error FS0415: First-class uses of the expression-splicing 
operator are not permitted"

Original comment by stephen....@gmail.com on 29 Apr 2012 at 5:23

GoogleCodeExporter commented 9 years ago
Actually, (~%%) does need to be considered, if it is redefined and thus valid 
as a first-class function.

Original comment by stephen....@gmail.com on 29 Apr 2012 at 5:36

GoogleCodeExporter commented 9 years ago
This is related to issue 25

Original comment by stephen....@gmail.com on 29 Apr 2012 at 6:00

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r515.

Original comment by stephen....@gmail.com on 29 Apr 2012 at 6:01

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 20 May 2012 at 4:23