Ticket #29 (closed defect: duplicate)
a+ b performs (juxtaposition) multiplication, not addition
| Reported by: | djb | Owned by: | sukyoungryu |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | interpreter | Version: | 1.0 |
| Keywords: | postfix juxtaposition + plus operator precedence | Cc: | David.Biesack@… |
Description
The following program
export Executable run(args:String...) :() = do
a = 3 b = 10 println ("a=" a ", b=" b) c = a+ b println ("a+ b=" c) d = a + b println ("a +b=" d) e = a+b println ("a+b=" e)
end
produces the output
a=3, b=10 a+ b=30 a +b=13 a+b=13
It appears that the expression
a+ b
is doing multiplication due to juxtaposition of the "expression" (a+) and (b). However, I cannot find a reference to a postfix + operator in the LRM. Sorry if it is there and I missed it. However, if intentional, this does feel counterintuitive.
I'm using code from Subversion, updated todat (Oct 31, 2007)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


