Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Tcl on slashdot...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 51 - 66 of 66 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Larry W. Virden  
View profile  
 More options Nov 15 2007, 10:15 am
Newsgroups: comp.lang.tcl
From: "Larry W. Virden" <lvir...@gmail.com>
Date: Thu, 15 Nov 2007 07:15:59 -0800 (PST)
Local: Thurs, Nov 15 2007 10:15 am
Subject: Re: Tcl on slashdot...

In my specific case, I'm typically trying to write software to make
use of a pacakge, but I'm either uncertain what specific name to use
for the package, or I'm using the right package, but something is
wrong with the package or with the installation.

As I previously wrote, all I get is a "can't find" type message.
Sometimes, because of reading comp.lang.tcl, etc. for years, I know to
start by looking through the directories in $auto_path , to see if the
software is installed in any of them. If not, then I have to figure
out why it was installed in the wrong place. If it is, then I know to
look in pkgIndex.tcl and to try and figure out what is wrong there.

However, there's no references to that error (or most of the others)
in any of the man pages, and the error message that is generated is
accurate, but less than helpful to developers without the background
to know where to start.

I'm not trying to say "Bad Tcl!!!" here. I'm just pointing out that
while many of Tcl's error messages are quite helpful in solving
problems, there are others (such as this one, which I hit pretty
frequently) which are less helpful.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
suchenwi  
View profile  
 More options Nov 15 2007, 10:33 am
Newsgroups: comp.lang.tcl
From: suchenwi <richard.suchenwirth-bauersa...@siemens.com>
Date: Thu, 15 Nov 2007 07:33:45 -0800 (PST)
Local: Thurs, Nov 15 2007 10:33 am
Subject: Re: Tcl on slashdot...
But isn't that problem comparable to
$ tclsh
% set foo 1
1
% puts $Foo
can't read "Foo": no such variable

"Case matters" is an old rule in Unix, C, and many other worlds...
Should the error message say "Make sure your capitalization is right"?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tom.rmadilo  
View profile  
 More options Nov 15 2007, 10:45 am
Newsgroups: comp.lang.tcl
From: "tom.rmadilo" <tom.rmad...@gmail.com>
Date: Thu, 15 Nov 2007 07:45:54 -0800 (PST)
Local: Thurs, Nov 15 2007 10:45 am
Subject: Re: Tcl on slashdot...
On Nov 15, 7:15 am, "Larry W. Virden" <lvir...@gmail.com> wrote:

> I'm not trying to say "Bad Tcl!!!" here. I'm just pointing out that
> while many of Tcl's error messages are quite helpful in solving
> problems, there are others (such as this one, which I hit pretty
> frequently) which are less helpful.

You probably wrote this as I was writing my response. Usually [package
require] is called from a page level script, inside a [namespace
eval]. In that case, you get the best information possible, assuming
you look at the full error message, you get a full file path and line
number. But only if you get the full error message. Not getting the
full error message is a programming mistake, not a language mistake.
If you use other peoples' code, you always run the risk that they
don't know what they are doing.

I seldom use [package require], I use a configuration/load script
which sources files and initializes code in a known order. It is
faster to source everything explicitly than it is to search for one
missing package. Failure should be fast, not slow. Programming should
be explicit, not guess-and-go. But, everyone appears to be happy to
make installation easy and debugging hard, go figure.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Donal K. Fellows  
View profile  
 More options Nov 15 2007, 11:00 am
Newsgroups: comp.lang.tcl
From: "Donal K. Fellows" <donal.k.fell...@man.ac.uk>
Date: Thu, 15 Nov 2007 08:00:19 -0800 (PST)
Local: Thurs, Nov 15 2007 11:00 am
Subject: Re: Tcl on slashdot...

Larry W. Virden wrote:
> I'm not trying to say "Bad Tcl!!!" here. I'm just pointing out that
> while many of Tcl's error messages are quite helpful in solving
> problems, there are others (such as this one, which I hit pretty
> frequently) which are less helpful.

The problem with this complaint is that it (largely) depends on
something being "not there", and so that generating an informative
error message would require knowing about code that hasn't been
executed. That would be pretty close to the pinnacle of TIP#131's
powers, let alone those of a normal script. :-)

Working out what didn't happen (or rather what didn't happen that
should have happened) remains difficult. But that's not special to any
language.

Donal.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tom.rmadilo  
View profile  
 More options Nov 15 2007, 11:39 am
