Re: File Descriptors

From: Ian Bell (ruffrecords_at_yahoo.com)
Date: 12/30/04


Date: Thu, 30 Dec 2004 15:38:24 +0000

Cameron Laird wrote:

> In article <cqv4id$a3l$1@slavica.ukpost.com>,
> Ian Bell <ruffrecords@yahoo.com> wrote:
> .
> .
> .
>>Like a shaft of bright sunlight. Many thanks. It is interesting that much
>>less emphasis seems to be placed on this topic in the two tcl/tk books I
>>have. Although I am relatively new to tcl/tk, the more I use it the more
>>I am impressed by its elegance.
> .
> .
> .
> Any elaboration of this reaction is timely. At least one Tcl
> book is in preparation now, as well as at least one article on
> exception-handling. How would these matters best be documented
> for *you*?

I think that depends somewhat one where you are coming to tcl/tk from. I
assume the majority new users of tcl/tk will be familiar with C and with
making system calls and are looking for a fast painless way to create
applications.

That said, I would rather that tcl/tk books did not dive straight into the
syntax of the language, but begin with an overview of the the language and
its approach to standard application issues. So IMHO Chapter 1 should
include the following topics:

Tcl program structure
Namespaces
Bytecode interpreter
Error/Exception handling
Strings and Numbers
Tk event loop
Resource Management

With regard to error handling in particular, most of my application needs
involve interaction with various PC ports (serial, parallel etc) which on
most stock Linux distros will require root privileges. Error handling
therefore has important security implications.

So, my needs would be best met by documenting:

Conditions under which exceptions occur
Security issues (e.g. permissions and race conditions)
Tcl/Tk internal handling of exceptions
Handling exceptions yourself

The two books I use at present are Practical programming in Tcl & Tk (3rd
edition) and Graphical Applications with Tcl & Tk. Taken together these do
not cover all the above topics nor IMHO do they go into sufficient depth.

HTH

Ian

-- 
Ian Bell


Relevant Pages

  • Re: Favorite SW for vocab drills?
    ... since Bill's grumblings about Tcl/Tk are the first in the 3 years ... or so that JBDrill has been around, I have to conclude that other people ... The reason I used Tcl/Tk was not Tcl's string handling, ... It involves wrapping the Tcl up in a driver program ...
    (sci.lang.japan)
  • Re: Error handling in VB6
    ... The VB syntax for catching and handling errors is definitely not ... exceptions thrown in Main, and in anything called from Main. ... OnError GoTo SomeErrHandler ... VB6 has no such thing as a global error handler. ...
    (microsoft.public.vb.general.discussion)
  • Re: rebuilding expect with different timer
    ... sleep command and handling timeouts. ... handling core, it should pick up the virtual times if you set them up. ... this is exactly why those APIs were introduced - to allow for Tcl and extensions built on Tcl that use Tcl_Time-based APIs to get a skewed sense of time. ... The time virtualization API should be fully sufficient for simulating both slower and faster time. ...
    (comp.lang.tcl)
  • Re: rebuilding expect with different timer
    ... sleep command and handling timeouts. ... handling core, it should pick up the virtual times if you set them up. ... this is exactly why those APIs were introduced - to allow for Tcl and extensions built on Tcl that use Tcl_Time-based APIs to get a skewed sense of time. ... The time virtualization API should be fully sufficient for simulating both slower and faster time. ...
    (comp.lang.tcl)
  • Re: Practical error/exception handling...
    ... >> exceptions be iterated in order to get a better response. ... >> What I have done in the past is to have a database table of error codes ... >> error to a global error handling routine that can roll back transactions ... deal with a missing network connection or a file being locked when these ...
    (alt.comp.lang.borland-delphi)