modern Tcl and correct quoting
Joshua Root
jmr at macports.org
Wed Jun 12 09:39:52 PDT 2013
On 2013-6-13 01:24 , Poor Yorick wrote:
> On Wed, Jun 12, 2013 at 10:58:50PM +1000, Joshua Root wrote:
>> On 2013-6-12 22:00 , Rainer Müller wrote:
>>> On 2013-06-12 08:05, Poor Yorick wrote:
>>>> use "eq" instead of "==" where appropriate
>>>
>>> Fine as well.
>>
>> What is the benefit of this? Is it just that the operands could
>> potentially be numerically equal but different strings, in cases where
>> we want an exact string match?
>>
>
> It's mostly for performance, as "eq" allows Tcl to avoid the running the
> heuristics to determe what types of values are being compared, but there are
> edge cases where using "==" will use numerical comparison where string
> comparison was intended or vice versa. Borrowing from Python Zen, "Explicit is
> better than implicit".
OK. Some of the places changed in the patch are comparing boolean values
though, so it's not clear that we should even be doing an equality check
in the first place.
- Josh
More information about the macports-dev
mailing list