Newsgroups: comp.lang.tcl
From: "tom.rmadilo" <tom.rmad...@gmail.com>
Date: Thu, 15 Nov 2007 08:39:37 -0800 (PST)
Local: Thurs, Nov 15 2007 11:39 am
Subject: Re: Tcl on slashdot...
On Nov 15, 8:00 am, "Donal K. Fellows" <donal.k.fell...@man.ac.uk>
wrote:

> The problem with this complaint is that it (largely) depends on
> something being "not there", and so that generating an informative
> error message would require knowing about code that hasn't been
> executed.

Finding errors depends 100% on logging the errorInfo when an error
occurs. If you don't do that, you can't complain that Tcl has
unhelpful error messages, you just threw away the information you
needed. Maybe you should ask "What stupid application would continue
to operate if it can't find a required package?" The program should be
complaining very loudly, but it appears to be suppressing the
information provided by Tcl.

Here is an example of a startup. I put in a bogus [package require]:

[15/Nov/2007:08:32:29.257970][27192.1696194768][-main-] Notice:
TWS:About to package require abXdcE
[15/Nov/2007:08:32:29.275229][27192.1696194768][-main-] Error:
TWS:can't find package abXdcE
    while executing
"package require abXdcE"
    (file "/web/nsd45/servers/tutos/modules/tcl/twsdl/packages/tdom/
tcl/tdom-procs.tcl" line 14)
    invoked from within
"::source /web/nsd45/servers/tutos/modules/tcl/twsdl/packages/tdom/tcl/
tdom-procs.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel ::source "$file""
    (procedure "::tws::sourceFile" line 4)
    invoked from within
"::tws::sourceFile [::tws::util::package::directory [file join
$packageName tcl ${packageName}-procs.tcl]]"
    (procedure "procs" line 4)
    invoked from within
"procs $package" PACKAGE tdom
[15/Nov/2007:08:32:29.275389][27192.1696194768][-main-] Notice:
TWS:Package wsdb: Procs loading...

The script had this appended:

log Notice "About to package require abXdcE"
package require abXdcE
log Notice "Done package require abXdcE"

So the last [log Notice] was skipped because the error aborts sourcing
the file, you get a full trace of the error. No mystery here.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Glenn Jackman  
View profile  
 More options Nov 15 2007, 12:00 pm
Newsgroups: comp.lang.tcl
From: Glenn Jackman <gle...@ncf.ca>
Date: 15 Nov 2007 17:00:43 GMT
Local: Thurs, Nov 15 2007 12:00 pm
Subject: Re: Tcl on slashdot...
At 2007-11-15 11:39AM, "tom.rmadilo" wrote:
>  On Nov 15, 8:00 am, "Donal K. Fellows" <donal.k.fell...@man.ac.uk>
>  wrote:
> > The problem with this complaint is that it (largely) depends on
> > something being "not there", and so that generating an informative
> > error message would require knowing about code that hasn't been
> > executed.
[...]
>  TWS:can't find package abXdcE
>      while executing
>  "package require abXdcE"

[... full trace ...]

>  So the last [log Notice] was skipped because the error aborts sourcing
>  the file, you get a full trace of the error. No mystery here.

I think the mystery from Larry's perspective is "why can't package
abXdcE be found?  I know it's there but I don't know precisely what it's
name is." The fact that Tcl's catchable errors are very informative
sheds no light there.

--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Larry W. Virden  
View profile  
 More options Nov 15 2007, 12:19 pm
Newsgroups: comp.lang.tcl
From: "Larry W. Virden" <lvir...@gmail.com>
Date: Thu, 15 Nov 2007 09:19:30 -0800 (PST)
Local: Thurs, Nov 15 2007 12:19 pm
Subject: Re: Tcl on slashdot...
On Nov 15, 10:33 am, suchenwi <richard.suchenwirth-

bauersa...@siemens.com> wrote:
> But isn't that problem comparable to
> $ tclsh
> % set foo 1
> 1
> % puts $Foo
> can't read "Foo": no such variable

> "Case matters" is an old rule in Unix, C, and many other worlds...
> Should the error message say "Make sure your capitalization is right"?

I don't think we have to go to that level. But should the
documentation somewhere indicate that variables are case sensitive,
and the tutorial or doc or something mention that "no such variable"
could mean that the casing was wrong, or that the variable had not yet
been set, or that the variable had been unset by this time, or that it
existed in a different namespace? That would at least give the
programmer some ideas of the kinds of things that might cause the
problem, right?

