rtulip / haystack

Haystack is a compiled, statically typed, stack-based language with opt-in variable assignment.
MIT License
25 stars 2 forks source link

Add support for private functions #116

Open rtulip opened 1 year ago

rtulip commented 1 year ago

It'd be great to be able to mark functions as pub to allow them for use outside of the file they've been written in.

// in foo.hay
fn foo_x() {}
pub fn foo_y() {}

// in main.hay
include "foo.hay"
fn main() {
    // foo_x -- Error: Function `foo_x` is private
    foo_y // this is fine
}