hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 8612bf387fc459c1dca36c7e104f369cff53f45a
parent 6e3a224da528447a617e9b216d5185a69a5e5adb
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 12 Feb 2021 09:12:56 -0500

Drop must_ versions of functions

The caller should use a type assertion, e.g. `os::streamfd(s) as int`

Diffstat:
Mos/+linux/fdstream.ha | 8--------
Dos/environ.ha | 8--------
2 files changed, 0 insertions(+), 16 deletions(-)

diff --git a/os/+linux/fdstream.ha b/os/+linux/fdstream.ha @@ -55,14 +55,6 @@ export fn streamfd(s: *io::stream) (int | void) = { return stream.fd; }; -// Returns the file descriptor for a given [io::stream]. If there is no fd -// associated with this stream, abort. -export fn must_streamfd(s: *io::stream) int = { - assert(is_fdstream(s)); - let stream = s: *fd_stream; - return stream.fd; -}; - fn fd_read(s: *io::stream, buf: []u8) (size | io::EOF | io::error) = { let stream = s: *fd_stream; return match (rt::read(stream.fd, buf: *[*]u8, len(buf))) { diff --git a/os/environ.ha b/os/environ.ha @@ -1,8 +0,0 @@ -// Looks up an environment variable and returns its value. Aborts if unset. -export fn must_getenv(name: const str) const str = { - // TODO: It would be nice to print the name of the variable in the error - match (getenv(name)) { - s: str => s, - * => abort("required environment variable unset"), - }; -};