From 7db42ab1b9d3c764772ca63c74bf44bb2b8b8325 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 9 Jul 2022 14:35:38 -0400 Subject: First-class programs instead of having a "lux program" extension. --- stdlib/source/program/aedifex/repository/local.lux | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'stdlib/source/program/aedifex/repository/local.lux') diff --git a/stdlib/source/program/aedifex/repository/local.lux b/stdlib/source/program/aedifex/repository/local.lux index 39a5c8396..af9b502aa 100644 --- a/stdlib/source/program/aedifex/repository/local.lux +++ b/stdlib/source/program/aedifex/repository/local.lux @@ -11,7 +11,7 @@ ["[0]" text (.only) ["%" \\format (.only format)]]] [world - [program (.only Program)] + [environment (.only Environment)] ["[0]" file] [net ["[0]" uri (.only URI)]]]]] @@ -20,37 +20,37 @@ ["[1][0]" local] ["[1][0]" metadata]]]) -(def .public (root program fs) - (-> (Program Async) (file.System Async) file.Path) +(def .public (root environment fs) + (-> (Environment Async) (file.System Async) file.Path) (let [/ (at fs separator)] (|> ///local.repository (text.replaced uri.separator /) - (format (at program home) /)))) + (format (at environment home) /)))) (def (path /) (-> Text (-> URI file.Path)) (text.replaced uri.separator /)) -(def (absolute_path program fs) - (-> (Program Async) (file.System Async) (-> URI file.Path)) +(def (absolute_path environment fs) + (-> (Environment Async) (file.System Async) (-> URI file.Path)) (let [/ (at fs separator)] (|>> ///metadata.local_uri (..path /) - (format (..root program fs) /)))) + (format (..root environment fs) /)))) -(def .public (repository program fs) - (-> (Program Async) (file.System Async) (//.Repository Async)) +(def .public (repository environment fs) + (-> (Environment Async) (file.System Async) (//.Repository Async)) (implementation (def description - (..root program fs)) + (..root environment fs)) (def download - (|>> (..absolute_path program fs) + (|>> (..absolute_path environment fs) (at fs read))) (def (upload uri content) (do [! async.monad] - [.let [absolute_path (..absolute_path program fs uri)] + [.let [absolute_path (..absolute_path environment fs uri)] ? (at fs file? absolute_path) _ (is (Async (Try Any)) (if ? -- cgit v1.2.3