Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PRE-ANNOUNCE: Online Tcl Cookbook

13 views
Skip to first unread message

Jeff Hobbs

unread,
Sep 7, 2001, 8:34:10 PM9/7/01
to
I'd like to invite people to participate in a new online Tcl Cookbook
that ActiveState has created at:

http://aspn.activestate.com/ASPN/Cookbook/Tcl

This is a new collaborative website, built by ActiveState, which will
host your contributions to The Art of Tcl Programming. We invite you
to contribute code, comments, and ratings for recipes from the entire
Tcl community. This living collection will allow programmers to be
more productive with Tcl, and will provide a dynamic space for the
rapid content development of a cookbook.

This is in some ways like the wiki, but oriented purely for code
snippets, presented in a structured manner. It has fancy code
colorization, comment abilities, ratings and search.

Please take part in creating the best online Tcl Cookbook!

[BTW, the ActiveState Python Cookbook, which got a head start,
already has 120 recipes! We can do better than that!]

--
Jeff Hobbs The Tcl Guy
Senior Developer http://www.ActiveState.com/
Tcl Support and Productivity Solutions

Cameron Laird

unread,
Sep 8, 2001, 8:28:17 AM9/8/01
to
In article <3B996782...@ActiveState.com>,

Jeff Hobbs <Je...@ActiveState.com> wrote:
>I'd like to invite people to participate in a new online Tcl Cookbook
>that ActiveState has created at:
>
> http://aspn.activestate.com/ASPN/Cookbook/Tcl
>
>This is a new collaborative website, built by ActiveState, which will
>host your contributions to The Art of Tcl Programming. We invite you
>to contribute code, comments, and ratings for recipes from the entire
>Tcl community. This living collection will allow programmers to be
>more productive with Tcl, and will provide a dynamic space for the
>rapid content development of a cookbook.
>
>This is in some ways like the wiki, but oriented purely for code
>snippets, presented in a structured manner. It has fancy code
>colorization, comment abilities, ratings and search.
>
>Please take part in creating the best online Tcl Cookbook!
>
>[BTW, the ActiveState Python Cookbook, which got a head start,
>already has 120 recipes! We can do better than that!]
.
.
.
Jeff, thank you for saying a few words that distinguish the
role of the Cookbook from that of the Wiki. You (and others
with ideas on the subject) can help me by elaborating that
comparison. My head's full of ideas, and, in each case, I
conclude that the Wiki is the best place for them. Part of
this might be operating on an affective level; one rumor has
it that you regard the Wiki as "sloppy" or somesuch, while
its realization utterly enchants me.

So: why should the Cookbook appeal to me? How do we differ-
entiate the values it, and the Wiki, provide?
--

Cameron Laird <cla...@NeoSoft.com>
Business: http://www.Phaseit.net
Personal: http://starbase.neosoft.com/~claird/home.html

Mike and Clairone Delaney

unread,
Sep 8, 2001, 9:56:59 AM9/8/01
to
This looks like a very nice site, though it's just getting started. I've
attempted to make my own compilation at home of snippets from comp.lang.tcl,
the Wiki, etc. in a WebSpace tree hierarchy (lets you organize URLs and
pieces of text), but it's hard to keep up with, and I'd much rather consult
a community resource like this. Thanks for doing it!

Maybe I can help put some of the code snippets I've collected in there, but
none of it's original---just wise advice from the gurus in here, including
you. Unfortunately, I haven't always remembered to document the source, so
giving proper credit would be a problem.

"Jeff Hobbs" <Je...@ActiveState.com> wrote in message
news:3B996782...@ActiveState.com...

Jeffrey Hobbs

unread,
Sep 8, 2001, 12:36:24 PM9/8/01
to
Cameron Laird wrote:
>
> In article <3B996782...@ActiveState.com>,
> Jeff Hobbs <Je...@ActiveState.com> wrote:
> >I'd like to invite people to participate in a new online Tcl Cookbook
> >that ActiveState has created at:
> >
> > http://aspn.activestate.com/ASPN/Cookbook/Tcl
...

> >This is in some ways like the wiki, but oriented purely for code
> >snippets, presented in a structured manner. It has fancy code
> >colorization, comment abilities, ratings and search.
...

