Re: Quoted substitution
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: Quoted substitution

From: Gerry Snyder <gerry.snyder@comcast.net>
Date: Mon Dec 19 2005 - 17:00:25 CET

suchenwi wrote:
> In addition, ( and ) are also accepted by the $ parser in array element
> syntax:
> % set a(b) 42
> 42
> % puts $a(b)
> 42
> % set a(b)c 43
> 43
> % puts $a(b)c
> 42c
> Evidently, the $ parser stops after the close-paren.
> But this behavior is described in the man page...
>

% set a(b) 42
42
% set a(b)c 43
43
% puts $a(b)c
42c
% puts ${a(b)c}
43

Yes, everything is just as expected.

In the case of $a(b)c the parser sees that the string following the
dollar sign contains parentheses, and is thus not a scalar variable of
the form $name . Therefore it is the name of an array element, which is
terminated by the closing parenthesis.

Gerry
Received on Fri Dec 23 19:02:13 2005