Re: Comparison operator in value proxies

2011-04-20 Thread Adam Stankiewicz
Value types are supposed to be implementable in hardware if available. You are assuming they are objects with reference semantics. That contradicts their purpose and why we are discussing them as a new kind of type. I was talking about decimal proxies, not decimal primitives itself. Nothing

Re: Comparison operator in value proxies

2011-04-19 Thread Adam Stankiewicz
The reason === comes up with value types/proxies is the goal of supporting decimal and other number types, where 1.1m === something_computing_fresh_1_1m() must be true. If 1.1m was defined as singleton proxy, then === would work correctly, because both 1.1m and give_new_1_1() return the same

Comparison operator in value proxies

2011-04-17 Thread Adam Stankiewicz
Hello everyone, My idea is to disallow overwriting of === operator, and make 'compare' operator implement == instead. Why? 1. === means for me that two variables have reference to the same object, so there is no point of overwriting it. Many programmers would be confused. 2. == always caused

Re: Comparison operator in value proxies

2011-04-17 Thread Adam Stankiewicz
By overwriting I meant creating a trap for === operator. Sorry for confusion. Adam 2011/4/17 David Herman dher...@mozilla.com: I don't understand. What is overwriting an operator? Dave On Apr 17, 2011, at 7:52 AM, Adam Stankiewicz wrote: Hello everyone, My idea is to disallow