> Jeff, thank you for saying a few words that distinguish the
> role of the Cookbook from that of the Wiki. You (and others
> with ideas on the subject) can help me by elaborating that
> comparison. My head's full of ideas, and, in each case, I
> conclude that the Wiki is the best place for them. Part of
> this might be operating on an affective level; one rumor has
> it that you regard the Wiki as "sloppy" or somesuch, while
> its realization utterly enchants me.

Yes, I do regard the Wiki as too free-formed to be good for
all users, which is why I made sure to note structure in the
Cookbook above. Take for example a simple "Tcl Recipe":

http://aspn.activestate.com/ASPN/Cookbook/Tcl/Recipe/65429

This shows the procedure in a colorized manner - very easy
for new users (and old) to see the strings, vars and key procs.
There is a quick link to raw text of each recipe - all recipes
may be shared and copied.

In the header area, you get the author's name (that's actually
whoever submitted the recipe), and a quick link to see all other
recipes by this author. It provides categorization, rating and
versioning as well. Their are the distinct discussion and
comment sections as well. I haven't tested it, but I think
the comments may mail the submitter as well (if it doesn't I'll
be asking for that feature). The search is great as well - for
me the wiki searching has been mostly broken for a long time.
Andreas tells me this is an IE problem (I get constant 404s when
trying to search), but if the search doesn't work for the most
popular browser in the world... hmph.

In any case, it really is oriented towards code snippets, and
provides something that I believe is missing for the community
today. The wiki suffices for this in some way, but lacks key
features like code colorization and *ease of use* - things like
remembering that each code section must be fully prefixed with
a space.

That said, I'm hoping that this will really be complementary to
the wiki, because I believe that the wiki is a valuable resource.
I'm a constant addict of the wiki chat (although that has it's
own quirks - hey, it's written in perl, what can you expect?).
I believe that many of the "conversations" recorded there are
very valuable (roadmaps, future thoughts, ways to get around
problems). Thus, I don't want you to think that I don't find the
wiki valuable, I just believe that certain aspects can be made
more useful for everyone. Code snippets are a narrow area, and
the Tcl Cookbook I think focuses very well onto that one problem.
For all other things we still have the wiki.

One last possible bonus - the Python Cookbook is likely to become
an O'Reilly book. I'd love to see the Tcl Cookbook become as
good as it (or better of course :) ), and be worthy of a new book
as well.

Cameron Laird

unread,
Sep 8, 2001, 1:02:16 PM9/8/01
to
In article <3B9A49BC...@ActiveState.com>,
Jeffrey Hobbs <Je...@ActiveState.com> wrote:
.
.
.
.
.
Thanks, Jeff; this is just the help I
requested--and sufficiently valuable
that I've copied it in full, to recom-
mend others read it.

Cameron Laird

unread,
Sep 8, 2001, 1:09:16 PM9/8/01
to
In article <3B9A49BC...@ActiveState.com>,
Jeffrey Hobbs <Je...@ActiveState.com> wrote:
.
.
.
>This shows the procedure in a colorized manner - very easy
>for new users (and old) to see the strings, vars and key procs.
>There is a quick link to raw text of each recipe - all recipes
>may be shared and copied.
Good thing, that latter; colorization makes
me feel like such a senior citizen. While
I can imagine it's great for others (how
many Chuck Moore fans do we have here, by
the way?), I'm at a point where it just an-
noys me.

>
>In the header area, you get the author's name (that's actually
>whoever submitted the recipe), and a quick link to see all other
>recipes by this author. It provides categorization, rating and
Any chance the label will be changed from
"author" to "submitter"? Someone--or several
people--might well make it a project to mine
the Wiki for content. 'Would make me feel
queasy, though, to label that person(s)
"author".
.
.
.

Jeffrey Hobbs

unread,
Sep 8, 2001, 2:51:50 PM9/8/01
to
Cameron Laird wrote:
> Jeffrey Hobbs <Je...@ActiveState.com> wrote:
...

> >In the header area, you get the author's name (that's actually
> >whoever submitted the recipe), and a quick link to see all other
> >recipes by this author. It provides categorization, rating and
>
> Any chance the label will be changed from
> "author" to "submitter"? Someone--or several
> people--might well make it a project to mine
> the Wiki for content. 'Would make me feel
> queasy, though, to label that person(s) "author".

