modern Tcl and correct quoting
Poor Yorick
org.macosforge.lists.macports-dev at pooryorick.com
Wed Jun 12 14:32:34 PDT 2013
On Wed, Jun 12, 2013 at 10:58:12PM +0200, Clemens Lang wrote:
> Hi,
>
> On Wed, Jun 12, 2013 at 04:33:56PM -0400, Lawrence Velázquez wrote:
> > 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.
>
> I think we do have [tbool whatever] for that, we're just not using it
> everywhere we could.
>
Tcl will also complain loudly if the value is not a boolean, so if there is a
problem anywhere, it should be straightforward to diagnose.
--
Yorick
More information about the macports-dev
mailing list