I'm not saying that all of this belongs in the man page. But surely
somewhere a new programmer could hope to find some sort of guide.
Certainly there's a great guide for Perl that provides the reader with
at least some ideas on what to do next when encountering certain error
messages...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
suchenwi  
View profile  
 More options Nov 15 2007, 12:20 pm
Newsgroups: comp.lang.tcl
From: suchenwi <richard.suchenwirth-bauersa...@siemens.com>
Date: Thu, 15 Nov 2007 09:20:37 -0800 (PST)
Local: Thurs, Nov 15 2007 12:20 pm
Subject: Re: Tcl on slashdot...
Just to add, a quick way of checking "correct" package names is, in an
interactive tclsh:
% packa re ""
% join [lsort [package names]] /n

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tom.rmadilo  
View profile  
 More options Nov 15 2007, 12:23 pm
Newsgroups: comp.lang.tcl
From: "tom.rmadilo" <tom.rmad...@gmail.com>
Date: Thu, 15 Nov 2007 09:23:01 -0800 (PST)
Local: Thurs, Nov 15 2007 12:23 pm
Subject: Re: Tcl on slashdot...
On Nov 15, 9:00 am, Glenn Jackman <gle...@ncf.ca> wrote:

> I think the mystery from Larry's perspective is "why can't package
> abXdcE be found?  I know it's there but I don't know precisely what it's
> name is." The fact that Tcl's catchable errors are very informative
> sheds no light there.

Gee, I hope that isn't true, but maybe it is. The first thing a
developer should figure out is the exact name of the package they want
to require. This goes along with my complaint about optimistic
programming. If proc and/or package names ever become case
insensitive, that would be a real disaster. Duct tape programming
models work well up until they don't.

Next thing you know, there will be a TIP asking for hard coded paths
to be auto converted based upon platform, to avoid the necessity of
abstracting paths with [file] commands.

So to tie this back into the 'Tcl is easy' meme, I'll just add that
robust programming isn't easy. Guess-and-go programming is not robust.
Tcl makes it easier to write robust programs, not guess-and-go
programs.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Larry W. Virden  
View profile  
 More options Nov 15 2007, 12:23 pm
Newsgroups: comp.lang.tcl
From: "Larry W. Virden" <lvir...@gmail.com>
Date: Thu, 15 Nov 2007 09:23:44 -0800 (PST)
Local: Thurs, Nov 15 2007 12:23 pm
Subject: Re: Tcl on slashdot...
On Nov 15, 12:00 pm, Glenn Jackman <gle...@ncf.ca> wrote:

And, in other cases, I know not only that it is there, but I know
precisely what its name is. But Tcl doesn't find it anyways.
Generally, after much head scratching, what I find is a mangled
pkgIndex.tcl or some other weird case. But, as Glenn accurately points
out, Tcl's error message tells me plenty about my code - where I typed
the command - but very little about the steps it took to decide that
the file that I "know" is there isn't being seen...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Larry W. Virden  
View profile  
 More options Nov 15 2007, 12:26 pm
Newsgroups: comp.lang.tcl
From: "Larry W. Virden" <lvir...@gmail.com>
Date: Thu, 15 Nov 2007 09:26:52 -0800 (PST)
Local: Thurs, Nov 15 2007 12:26 pm
Subject: Re: Tcl on slashdot...
On Nov 15, 11:00 am, "Donal K. Fellows" <donal.k.fell...@man.ac.uk>
wrote:

> The problem with this complaint is that it (largely) depends on
> something being "not there"

If, however, there were some extra command, or option, or variable, or
flag that could be set that said "show me the places you are looking
and why you are rejecting what you are rejecting, then I might be able
to say "oh look, it read the right file, but decided that the item
there wasn't relevant because ..." or "oh look, it didn't look in the
directory where the package is installed because ..." or whatever.

Right now, trying to figure out what is going on inside the process is
a black box - which is the right thing when everything works. It just
is a nuisance when something is going wrong and you need to figure out
what.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Larry W. Virden  
View profile  
 More options Nov 15 2007, 12:28 pm
Newsgroups: comp.lang.tcl
From: "Larry W. Virden" <lvir...@gmail.com>
Date: Thu, 15 Nov 2007 09:28:48 -0800 (PST)
Local: Thurs, Nov 15 2007 12:28 pm
Subject: Re: Tcl on slashdot...
On Nov 15, 12:20 pm, suchenwi <richard.suchenwirth-

