Re: puts variable without quoting
- From: Roy Terry <roy@xxxxxxxxxxxxx>
- Date: Thu, 13 Sep 2007 08:53:31 -0700
slebetman@xxxxxxxxx wrote:
On Sep 13, 6:33 am, John Kelly <j...@xxxxxxxxxxxx> wrote:No not really. I wish we would all stop chanting this out-datedOn Wed, 12 Sep 2007 17:20:41 -0500, Bruce Hartweg
<no.spam....@xxxxxxxxxxx> wrote:I think the OP understood the quoting aspect to make a singleFor a standpoint of style, it might seem preferable to always use
arg to a command, and saw that a single variable was also a single word
but was wondering about performance of quoting it anyway.
quotes with a puts string.
Actually I disagree with this. For a standpoint of style:
puts $something
looks better to me than
puts "$something"
There may be some who would think that quoting in "" signifies a
string making the intentions clearer but this misunderstands the
nature of Tcl:
1. everything is a string anyway
mantra. It just doesn't seem very helpful. True most values can
be usefully represented as strings. But notice this catch for
someone who wants to take the EIS on face value:
if {joe eq mike} {puts wow}
==> syntax error in expression "joe eq mike": variable references require preceding $
So is it a good idea to say " *everything* is a string anyway"?
2. "quotes" don't singnify strings in tcl, instead they allow theYes. Nor do {} signify list as many seem to believe.
parser to group multiple words into a single "word" just like {braces}
.
In addition, for puts-ing single variables, you'll notice that most
Tclers omit the "$quotes" as a matter of style. So stylewise the
standard is to not use "".
- Follow-Ups:
- Re: puts variable without quoting
- From: Bruce Hartweg
- Re: puts variable without quoting
- From: suchenwi
- Re: puts variable without quoting
- References:
- puts variable without quoting
- From: John Kelly
- Re: puts variable without quoting
- From: Bryan Oakley
- Re: puts variable without quoting
- From: Cameron Laird
- Re: puts variable without quoting
- From: Bruce Hartweg
- Re: puts variable without quoting
- From: John Kelly
- Re: puts variable without quoting
- From: slebetman@xxxxxxxxx
- puts variable without quoting
- Prev by Date: Re: puts variable without quoting
- Next by Date: Re: puts variable without quoting
- Previous by thread: Re: puts variable without quoting
- Next by thread: Re: puts variable without quoting
- Index(es):
Relevant Pages
|