git.annexia.org
/
goals.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stdlib: Implement read() and readlines() functions.
[goals.git]
/
stdlib
/
prelude.gl
diff --git
a/stdlib/prelude.gl
b/stdlib/prelude.gl
index
e2d0400
..
5d072ea
100644
(file)
--- a/
stdlib/prelude.gl
+++ b/
stdlib/prelude.gl
@@
-107,6
+107,16
@@
pure function extension (name) returning string = @{
echo "${name##*.}"
}
echo "${name##*.}"
}
+# Read a file.
+function read (filename) returning string = @{
+ cat %filename
+}
+
+# Read a file as a list of lines.
+function readlines (filename) returning strings = @{
+ cat %filename
+}
+
# Real path.
function realpath (filename) returning string = @{
realpath -- %filename
# Real path.
function realpath (filename) returning string = @{
realpath -- %filename