Re: Invalid command name ""
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Invalid command name ""

From: Michael A. Cleverly <michael@cleverly.com>
Date: Sat Jul 30 2005 - 03:02:07 CEST

On Fri, 29 Jul 2005, Aric Bills wrote:

> By the way, it is possible to define a Tcl procedure whose name is the empty
> string. Probably not a good idea,

I use this idiom with tdom fairly regularly. It allows me to write
something like:

[[$node selectNodes $xpath] someMethod]

where $xpath is an xpath expression that might return 0 or 1 nodes. To
avoid having to explicitly deal with the case where no nodes would be
returned I define:

proc "" args {}

Michael
Received on Thu Sep 29 14:28:02 2005