fixed bug in SmallInt math primitives
[k8lst.git] / samples / alarm00.st
blob74fbf86b0c2f4fd9cd191d2d4cc0be54767fdc91
1 class: Test [
2   | count |
4   nextAlarm: secs [
5     'wait ' print. secs print. ' seconds.' printNl.
6     <#NextAlarm secs>.
7     self primitiveFailed
8   ]
10   alarm [
11     [ count > 0 ] whileTrue: [
12       'ALARM' printNl.
13       self nextAlarm: (count * 2).
14       System eventWaitFor: 1.
15       count := count - 1.
16     ].
17     'ALARM complete' printNl.
18     System userBreakSignal.
19   ]
21   run [
22     count := 2.
23     self alarm.
24   ]
28 { [ :shed |
29     System isWindows "true" ifTrue: [
30       'windoze eats shit!' printNl.
31     ] ifFalse: [
32       System newProcessGroupWith: (Process newWithMethod: #run class: Test new).
33       ^REPL new REPL.
34     ].
35   ] value