modern Tcl and correct quoting

Lawrence Velázquez larryv at macports.org
Wed Jun 12 13:33:56 PDT 2013


On Jun 12, 2013, at 3:47 PM, Poor Yorick <org.macosforge.lists.macports-dev at pooryorick.com> wrote:

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

Note that changing something like

    if {$whatever == "yes"} { foo } else { bar }

into

    if {$whatever} { foo } else { bar }

subtly changes the semantics of the conditional. This transformation is only valid if $whatever is certain to be a valid Tcl boolean.

vq


More information about the macports-dev mailing list