Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-01-05
01:37 • Ticket [1092508fff] Tutorial implies false quoting requirements status still... artifact: 882ce40954 user: hobbs
01:13 • Ticket [1092508fff]: 4 changes artifact: 521aff6419 user: davidw
00:16 • Add attachment 1092508.patch to ticket [1092508fff] artifact: ec9d761bf0 user: dgp
00:16 • Ticket [1092508fff] Tutorial implies false quoting requirements status still... artifact: 250edccf19 user: dgp
00:16 • Ticket [1092508fff]: 4 changes artifact: af95e345f9 user: dgp
00:13 • Ticket [1092508fff]: 4 changes artifact: 747115906e user: dgp
2005-01-04
23:40 • Ticket [1092508fff]: 4 changes artifact: 73f7bfe3d7 user: davidw
23:16 • Ticket [1092508fff]: 4 changes artifact: 079362bbe9 user: dgp
21:02 • Closed ticket [1092508fff]. artifact: 6a4d1ea176 user: davidw
2004-12-30
05:53 • Ticket [1092508fff]: 4 changes artifact: 587df2aad4 user: davidw
2004-12-29
09:37 • Ticket [1092508fff]: 4 changes artifact: ece6127f2d user: hobbs
02:34 • New ticket [1092508fff]. artifact: d966564f7f user: dgp

Tutorial implies false quoting requirements

Closed1092508fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-12-29 02:34:19
In its earliest lessons and examples,
the tutorial implies quoting requirements
that do not exist.

Page:

http://www.tcl.tk/man/tcl8.5/tutorial/Tcl2.html

includes the example:

    set fruit "Cauliflower"

In the next page, the example includes:

     set Z "Albany"
     
The "..." quoting is legal, but not necessary.
Using this quoting style in the first examples
of Tcl commands strongly suggests the
quoting is necessary. This kind of misimpression
early on can lead to faulty beliefs that "..." quoting
creates a "value", or that {...} quoting creates
a "list".  Better to learn early on (both explicitly
and by implication) that Tcl's syntax rules
determine word boundaries and substitution.
No more; no less.

I believe this quoting style is one
favored by the TclTutor author as
a way to indicate programmer intent
regarding values vs. variable names.
It's a fine coding convention to
introduce later on once the precise
syntax requirements of Tcl are well
established.  I think the early lessons
in the tutorial should make use of
only necessary syntax to avoid any
confusion about what Tcl requires
vs. what some coding convention
recommends.
hobbsplain2004-12-29 09:37:46
Logged In: YES 
user_id=72656

While I agree that quoting should be addressed early on (as
continued use of "" can lead a person into quoting hell by
accident), I should note that I use ""s often where "not
necessary" simply because my editor will color it nicely,
which is appropriate in context.
davidwplain2004-12-30 05:53:23
Logged In: YES 
user_id=240

I usually use quotes for consistency's sake, but you are
indeed correct that people should be shown early on that Tcl
is different this way.... you dont' *need* the quotes if you
don't have any spaces.
davidwplain2005-01-04 21:02:17
Logged In: YES 
user_id=240

I added an example like this:

puts HelloWorld

in the first chapter, and changed some of the others to not
use quoting.

Have a look and see if you think it's adequate.  I'm going
to go ahead and close the bug, but I'd be happy to add some
more.
dgpplain2005-01-04 23:16:01
Logged In: YES 
user_id=80530

I don't see the change.  Does something
need to be done to publish the change
on the www.tcl.tk web site?
davidwplain2005-01-04 23:40:31
Logged In: YES 
user_id=240

That requires manual intervention by someone with access to
the web server.  It would be nice if there were a cron job
pulling these changes out, but once again, someone with
access to the web site would have to "make it so".  It's all
plain HTML, so if you want, it's also possible to just pull
it out of CVS and view it as a local document.
dgpplain2005-01-05 00:13:51
Logged In: YES 
user_id=80530

that example helps. yes.

Here's a patch with other changes
to that page you might consider.

Something else to think about
is careful use of the terms "string"
and "word" in discussing Tcl syntax.
dgpplain2005-01-05 00:16:23
Logged In: YES 
user_id=80530

Yes, that example helps.

Attached is a patch of
other changes to that page
for you to consider.

I think I'd also drop the quotes
from the first example on the
following page to get:

  set fruit Cauliflower

Another thing to think about
is more careful use of the
terms "string" and "word".

Do you want comments filed
like this in the Bug Tracker?
Or is some other mechanism better?
dgpplain2005-01-05 00:16:24
File Added - 114469: 1092508.patch
davidwplain2005-01-05 01:13:04
Logged In: YES 
user_id=240

Fixes, bugs and quick comments are fine on the bug tracker.
 Discussion of major changes should be on tcl-core.

Personal email to me is ok too for quick things, I use that
as a sort of bug tracker sometimes:-)
hobbsplain2005-01-05 01:37:25
Logged In: YES 
user_id=72656

RE: the web issue, I'm hoping that this gets folded into the
Tcl core docs, so it gets updated with each release, as the
other docs on the web site do.
Log in (anonymous is fine) to add a comment.

Attachments: