in reply to Re: (tye)Re3: eq or == with references
in thread eq or == with references
"Numbers are not strings, therefore you shouldn't use eq to compare references." You can't append references together. You can't take substrings of references. etc.
I also do not understand the statement that using '==' is more efficient when comparing references than is 'eq'. [...] Larry could simply take the algorithm that he uses for the '==' operator and use it for the 'eq' operator when comparing references
Yes, you don't understand what is going on. The == operator has nothing special about it in regard to references. The == operator just requests the numeric value of its operands (or "evaluates them in a numeric context") then compares the results. This is what it does for all scalars whether they are references or not.
The eq operator requests the string value of its operands and then compares them. References return a descriptive string that also includes their "pointer" value in hex. To make the eq operator on references not require the construction of this descriptive string would require that eq have special code added to detect references and perform a different operation. Such added code probably defeats the point of trying to make eq on references more efficient.
- tye (but my friends call me "Tye")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re4: eq or == with references
by sierrathedog04 (Hermit) on Jul 09, 2001 at 22:30 UTC |