summaryrefslogtreecommitdiff
path: root/libstd/dirname.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-08-26 12:20:58 -0700
committerOri Bernstein <ori@eigenstate.org>2015-08-26 12:20:58 -0700
commit2bc852bda98762d3bc01548bf972e3f1b137fbfb (patch)
tree74831deed3c9057c5fe0cbb8790d220e855bc792 /libstd/dirname.myr
parent3de952510eb2a23350d24ed926f19c0cf72a12f2 (diff)
downloadmc-2bc852bda98762d3bc01548bf972e3f1b137fbfb.tar.gz
Move Myrddin libs to lib/ subdirectory.
Diffstat (limited to 'libstd/dirname.myr')
-rw-r--r--libstd/dirname.myr37
1 files changed, 0 insertions, 37 deletions
diff --git a/libstd/dirname.myr b/libstd/dirname.myr
deleted file mode 100644
index 5e80771..0000000
--- a/libstd/dirname.myr
+++ /dev/null
@@ -1,37 +0,0 @@
-use "alloc.use"
-use "slcp.use"
-use "die.use"
-use "sldup.use"
-use "strfind.use"
-use "option.use"
-
-pkg std =
- const dirname : (p : byte[:] -> byte[:])
- const basename : (p : byte[:] -> byte[:])
-;;
-
-const dirname = {p
- match std.strrfind(p, "/")
- | `std.Some idx:
- -> std.sldup(p[:idx])
- | `std.None:
- -> std.sldup(".")
- ;;
-}
-
-const basename = {p
-:again
- if p.len == 0
- -> std.sldup(".")
- ;;
-
- match std.strrfind(p, "/")
- | `std.Some idx:
- if idx == p.len - 1
- goto again
- ;;
- -> std.sldup(p[idx+1:])
- | `std.None:
- -> std.sldup(p)
- ;;
-}