tcl: Phase 3 OCaml primitives — file-read/write/append/exists?/glob + clock-seconds/milliseconds/format in sx_primitives.ml + unix dep; tcl-cmd-clock/file wired up; 337/337 green
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 50s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 50s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2865,10 +2865,12 @@
|
||||
(let
|
||||
((sub (first args)) (rest-args (rest args)))
|
||||
(cond
|
||||
((equal? sub "seconds") (assoc interp :result "0"))
|
||||
((equal? sub "milliseconds") (assoc interp :result "0"))
|
||||
((equal? sub "seconds") (assoc interp :result (str (clock-seconds))))
|
||||
((equal? sub "milliseconds") (assoc interp :result (str (clock-milliseconds))))
|
||||
((equal? sub "format")
|
||||
(assoc interp :result "Thu Jan 1 00:00:00 UTC 1970"))
|
||||
(assoc interp :result (clock-format
|
||||
(floor (parse-int (first rest-args)))
|
||||
(if (> (len rest-args) 1) (nth rest-args (- (len rest-args) 1)) "%a %b %e %H:%M:%S %Z %Y"))))
|
||||
((equal? sub "scan") (assoc interp :result "0"))
|
||||
(else (error (str "clock: unknown subcommand \"" sub "\""))))))))
|
||||
|
||||
@@ -3151,7 +3153,7 @@
|
||||
(let
|
||||
((sub (first args)) (rest-args (rest args)))
|
||||
(cond
|
||||
((equal? sub "exists") (assoc interp :result "0"))
|
||||
((equal? sub "exists") (assoc interp :result (if (file-exists? (first rest-args)) "1" "0")))
|
||||
((equal? sub "join") (assoc interp :result (join "/" rest-args)))
|
||||
((equal? sub "split")
|
||||
(assoc
|
||||
|
||||
@@ -95,15 +95,15 @@
|
||||
(get (run "proc g {} { yield }\ncoroutine cg g\ncg") :result)
|
||||
"")
|
||||
|
||||
; --- clock seconds stub ---
|
||||
; --- clock seconds ---
|
||||
(ok "clock-seconds"
|
||||
(get (run "clock seconds") :result)
|
||||
"0")
|
||||
(> (parse-int (get (run "clock seconds") :result)) 0)
|
||||
true)
|
||||
|
||||
; --- clock milliseconds stub ---
|
||||
; --- clock milliseconds ---
|
||||
(ok "clock-milliseconds"
|
||||
(get (run "clock milliseconds") :result)
|
||||
"0")
|
||||
(> (parse-int (get (run "clock milliseconds") :result)) 0)
|
||||
true)
|
||||
|
||||
; --- clock format stub ---
|
||||
(ok "clock-format"
|
||||
|
||||
Reference in New Issue
Block a user