Tcl Source Code

View Ticket
Login
Ticket UUID: 2962834
Title: Bugfixes in tutorial examples
Type: Bug Version: None
Submitter: andreas_kupries Created on: 2010-03-03 19:45:56
Subsystem: 75. Tutorial Assigned To: davidw
Priority: 5 Medium Severity:
Status: Open Last Modified: 2010-03-04 02:52:09
Resolution: None Closed By:
    Closed on:
Description:
This is based on the discussion at
http://community.activestate.com/forum/trouble-activetcl-85-and-tutorial

Attached a patch fixing syntax errors in the examples of lesson 25.

The patch also contains a change to the example in lesson 26a, this however is more arguable. It depends on if the tutorial is target at Tcl 8.5 or 8.4. One easy trick to handle stuff like this would be to write the proper 'package require Tcl 8.x' in the examples.


The echo server in lesson 40 has some problems ... No patch for that as I saw the reference to it in the discussion only today, when I was writing up this note. I note:

(1) The channels are not configured -blocking 0
(2) gets returning < 0 is treated as EOF. That is wrong.
     gets can return < 0 when the data received so far is not a complete line yet (fblocked!).
     gets < 0 => abort event handling.
     Handle eof explicitly before that, by checking with [eof ...].

Wiki page http://wiki.tcl.tk/14071 has a larger example, albeit even that has bug (1).
User Comments: andreas_kupries added on 2010-03-04 02:45:56:

File Added - 365299: tutorial-changes.diff-wu

Attachments: