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

after 2147483648

12 views
Skip to first unread message

Kaitzschu

unread,
Nov 6, 2005, 5:42:36 AM11/6/05
to
I was having slight problems with intervals of 25 days. As I don't use the
bleeding edge due lack of compiling power, I pulled it from CVS and gave
it a try on a bit faster machine.

: tclsh8.5
% info patchlevel
8.5a4
% after -1; puts "That was past."
bad argument "-1": must be cancel, idle, info, or a number
% after 0; puts "This is now."
This is now.
% after 4294967296; puts "This just won't happen."
integer value too large to represent
% after 2147483647; puts "This takes long."
^C
: tclsh8.5
% after 2147483648; puts "That was fast!"
That was fast!
% exit

Why after doesn't error out with milliseconds from 2<<30 to 2<<31-1? This
immediate return does not fit my plans at all. Is this a bug, or am I just
missing some documentation?

--
-Kaitzschu
s="TCL ";while true;do echo -en "\r$s";s=${s:1:${#s}}${s:0:1};sleep .1;done

Robert Hicks

unread,
Nov 6, 2005, 7:42:33 AM11/6/05
to

Kaitzschu wrote:
> I was having slight problems with intervals of 25 days. As I don't use the
> bleeding edge due lack of compiling power, I pulled it from CVS and gave
> it a try on a bit faster machine.
>
> : tclsh8.5
> % info patchlevel
> 8.5a4
> % after -1; puts "That was past."
> bad argument "-1": must be cancel, idle, info, or a number
> % after 0; puts "This is now."
> This is now.
> % after 4294967296; puts "This just won't happen."
> integer value too large to represent
> % after 2147483647; puts "This takes long."
> ^C
> : tclsh8.5
> % after 2147483648; puts "That was fast!"
> That was fast!
> % exit
>
> Why after doesn't error out with milliseconds from 2<<30 to 2<<31-1? This
> immediate return does not fit my plans at all. Is this a bug, or am I just
> missing some documentation?
>
Something must have changed as I tried the same thing with 8.4.11 and
it work. By works I mean on the "after -1", it returns the puts
statement.

Robert

Mark Hobley

unread,
Nov 6, 2005, 8:08:03 AM11/6/05
to
Kaitzschu <kait...@kaitzschu.cjb.net.nospam.plz.invalid> wrote:
> % after 4294967296; puts "This just won't happen."
> integer value too large to represent

You could created a loop for the number of whole days, then create a loop
containing an after statement for each whole day.

eg:

for {set l 1} {$l <= 25} {incr l} {
after 86400000 ;# one whole day
}
puts "25 days have passed"

This is very crude. For 25 days, you would be better running from a scheduler,
such as cron.

> Why after doesn't error out with milliseconds from 2<<30 to 2<<31-1?

I guess this is because you have 32 bit registers on your system.

Regards,

Mark.

--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE

Telephone: (0121) 247 1596
International: 0044 121 247 1596

Email: markhobley at hotpop dot donottypethisbit com

http://markhobley.yi.org/

Kaitzschu

unread,
Nov 6, 2005, 8:52:42 AM11/6/05
to
On Sun, 6 Nov 2005, Mark Hobley wrote:

> Kaitzschu <kait...@kaitzschu.cjb.net.nospam.plz.invalid> wrote:
>> % after 4294967296; puts "This just won't happen."
>> integer value too large to represent
>
> You could created a loop for the number of whole days, then create a
> loop containing an after statement for each whole day.

Yes, looks a lot like I need a repeater. At least it won't fire every now
and then, 20 days interval should be enough.

> This is very crude. For 25 days, you would be better running from a
> scheduler, such as cron.

Cron is not an option, this application is running for all those 25 days
(and even more, I recorded 40 days, but then power outage hit me, and
after that 8.5 alphas have been very unstable, crash every fortnight or
less :)

The need for these longish delays, however, arose recently.

>> Why after doesn't error out with milliseconds from 2<<30 to 2<<31-1?
>
> I guess this is because you have 32 bit registers on your system.

Don't most people do? .) After reading source there appears to be if
clause for negative numbers to return 0. Apparently these numbers go to
[after] as overflows, get treated as negative ones, and return right away.
This has some issues.

Well, it's wrapper-time!

Kaitzschu

unread,
Nov 6, 2005, 12:51:43 PM11/6/05
to
On Sun, 6 Nov 2005, Robert Hicks wrote:

> Kaitzschu wrote:
>>
>> : tclsh8.5
>> % info patchlevel
>> 8.5a4
>> % after -1; puts "That was past."
>> bad argument "-1": must be cancel, idle, info, or a number
>>

> Something must have changed as I tried the same thing with 8.4.11 and it
> work. By works I mean on the "after -1", it returns the puts statement.

Most likely this,
if (isdigit(UCHAR(argString[0]))) { /* INTL: digit */
since
after [expr {0-1}]; puts "Happened!"
works. Routine checks for intrep first, but "-1" doesn't seem to have it
just yet then, or at least it isn't integer.

Kevin Kenny

unread,
Nov 6, 2005, 11:03:23 PM11/6/05
to
Kaitzschu wrote:
> Why after doesn't error out with milliseconds from 2<<30 to 2<<31-1?
> This immediate return does not fit my plans at all. Is this a bug, or am
> I just missing some documentation?

Let me present you witha stock answer: Log a bug at SF, and I'll look
into this.
--
73 de ke9tv/2, Kevin

Andreas Leitgeb

unread,
Nov 7, 2005, 6:11:47 AM11/7/05
to
Kaitzschu <kait...@kaitzschu.cjb.net.nospam.plz.invalid> wrote:
>>> % info patchlevel
>>> 8.5a4
>>> % after -1; puts "That was past."
>>> bad argument "-1": must be cancel, idle, info, or a number
> Most likely this,
> if (isdigit(UCHAR(argString[0]))) { /* INTL: digit */
> since
> after [expr {0-1}]; puts "Happened!"
> works. Routine checks for intrep first, but "-1" doesn't seem to have it
> just yet then, or at least it isn't integer.

This is definitely a bug.
Tcl should never show a different result on whether an arg
is a specific object (e.g. integer) or its string-rep.

Unless you've done so, already, report it on sf-bugtracker!

Kaitzschu

unread,
Nov 7, 2005, 8:57:47 AM11/7/05
to

[ 1350291 ] [after] overflowing milliseconds
[ 1350293 ] [after] failing to recognize negative number

Sourceforge should craft their bug tracker to work with ELinks, or Debian
should never had switched X11 to X.org, since that truly broke Type5 on my
Sparcstation.

Writing to c.l.t. is just so much easier. Where is ReportTclBug2SF.kit?!
And preferably one usable from console :)

0 new messages