From 00c794c9a644e351a8dcd9764c79de83a84aaac6 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Thu, 22 Dec 2022 13:34:02 -0600 Subject: [PATCH] compat: Add a 'usleep' shim for Mes. * gash/compat.scm [mes] (usleep): New procedure. --- gash/compat.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gash/compat.scm b/gash/compat.scm index d86518a..eb6da7e 100644 --- a/gash/compat.scm +++ b/gash/compat.scm @@ -108,6 +108,7 @@ thunk? EXIT_SUCCESS EXIT_FAILURE + usleep exact? exact-integer? set-program-arguments @@ -253,6 +254,13 @@ (define EXIT_SUCCESS 0) (define EXIT_FAILURE 1) + ;; Mes doesn't have sleep, so we just spin the tires a bit. + (define (usleep n) + (let loop ((n n)) + (if (<= n 0) + #t + (loop (- n 1))))) + ;; Mes only has exact integers. (define exact? integer?) (define exact-integer? integer?)