aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux29
1 files changed, 11 insertions, 18 deletions
diff --git a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux
index a7bd45ff8..8167537f5 100644
--- a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux
@@ -355,32 +355,25 @@
(def: runtime//box
Runtime
- ($_ python.then!
- @@box//write))
-
-(runtime: (process//future procedure)
- ($_ python.then!
- (python.import! "threading")
- (let [params (python.dict (list [(python.string "target") procedure]))]
- (python.do! (|> (python.global "threading")
- (python.send-keyword (list) params "Thread")
- (python.send (list) "start"))))
- (python.return! ..unit)))
+ @@box//write)
(runtime: (process//schedule milli-seconds procedure)
($_ python.then!
(python.import! "threading")
- (let [seconds (|> milli-seconds (python./ (python.float 1_000.0)))]
- (python.do! (|> (python.global "threading")
- (python.send (list seconds procedure) "Timer")
- (python.send (list) "start"))))
+ (python.if! (python.= (python.int 0) milli-seconds)
+ (let [params (python.dict (list [(python.string "target") procedure]))]
+ (python.do! (|> (python.global "threading")
+ (python.send-keyword (list) params "Thread")
+ (python.send (list) "start"))))
+ (let [seconds (|> milli-seconds (python./ (python.float 1_000.0)))]
+ (python.do! (|> (python.global "threading")
+ (python.send (list seconds procedure) "Timer")
+ (python.send (list) "start")))))
(python.return! ..unit)))
(def: runtime//process
Runtime
- ($_ python.then!
- @@process//future
- @@process//schedule))
+ @@process//schedule)
(do-template [<name> <method>]
[(runtime: (<name> input)