That's a good point, and it already made me uncertain when I
was submitting some seed recipes. The person really is the
submitter in many cases. I've cc'ed some others at ActiveState
to discuss changing that "title".

Luis Fernandes

unread,
Sep 9, 2001, 9:16:49 AM9/9/01
to
>>>>> "mdelaney" == Mike and Clairone Delaney <mdel...@qis.net> writes:

mdelaney> Maybe I can help put some of the code snippets I've
mdelaney> collected in there, but none of it's original---just
mdelaney> wise advice from the gurus in here, including
mdelaney> you. Unfortunately, I haven't always remembered to
mdelaney> document the source, so giving proper credit would be a
mdelaney> problem.

I suppose the author could be specified as: "Posted on
comp.lang.tcl"; the groups.google.com archive could always be used to
verify the authorship.

Lowclouds

unread,
Sep 9, 2001, 6:24:01 PM9/9/01
to

"Jeffrey Hobbs" <Je...@ActiveState.com> wrote in message
news:3B9A49BC...@ActiveState.com...

> - for me the wiki searching has been mostly broken for a long time.
> Andreas tells me this is an IE problem (I get constant 404s when
> trying to search), but if the search doesn't work for the most
> popular browser in the world... hmph.

ahhhh, that explains it. i've given up almost entirely on the wiki because
of the search problem. i'd like to see the wiki succeed and it's lack of
organization would not be a hindrance - if it could be searched.

craig


Stuart Cassoff

