]> gitweb.factorcode.org Git - factor.git/blob - basis/calendar/model/model.factor
60a61c20267b386357bf161409d7fdaa589ddab1
[factor.git] / basis / calendar / model / model.factor
1 ! Copyright (C) 2008 Slava Pestov\r
2 ! See http://factorcode.org/license.txt for BSD license.\r
3 USING: calendar namespaces models threads kernel init ;\r
4 IN: calendar.model\r
5 \r
6 SYMBOL: time\r
7 \r
8 : (time-thread) ( -- )\r
9     now time get set-model\r
10     1000 sleep (time-thread) ;\r
11 \r
12 : time-thread ( -- )\r
13     [\r
14         init-namespaces\r
15         (time-thread)\r
16     ] "Time model update" spawn drop ;\r
17 \r
18 f <model> time set-global\r
19 [ time-thread ] "calendar.model" add-init-hook\r