modern Tcl and correct quoting

Lawrence Velázquez larryv at macports.org
Wed Jun 12 17:42:57 PDT 2013


On Jun 12, 2013, at 5:57 PM, Ryan Schmidt <ryandesign at macports.org> wrote:

> I would guess that most programmers who wrote "==" in Tcl didn't realize it was a numeric comparison operator. It certainly wasn't clear to me, since it works correctly on most strings. That kind of thing trips me up in bash scripting as well. In addition to base, most Portfiles get this wrong too. It's even all over our recommended code snippets in the PortfileRecipes wiki page.

This confused me when I got started with Tcl, as most of the Tcl documentation recommended using "eq"/"ne" for string comparison (for all the reasons mentioned previously), while MacPorts used "==" everywhere. I figured it was just the house style or something.

vq


More information about the macports-dev mailing list