unread,
Sep 9, 2001, 9:53:09 PM9/9/01
to
Lowclouds wrote:
> "Jeffrey Hobbs" <Je...@ActiveState.com> wrote in message
>>- for me the wiki searching has been mostly broken for a long time.
>>Andreas tells me this is an IE problem (I get constant 404s when

> ahhhh, that explains it. i've given up almost entirely on the wiki because


> of the search problem. i'd like to see the wiki succeed and it's lack of
> organization would not be a hindrance - if it could be searched.


I thought the wiki search was fixed.
Turns out it was because I switched to Mozilla!

Also does not work with Lynx or BrowseX.

I am happily using the wiki daily... It is a veritable cornucopia* of Tcl info.

Can this be fixed?


Stu
*I get to use 'veritable cornucopia' so rarely - thanks for the opportunity!

Cameron Laird

unread,
Sep 10, 2001, 8:37:01 AM9/10/01
to
In article <3B9C1D05...@sympatico.ca>,
Stuart Cassoff <st...@sympatico.ca> wrote:
.
.

.
>I thought the wiki search was fixed.
>Turns out it was because I switched to Mozilla!
>
>Also does not work with Lynx or BrowseX.
.
.
.
Wait a minute; I search the Wiki with lynx
(Version 2.8.2rel.1 (01 Jun 1999)) scores
of times daily. Can everybody meet in the
Wiki chat and settle this one?

Donal K. Fellows

unread,
Sep 10, 2001, 9:55:33 AM9/10/01
to
Cameron Laird wrote:
> So: why should the Cookbook appeal to me? How do we differ-
> entiate the values it, and the Wiki, provide?

Also, how does it differ from:
https://sourceforge.net/snippet/browse.php?by=lang&lang=11

It seems to me that there are many different resources attempting to
tackle exactly the same problem...

Donal.
--
Donal K. Fellows http://www.cs.man.ac.uk/~fellowsd/ fell...@cs.man.ac.uk
-- I'm curious; where does this statistic come from? Does its home, perchance,
ever see sunlight? -- Jason A Williams <jason+...@compsoc.man.ac.uk>

lvi...@yahoo.com

unread,
Sep 10, 2001, 10:00:25 AM9/10/01
to

According to Stuart Cassoff <st...@sympatico.ca>:

:Lowclouds wrote:
:> "Jeffrey Hobbs" <Je...@ActiveState.com> wrote in message
:>>- for me the wiki searching has been mostly broken for a long time.
:>>Andreas tells me this is an IE problem (I get constant 404s when

Sigh - yet another web site broken by IE ...


:
:> ahhhh, that explains it. i've given up almost entirely on the wiki because


:> of the search problem. i'd like to see the wiki succeed and it's lack of
:> organization would not be a hindrance - if it could be searched.
:
:
:I thought the wiki search was fixed.
:Turns out it was because I switched to Mozilla!
:
:Also does not work with Lynx or BrowseX.
:
:I am happily using the wiki daily... It is a veritable cornucopia* of Tcl info.
:
:Can this be fixed?


I use Netscape Communicator and Lynx daily to search
<URL: http://purl.org/thecliff/tcl/wiki/> with no problems.

I suggest that people who have specific problems on specific browsers
report the specifics to the wiki .

--
--
"I know of vanishingly few people ... who choose to use ksh." "I'm a minority!"
<URL: mailto:lvi...@cas.org> <URL: http://www.purl.org/NET/lvirden/>
Even if explicitly stated to the contrary, nothing in this posting

lvi...@yahoo.com

unread,
Sep 10, 2001, 10:08:54 AM9/10/01
to

According to Jeff Hobbs <Je...@ActiveState.com>:
:I'd like to invite people to participate in a new online Tcl Cookbook

:that ActiveState has created at:
:
: http://aspn.activestate.com/ASPN/Cookbook/Tcl
:

I assume that this cookbook is different than the
The PLEAC project (http://pleac.sourceforge.net/) which is building
a Tcl, etc. series of cookbooks which are equivalent to the Perl Cookbook
of code equivalents.

Bob Techentin

unread,
Sep 10, 2001, 11:27:21 AM9/10/01
to
Jeff Hobbs wrote:
>
> I'd like to invite people to participate in a new online Tcl Cookbook
> that ActiveState has created at:
>
> http://aspn.activestate.com/ASPN/Cookbook/Tcl
>
> This is a new collaborative website, built by ActiveState, which will
> host your contributions to The Art of Tcl Programming. We invite you
> to contribute code, comments, and ratings for recipes from the entire
> Tcl community. This living collection will allow programmers to be
> more productive with Tcl, and will provide a dynamic space for the
> rapid content development of a cookbook.

Nicely formatted, Jeff.

Any chance of the "collaborative" part getting extended, so that the
community could add to categories or descriptions? How about
hierarchical category definitions? I kind of gave up on the SourceForge
snippet library, because there was just one category for Tcl and soooo
many code snippets. It made more sense to just refer people to the
wiki.

How about adding some sort of database interface to extract code
snippets as formatted data? Or is that ActiveState proprietary?

Thanks,
Bob
--
Bob Techentin techenti...@mayo.edu
Mayo Foundation (507) 538-5495
200 First St. SW FAX (507) 284-9171
Rochester MN, 55901 USA http://www.mayo.edu/sppdg/

Jeff Hobbs

unread,
Sep 10, 2001, 12:18:21 PM9/10/01
to
"Donal K. Fellows" wrote:
>
> Cameron Laird wrote:
> > So: why should the Cookbook appeal to me? How do we differ-
> > entiate the values it, and the Wiki, provide?
>
> Also, how does it differ from:
> https://sourceforge.net/snippet/browse.php?by=lang&lang=11
>
> It seems to me that there are many different resources attempting to
> tackle exactly the same problem...

See my response to Cameron. Most everything applies to the SourceForge
version as well. AFAICT, you can't even add comments to the snippets
that are posted there, which makes it less useful than the wiki (and
in turn, a lot less useful than the new Tcl Cookbook for snippets).

Jeff Hobbs

unread,
Sep 10, 2001, 12:22:45 PM9/10/01
to
lvi...@yahoo.com wrote:
>
> According to Jeff Hobbs <Je...@ActiveState.com>:
> :I'd like to invite people to participate in a new online Tcl Cookbook
> :that ActiveState has created at:
> :
> : http://aspn.activestate.com/ASPN/Cookbook/Tcl
>
> I assume that this cookbook is different than the
> The PLEAC project (http://pleac.sourceforge.net/) which is building
> a Tcl, etc. series of cookbooks which are equivalent to the Perl Cookbook
> of code equivalents.

I think pleac is an interesting project, translating the exact
Perl Cookbook (from O'Reilly) into other languages. However,
they are doing an exact translation. We've had the discussion
a few times already on c.l.t that sometimes the "translations"
made for Tcl don't really produce code that is ... Tcl-ish.
The ActiveState cookbook is free-form, and for Tcl to be done
in the best Tcl style. There are likely many recipes that could
be shared (between the wiki and the cookbook as well), but we
want ones that also demonstrate the abilities and advantages of
Tcl clearly, while helping new users to learn the nuances and
special benefits of Tcl.

Jeff Hobbs

unread,
Sep 10, 2001, 1:19:10 PM9/10/01
to
Bob Techentin wrote:
> Jeff Hobbs wrote:
> >
> > I'd like to invite people to participate in a new online Tcl Cookbook
> > that ActiveState has created at:
> >
> > http://aspn.activestate.com/ASPN/Cookbook/Tcl

> Nicely formatted, Jeff.


>
> Any chance of the "collaborative" part getting extended, so that the
> community could add to categories or descriptions? How about
> hierarchical category definitions? I kind of gave up on the SourceForge

Well, you can at least recommend them, and I can talk to the web
guys here responsible for the system. We just picked the original
categories out of thin air. We're working on allowing external
editors. We have nothing against it philosophically - but our
firewall does :).

> How about adding some sort of database interface to extract code
> snippets as formatted data? Or is that ActiveState proprietary?

You can always use http::geturl on them. :) As I understand it,
all snippets are pure Open Source. The proprietary part for
ActiveState is only the format in which it is presented with
categorization. We want everyone to be able to use the code in
any project. We don't want them mirroring the entire look and
renaming it.

Richard Bornost

unread,
Sep 10, 2001, 1:36:17 PM9/10/01
to
I use IE 5.5 and have no problems what so ever using the search features of
wiki

Richard Bornost


"Lowclouds" <str...@lowclouds.net> wrote in message
news:3b9beccc$0$41808$e2e...@nntp.cts.com...

Peter Lewerin

unread,
Sep 10, 2001, 4:27:47 PM9/10/01
to
Jeff Hobbs wrote:
> lvi...@yahoo.com wrote:

>>I assume that this cookbook is different than the
>>The PLEAC project (http://pleac.sourceforge.net/) which is building
>

> I think pleac is an interesting project, translating the exact
> Perl Cookbook (from O'Reilly) into other languages. However,
> they are doing an exact translation.

That is one of the constraints, yes. In my view, a bigger problem is
that the Perl Cookbook "scratches Perl itches" and presents solutions
that emphasize Perl's strengths (or pseudo-strengths; what is the
practical use of a module for conversion of Roman numerals?). Not only
the style of Tcl is hidden by this translation, but also some of the
real strengths. Quite different from the OTC, yes.

Still, I think PLEAC is an interesting project. As someone noted in a
Ruby discussion, the trial for scripting languages today is to beat Perl
at what Perl is thought to do best. In some cases, I think PLEAC
demonstrates that Perl no longer is the best way to solve a particular
problem even if it is set up to fit Perl (IMHO, YMMV, TMTOWTDI, the Perl
solutions in the Cookbook are no longer state of the art, etc, etc).

Also: as the author of the Tcl PLEAC, I'd appreciate very much if people
would check out the code and point out warts, possibly even suggest
better solutions. Thanks to tcltest, there should be very few bugs in
it, though.

Peter Lewerin

unread,
Sep 10, 2001, 4:33:38 PM9/10/01
to
Richard Bornost wrote:
> I use IE 5.5 and have no problems what so ever using the search features of
> wiki

Strange. Using IE 5.5, I can't even access <URL:
http://mini.net/tcl/2.html>, but I can use <URL:
http://mini.net/cgi-bin/wikit/2.html> with no problems.

Mozilla 0.9.3 handles both pages allright.

Richard Bornost

unread,
Sep 10, 2001, 8:43:01 PM9/10/01
to
The same occurs on my system <URL: http://mini.net/cgi-bin/wikit/2.html>
works and <URL: http://mini.net/tcl/2.html> does not

Richard

"Peter Lewerin" <peter....@swipnet.se> wrote in message
news:3B9D23A2...@swipnet.se...

Donal K. Fellows

unread,
Sep 11, 2001, 6:31:33 AM9/11/01
to
Richard Bornost wrote:
> The same occurs on my system <URL: http://mini.net/cgi-bin/wikit/2.html>
> works and <URL: http://mini.net/tcl/2.html> does not

Are you sure it is not some bizarro webcache problem, triggered by
the search page being called something.html?

Donal.
--
"While this is anecdotal, and thus bound to be ignored by all the pedanticism-
fascists out there, I have owned a fully-loaded copy of Emacs and many other
gnutilities for many years, and have never had a fatality yet."
-- Alistair J. R. Young <avatar...@arkane.demon.co.uk>

lvi...@yahoo.com

unread,
Sep 11, 2001, 8:23:38 AM9/11/01
to

According to Peter Lewerin <peter....@swipnet.se>:

:Jeff Hobbs wrote:
:> lvi...@yahoo.com wrote:
:
:>>I assume that this cookbook is different than the
:>>The PLEAC project (http://pleac.sourceforge.net/) which is building
:>
:> I think pleac is an interesting project, translating the exact
:> Perl Cookbook (from O'Reilly) into other languages. However,
:> they are doing an exact translation.

Actually, the FAQ at http://pleac.sourceforge.net/pleac-faq.html says
that the coding style should be similar across the languages. It
says nothing about 'exact translation'. They want things solved in
a similar level of complexity so that one doesn't have obscure,
rarely used techniques in one language and overly simple methods in another.
The FAQ covers this pretty well I think.

:that emphasize Perl's strengths (or pseudo-strengths; what is the

:practical use of a module for conversion of Roman numerals?).

Well, for applications doing outlining for one.

:Also: as the author of the Tcl PLEAC, I'd appreciate very much if people

:would check out the code and point out warts, possibly even suggest
:better solutions. Thanks to tcltest, there should be very few bugs in
:it, though.

Jeff Hobbs

unread,
Sep 11, 2001, 1:39:49 PM9/11/01
to
lvi...@yahoo.com wrote:
> :Jeff Hobbs wrote:
...

> :> I think pleac is an interesting project, translating the exact
> :> Perl Cookbook (from O'Reilly) into other languages. However,
> :> they are doing an exact translation.
>
> Actually, the FAQ at http://pleac.sourceforge.net/pleac-faq.html says
> that the coding style should be similar across the languages. It
> says nothing about 'exact translation'. They want things solved in
> a similar level of complexity so that one doesn't have obscure,
> rarely used techniques in one language and overly simple methods in another.

The FAQ doesn't seem to say the above to me, but your translation of
it actually shows the weakness again. Some tasks do have very simple
solutions in one language, and contorted solutions in another (think
asynchronous sockets for Tcl - oh so easy). That's also why PLEAC is
a decent language comparator, but not ideal for the other scripting
languages. What he mentions about PLEAC#2 is more what we are already
trying to create with the Tcl Cookbook (and similarly ActiveState has
a Python Cookbook). ActiveState isn't bothering with a Perl Cookbook
for a reason...

Sebastian Wangnick

unread,
Sep 12, 2001, 2:19:16 AM9/12/01
to
Seems to be not only an IE problem:

odsdec2> wish
% package require tcllib
1.0
% package require http
2.3
% http::config -proxyhost proxy.mas.eurocontrol.be
% set b64 [base64::encode wangnick:xxxxxx]
d2FuZ25pY2s6eHh4eHh4
% set headers [list Proxy-Authorization [list Basic $b64]]
Proxy-Authorization {Basic d2FuZ25pY2s6eHh4eHh4}
% http::geturl http://mini.net/tcl/2.html -headers $headers
::http::
% array get ::http::1
sock sock5 http {HTTP/1.1 404 Not Found} querylength 0 -queryblocksize 8192
state eof type text/html url http://mini.net/tcl/2.html -timeout 0
queryoffset 0 -validate 0 totalsize 0 -queryprogress {} -headers
{Proxy-Authorization {Basic d2FuZ25pY2s6eHh4eHh4}} -blocksize 8192 status ok
body {<title>Search</title>
<body bgcolor="#ffffff" >
<h2><a href="./2!">Search</a></h2>

<isindex>
<p></p>
<hr noshade>
<font size=-1><a href="./4.html">Changes</a> - <a href="./2*">Expand</a> - 2
<a href="./2!">References</a> - About <a href="./1.html">WiKit</a> - Go to
<a href="./0.html">The Tcl'ers Wiki</a></font>
</body>
} currentsize 322 -type application/x-www-form-urlencoded meta {Date {Wed,
12 Sep 2001 06:13:50 GMT} Server {Apache/1.3.19 (Unix) (Red-Hat/Linux)
mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.0.4pl1 mod_perl/1.21 FrontPage/4.0.4.3}
Pragma no-cache Connection close Content-type text/html}

Regards,
Sebastian

Donal K. Fellows <fell...@cs.man.ac.uk> wrote in message
news:3B9DE805...@cs.man.ac.uk...

Peter Lewerin

unread,
Sep 12, 2001, 3:11:57 AM9/12/01
to

...I started writing this reply yesterday, but then I caught the news.
Suddenly it didn't seem all that important to write or post about
programming. Such a bad, awful, horrible day. My heart goes out to the
victims and the families.

---

> Actually, the FAQ at http://pleac.sourceforge.net/pleac-faq.html says
> that the coding style should be similar across the languages. It
> says nothing about 'exact translation'.

Note that 'exact' was Jeff Hobbs' wording, not mine. I'd say that what
I put in the Tcl version has to follow the Perl version enough to make
it possible for other people to see the connection and be able to
compare the solutions.

What I think is most important is that however one interprets the coding
style directives, the translation is to some extent constrained by the
Perl version.

That said, I *do* try to use elegant and Tcl-ish solutions when
possible. Also, in some cases the only reasonable Tcl translation
diverges strongly from the Perl solution. It's obviously not a good
idea to try to duplicate this:

use POSIX qw(strftime);
use Time::Local;
$time = timelocal(50, 45, 3, 18, 0, 73);
print "strftime gives: ", strftime("%A %D", localtime($time)), "\n";

when one can (indeed, must) write

puts [clock format [clock scan 01/18/73] -format "%A %D"]

in Tcl. (An extreme example.)

I also try to peek at the Ruby and Python solutions to see how freely
those translations are made.

> :that emphasize Perl's strengths (or pseudo-strengths; what is the
> :practical use of a module for conversion of Roman numerals?).
>
> Well, for applications doing outlining for one.

True. Better put up that note: "Just because you can't see a use for X,
it does not follow that no one else can, either."

Donal K. Fellows

unread,
Sep 12, 2001, 5:46:01 AM9/12/01
to
Sebastian Wangnick wrote:
> Seems to be not only an IE problem:
[...]

> % array get ::http::1
> sock sock5 http {HTTP/1.1 404 Not Found} querylength 0 -queryblocksize 8192
> state eof type text/html url http://mini.net/tcl/2.html -timeout 0
> queryoffset 0 -validate 0 totalsize 0 -queryprogress {} -headers
> {Proxy-Authorization {Basic d2FuZ25pY2s6eHh4eHh4}} -blocksize 8192 status ok
> body {<title>Search</title>
> <body bgcolor="#ffffff" >
> <h2><a href="./2!">Search</a></h2>
>
> <isindex>
> <p></p>
> <hr noshade>
> <font size=-1><a href="./4.html">Changes</a> - <a href="./2*">Expand</a> - 2
> <a href="./2!">References</a> - About <a href="./1.html">WiKit</a> - Go to
> <a href="./0.html">The Tcl'ers Wiki</a></font>
> </body>
> } currentsize 322 -type application/x-www-form-urlencoded meta {Date {Wed,
> 12 Sep 2001 06:13:50 GMT} Server {Apache/1.3.19 (Unix) (Red-Hat/Linux)
> mod_ssl/2.8.1 OpenSSL/0.9.6 PHP/4.0.4pl1 mod_perl/1.21 FrontPage/4.0.4.3}
> Pragma no-cache Connection close Content-type text/html}

That content looks fine to me; now all you need to do is render it.

(Now, why on earth is the Wiki setting the result code to 404, and why is
the problem browser not rendering the returned page? Solve at least one
of those, and you'll be able to fix the problem as a whole.)

-- This may scare your cat into premature baldness, but Sun are not the only
sellers of Unix. -- Anthony Ord <n...@rollingthunder.clara.co.uk>

lvi...@yahoo.com

unread,
Sep 12, 2001, 7:56:46 AM9/12/01
to

According to Cameron Laird <cla...@starbase.neosoft.com>:
:of times daily. Can everybody meet in the

:Wiki chat and settle this one?

Cameron and I both find we are able to search with both
lynx and netscape communicator daily without much problem.

lvi...@yahoo.com

unread,
Sep 12, 2001, 8:12:49 AM9/12/01
to

According to Peter Lewerin <peter....@swipnet.se>:
: I'd say that what
:I put in the Tcl version has to follow the Perl version enough to make
:it possible for other people to see the connection and be able to
:compare the solutions.

Thank you very much Peter for your work on the effort. It is appreciated.

:What I think is most important is that however one interprets the coding

:style directives, the translation is to some extent constrained by the
:Perl version.

Perhaps what COULD be done is that if there are more elegant solutions
which don't fit into the constraints of the project, one could provide
a pointer to <URL: http://purl.org/thecliff/tcl/wiki/> pages to
provide such solutions.

:True. Better put up that note: "Just because you can't see a use for X,

:it does not follow that no one else can, either."

Well said.

Peter Lewerin

unread,
Sep 12, 2001, 8:29:52 AM9/12/01
to

> Perhaps what COULD be done is that if there are more elegant solutions
> which don't fit into the constraints of the project, one could provide
> a pointer to <URL: http://purl.org/thecliff/tcl/wiki/> pages to
> provide such solutions.

I try to do that; e.g. in the case of the Roman numerals I put in a link
to Richard Suchenwirth's RN conversions on the Wiki. In many cases I've
also googled for Tcl solutions. It's still possible that I've
overlooked good stuff, of course.

I'm happy to see that the number of recipes in the 'real' Tcl Cookbook
is growing, too. I will make sure to look for code to point to there in
the future.

Cameron Laird

unread,
Sep 12, 2001, 9:34:29 AM9/12/01
to
In article <9nnihu$m9f$2...@srv38.cas.org>, <lvi...@yahoo.com> wrote:
>
>According to Cameron Laird <cla...@starbase.neosoft.com>:
>:of times daily. Can everybody meet in the
>:Wiki chat and settle this one?
>
>Cameron and I both find we are able to search with both
>lynx and netscape communicator daily without much problem.
.
.
.
Also the latest Opera, and every version of IE I've tried.

Jeffrey Hobbs

unread,
Sep 12, 2001, 12:22:19 PM9/12/01
to
Sebastian Wangnick wrote:
...

> % http::geturl http://mini.net/tcl/2.html -headers $headers
> ::http::
> % array get ::http::1
> sock sock5 http {HTTP/1.1 404 Not Found} querylength 0 -queryblocksize 8192
...

> body {<title>Search</title>
> <body bgcolor="#ffffff" >
> <h2><a href="./2!">Search</a></h2>

Woah, that is the problem. What the heck is the wiki doing returning
a 404 code and then data? That's the bug. I guess IE decides that
404 means 404, and it of course has it's own page for that. This
does seem like something that should be fixed in the wiki.

lvi...@yahoo.com

unread,
Sep 14, 2001, 9:57:30 AM9/14/01
to

According to Peter Lewerin <peter....@swipnet.se>:
: I will make sure to look for code to point to there in
:the future.
:

Keep up the great work!

lvi...@yahoo.com

unread,
Sep 14, 2001, 9:56:50 AM9/14/01
to

According to Donal K. Fellows <fell...@cs.man.ac.uk>:
:(Now, why on earth is the Wiki setting the result code to 404, and why is

:the problem browser not rendering the returned page? Solve at least one
:of those, and you'll be able to fix the problem as a whole.)

The wiki is set up with a caching system. If a page has not been fetched
and formatted from its internal database, a 404 is generated, the site
fetches and formats the data, and then the browser is redirected to the
newly generated page.

Code not following the redirections will get 404's for pages updated
since they were last browsed.

Peter Lewerin

unread,
Sep 14, 2001, 6:34:56 PM9/14/01
to
lvi...@yahoo.com wrote:

> Keep up the great work!

I'll do my best!

It means *a lot* to get so much encouragement from you and other Tcl
'Heavy People' here and in private email. A couple of weeks ago Jeff
Hobbs even took the time to view my code and offer enlightenment on (I
realized later) the same day he was putting out a new release of ActiveTcl!

After trying for some months to even get someone to reply to me in
different Perl groups and bulletin boards, the response I (and others)
get here and on the Wiki is most refreshing and encouraging.

Again, I'll do my best to provide a fair introduction to Tcl on the
PLEAC. If anyone cares to look at it, please let me know if I stray
from the true path and offer less than reasonable translations of solutions.

0 new messages