bauersa...@siemens.com> wrote:
> Just to add, a quick way of checking "correct" package names is, in an
> interactive tclsh:
> % packa re ""
> % join [lsort [package names]] /n

probably want to use

join [lsort [package names]] \n

to make it a wee bit easier to read...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
suchenwi  
View profile  
 More options Nov 15 2007, 12:34 pm
Newsgroups: comp.lang.tcl
From: suchenwi <richard.suchenwirth-bauersa...@siemens.com>
Date: Thu, 15 Nov 2007 09:34:50 -0800 (PST)
Local: Thurs, Nov 15 2007 12:34 pm
Subject: Re: Tcl on slashdot...
On 15 Nov., 18:28, "Larry W. Virden" <lvir...@gmail.com> wrote:

> On Nov 15, 12:20 pm, suchenwi <richard.suchenwirth-

> bauersa...@siemens.com> wrote:
> > Just to add, a quick way of checking "correct" package names is, in an
> > interactive tclsh:
> > % packa re ""
> > % join [lsort [package names]] /n

> probably want to use

> join [lsort [package names]] \n

> to make it a wee bit easier to read...

Of course - sorry, was multitasking too much to check what I actually
posted... :^)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tom.rmadilo  
View profile  
 More options Nov 15 2007, 12:37 pm
Newsgroups: comp.lang.tcl
From: "tom.rmadilo" <tom.rmad...@gmail.com>
Date: Thu, 15 Nov 2007 09:37:10 -0800 (PST)
Local: Thurs, Nov 15 2007 12:37 pm
Subject: Re: Tcl on slashdot...
On Nov 15, 9:23 am, "Larry W. Virden" <lvir...@gmail.com> wrote:

> And, in other cases, I know not only that it is there, but I know
> precisely what its name is. But Tcl doesn't find it anyways.
> Generally, after much head scratching, what I find is a mangled
> pkgIndex.tcl or some other weird case. But, as Glenn accurately points
> out, Tcl's error message tells me plenty about my code - where I typed
> the command - but very little about the steps it took to decide that
> the file that I "know" is there isn't being seen...

As Alexandre Ferrieux pointed out in another thread, strace is your
friend:

$ strace -o /tmp/log-file-access.txt tclsh

You will get a list of every directory searched. If you want the full
path, just try to find a package which doesn't exist. One problem with
[package require] is that you can mangle up the auto_path, so one
package might screw up something which used to work. This is a perfect
example of why using fuzzy programming is objectively annoying, and
strikes at the least helpful time. All of this plagues any language
which uses shared libraries, the problem is that with Tcl, using
shared libraries only saves disk space, in C, you save memory.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Darren New  
View profile  
 More options Nov 15 2007, 2:05 pm
Newsgroups: comp.lang.tcl
From: Darren New <d...@san.rr.com>
Date: Thu, 15 Nov 2007 11:05:35 -0800
Local: Thurs, Nov 15 2007 2:05 pm
Subject: Re: Tcl on slashdot...

ewilsonm...@gmail.com wrote:
> However, I would've thought that Brian Kernighan's comment would have
> given some indication that Tcl is not simple.

I'd note that Tcl is simple enough that, unlike C and C++, one doesn't
find programs out there to translate type declarations into English for
you so you can figure out what the compiler thinks you wrote.

--
   Darren New / San Diego, CA, USA (PST)
     Remember the good old days, when we
     used to complain about cryptography
     being export-restricted?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Schlenker  
View profile  
 More options Nov 15 2007, 2:55 pm
Newsgroups: comp.lang.tcl
From: Michael Schlenker <schl...@uni-oldenburg.de>
Date: Thu, 15 Nov 2007 20:55:47 +0100
Local: Thurs, Nov 15 2007 2:55 pm
Subject: Re: Tcl on slashdot...
Larry W. Virden schrieb:

> On Nov 15, 11:00 am, "Donal K. Fellows" <donal.k.fell...@man.ac.uk>
> wrote:

>> The problem with this complaint is that it (largely) depends on
>> something being "not there"

> If, however, there were some extra command, or option, or variable, or
> flag that could be set that said "show me the places you are looking
> and why you are rejecting what you are rejecting, then I might be able
> to say "oh look, it read the right file, but decided that the item
> there wasn't relevant because ..." or "oh look, it didn't look in the
> directory where the package is installed because ..." or whatever.

It is there inside the tcl libraries package.tcl file. Just register
your own version of the proc there before things go bad.

Michael


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »