aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/world/file.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-07-28 04:48:42 -0400
committerEduardo Julian2021-07-28 04:48:42 -0400
commit5d4583aebd00adced10275b32ff1a93ab418be50 (patch)
tree89315e104e2b0ddd6d56f894f01a0575d3078699 /stdlib/source/library/lux/world/file.lux
parent061fd8a209bbcaffc2bfb850ac6046752a567d50 (diff)
Re-named List's tags: Nil => End && Cons => Item
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/world/file.lux66
1 files changed, 33 insertions, 33 deletions
diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux
index f66458f87..962636aa9 100644
--- a/stdlib/source/library/lux/world/file.lux
+++ b/stdlib/source/library/lux/world/file.lux
@@ -726,14 +726,14 @@
output (: (List ..Path)
(list))]
(case input
- #.Nil
+ #.End
(in output)
- (#.Cons head tail)
+ (#.Item head tail)
(do !
[verdict (<test> head)]
(recur tail (if verdict
- (#.Cons head output)
+ (#.Item head output)
output)))))
_ (RubyDir::close [] self)]
(in output)))]
@@ -921,14 +921,14 @@
## output (: (List (<capability> IO))
## (list))]
## (case input
- ## #.Nil
+ ## #.End
## (in output)
- ## (#.Cons head tail)
+ ## (#.Item head tail)
## (do !
## [verdict (<test> head)]
## (if verdict
- ## (recur tail (#.Cons (<constructor> head) output))
+ ## (recur tail (#.Item (<constructor> head) output))
## (recur tail output)))))))]
## [files ..is_file ..file File]
@@ -1007,23 +1007,23 @@
(loop [directory mock
trail (text.split_all_with separator path)]
(case trail
- (#.Cons head tail)
+ (#.Item head tail)
(case (dictionary.get head directory)
#.None
(exception.except ..cannot_find_file [path])
(#.Some node)
(case [node tail]
- [(#.Left file) #.Nil]
+ [(#.Left file) #.End]
(#try.Success [head file])
- [(#.Right sub_directory) (#.Cons _)]
+ [(#.Right sub_directory) (#.Item _)]
(recur sub_directory tail)
_
(exception.except ..cannot_find_file [path])))
- #.Nil
+ #.End
(exception.except ..cannot_find_file [path]))))
(def: (update_mock_file! / path now content mock)
@@ -1031,30 +1031,30 @@
(loop [directory mock
trail (text.split_all_with / path)]
(case trail
- (#.Cons head tail)
+ (#.Item head tail)
(case (dictionary.get head directory)
#.None
(case tail
- #.Nil
+ #.End
(#try.Success (dictionary.put head
(#.Left {#mock_last_modified now
#mock_can_execute false
#mock_content content})
directory))
- (#.Cons _)
+ (#.Item _)
(exception.except ..cannot_find_file [path]))
(#.Some node)
(case [node tail]
- [(#.Left file) #.Nil]
+ [(#.Left file) #.End]
(#try.Success (dictionary.put head
(#.Left (|> file
(set@ #mock_last_modified now)
(set@ #mock_content content)))
directory))
- [(#.Right sub_directory) (#.Cons _)]
+ [(#.Right sub_directory) (#.Item _)]
(do try.monad
[sub_directory (recur sub_directory tail)]
(in (dictionary.put head (#.Right sub_directory) directory)))
@@ -1062,7 +1062,7 @@
_
(exception.except ..cannot_find_file [path])))
- #.Nil
+ #.End
(exception.except ..cannot_find_file [path]))))
(def: (mock_delete! / path mock)
@@ -1070,14 +1070,14 @@
(loop [directory mock
trail (text.split_all_with / path)]
(case trail
- (#.Cons head tail)
+ (#.Item head tail)
(case (dictionary.get head directory)
#.None
(exception.except ..cannot_delete [path])
(#.Some node)
(case tail
- #.Nil
+ #.End
(case node
(#.Left file)
(#try.Success (dictionary.remove head directory))
@@ -1087,7 +1087,7 @@
(#try.Success (dictionary.remove head directory))
(exception.except ..cannot_delete [path])))
- (#.Cons _)
+ (#.Item _)
(case node
(#.Left file)
(exception.except ..cannot_delete [path])
@@ -1097,7 +1097,7 @@
[sub_directory' (recur sub_directory tail)]
(in (dictionary.put head (#.Right sub_directory') directory))))))
- #.Nil
+ #.End
(exception.except ..cannot_delete [path]))))
(def: (try_update! transform var)
@@ -1118,19 +1118,19 @@
(loop [directory mock
trail (text.split_all_with / path)]
(case trail
- (#.Cons head tail)
+ (#.Item head tail)
(case (dictionary.get head directory)
#.None
(case tail
- #.Nil
+ #.End
(#try.Success (dictionary.put head (#.Right ..empty_mock) directory))
- (#.Cons _)
+ (#.Item _)
(exception.except ..cannot_make_directory [path]))
(#.Some node)
(case [node tail]
- [(#.Right sub_directory) (#.Cons _)]
+ [(#.Right sub_directory) (#.Item _)]
(do try.monad
[sub_directory (recur sub_directory tail)]
(in (dictionary.put head (#.Right sub_directory) directory)))
@@ -1138,7 +1138,7 @@
_
(exception.except ..cannot_make_directory [path])))
- #.Nil
+ #.End
(exception.except ..cannot_make_directory [path]))))
(def: (retrieve_mock_directory! / path mock)
@@ -1146,10 +1146,10 @@
(loop [directory mock
trail (text.split_all_with / path)]
(case trail
- #.Nil
+ #.End
(#try.Success directory)
- (#.Cons head tail)
+ (#.Item head tail)
(case (dictionary.get head directory)
#.None
(exception.except ..cannot_find_directory [path])
@@ -1161,10 +1161,10 @@
(#.Right sub_directory)
(case tail
- #.Nil
+ #.End
(#try.Success sub_directory)
- (#.Cons _)
+ (#.Item _)
(recur sub_directory tail)))))))
(def: #export (mock separator)
@@ -1322,10 +1322,10 @@
(case (if rooted?
(list.drop 1 segments)
segments)
- #.Nil
+ #.End
(\ monad in (exception.except ..cannot_make_directory [path]))
- (#.Cons head tail)
+ (#.Item head tail)
(case head
"" (\ monad in (exception.except ..cannot_make_directory [path]))
_ (loop [current (if rooted?
@@ -1337,10 +1337,10 @@
(case ?
(#try.Success _)
(case next
- #.Nil
+ #.End
(in (#try.Success []))
- (#.Cons head tail)
+ (#.Item head tail)
(recur (format current (\ fs separator) head)
tail))