Re: (newbie) storing outputs from all lines of procs into a string
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: (newbie) storing outputs from all lines of procs into a string

From: Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date: Tue Dec 20 2005 - 09:29:27 CET

Bryan Oakley <oakley@bardo.clearlight.com> wrote:
> Andreas Leitgeb wrote:
>> For short: it's about having a special puts for just a
>> limited part of the code, which is not under his control.

> I'd probably still go with a single redefinition, with a traffic cop:
> ...
> Thinking out loud for a moment... another way to accomplish it is to use
> interpreter aliases. Make 'puts' an alias either to the core puts or a
> special one, and toggle between them as needed:
> ...
> I think that may make the code more self-evident, but it's arguable
> which is truly better.

It depends on whether the juggling happens more often or
other (non-logging) uses of puts happen more often.

But probably you're right :-)
"puts" isn't the fastest command (with all it's i/o) anyway,
so a proc around it shoud be hardly noticeable.

It's up to the original poster whether to pick up any of
your better versions, or stick with the previous version.
All three should just work.

If there are hardly any "other uses" of puts in his application,
then he can just as well replace puts once and for all and
tolerate some more loggings than intended :-)
Received on Fri Dec 23 19:02:23 2005