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

Closure #323

Merged
merged 2 commits into from
Feb 4, 2016
Merged

Closure #323

merged 2 commits into from
Feb 4, 2016

Conversation

albertnetymk
Copy link
Contributor

A prerequisite for migrating to new ponyrt.

@EliasC
Copy link
Contributor

EliasC commented Jan 26, 2016

Could you quickly clarify why this is necessary for the new ponyrt?

Can I still write programs that use functions in a higher-order fashion?

def bump(x : int) : int
  x + 1

def apply(f : int -> int, x : int) : int
  f(x)

def foo() : int
  apply(bump, 42)

@albertnetymk
Copy link
Contributor Author

https://github.com/parapluu/encore/wiki/Issues-in-new-PonyRT

I believe you can. print foo(); gives me 43.

closure_fun call;
void *env;
pony_trace_fn trace;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be exposed to the outside?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I see it now. Is it to be able to make static initializations of closures?

@EliasC
Copy link
Contributor

EliasC commented Feb 4, 2016

I like this PR, and will merge it later today!

@albertnetymk
Copy link
Contributor Author

Is it to be able to make static initializations of closures?

Yes.

EliasC added a commit that referenced this pull request Feb 4, 2016
@EliasC EliasC merged commit 8268742 into parapluu:development Feb 4, 2016
@albertnetymk albertnetymk deleted the closure branch February 4, 2016 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants