modern Tcl and correct quoting

Poor Yorick org.macosforge.lists.macports-dev at pooryorick.com
Wed Jun 12 12:47:24 PDT 2013


On Thu, Jun 13, 2013 at 02:39:52AM +1000, Joshua Root wrote:
> 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.
> 

That's a good point.  I'm working on a new version of the patch, so where it
looks like it should be a boolean comparion I'll remove any equality operators.

-- 
Yorick


More information about the macports-dev mailing list