Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support defining and calling constant functions #122

Merged
merged 1 commit into from
Sep 28, 2020
Merged

Conversation

udoprog
Copy link
Collaborator

@udoprog udoprog commented Sep 28, 2020

This adds support for defining and calling functions like these:

const VALUE = "baz";

const fn foo(n) {
    `foo {n}`
}
    
fn main() {
    foo(`bar {VALUE}`)
}

const fn's have the same restrictions as constant items, except that their input parameters can be defined.

We still need to add support for calling const fns from other const fns or const items.

@udoprog udoprog added the enhancement New feature or request label Sep 28, 2020
@udoprog udoprog merged commit d8caf61 into master Sep 28, 2020
@udoprog udoprog deleted the const-fns branch September 28, 2020 14:43
@udoprog udoprog added the changelog Issue has been added to the changelog label Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Issue has been added to the changelog enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant