From ce1a7a131f7c4df8eae5c019eba2893b56f04d46 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 24 Jun 2021 03:42:57 -0400 Subject: Added a macro for type-casting JVM objects. --- stdlib/source/program/aedifex/command/auto.lux | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'stdlib/source/program/aedifex/command/auto.lux') diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux index afce4d6ff..000384ccd 100644 --- a/stdlib/source/program/aedifex/command/auto.lux +++ b/stdlib/source/program/aedifex/command/auto.lux @@ -42,13 +42,17 @@ (#try.Failure error) (wrap (list))))) -(def: (pause _) - (-> Any (Promise (Try Any))) - (promise.delay 1,000 (#try.Success []))) +(def: #export delay + Nat + 1,000) -(def: #export (do! watcher command) +(def: (pause delay) + (-> Nat (Promise (Try Any))) + (promise.delay delay (#try.Success []))) + +(def: #export (do! delay watcher command) (All [a] - (-> (Watcher Promise) + (-> Nat (Watcher Promise) (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command a)) (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command Any)))) (function (_ console program fs shell resolution) @@ -65,7 +69,7 @@ _ ] (loop [_ []] (do ! - [_ (..pause []) + [_ (..pause delay) events (\ watcher poll []) _ (case events (#.Cons _) -- cgit v1.2.3