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

RFC: bare-ffi-lambdas #1690

Closed
Theodus opened this issue Mar 15, 2017 · 3 comments
Closed

RFC: bare-ffi-lambdas #1690

Theodus opened this issue Mar 15, 2017 · 3 comments
Assignees

Comments

@Theodus
Copy link
Contributor

Theodus commented Mar 15, 2017

Adds "bare" lambdas for use in FFI interoperation with C libraries that use function pointers as callbacks: https://github.com/ponylang/rfcs/blob/master/text/0034-bare-ffi-lambdas.md

@Praetonus
Copy link
Member

Something from the RFC is unclear to me.

class Foo
  fun @foo() => None

Foo.foo()

In this example, should Foo.foo()

  1. be generated as a direct call to the function?
  2. be sugared as Foo.create().foo()?
  3. result in a compilation error?

@jemc
Copy link
Member

jemc commented Mar 28, 2017

Good question. That may not have been clearly defined in the RFC, but we can take a stab at defining it now.

  1. be generated as a direct call to the function?

This makes sense to me, given that an instance of Foo is not required for invoking the function. So, "bare" functions would be executable both on a type, or on an instance, much like constructors are.

@Praetonus
Copy link
Member

Yeah that makes sense.

Praetonus pushed a commit to Praetonus/ponyc that referenced this issue Apr 21, 2017
These new language constructs can be used in FFI interoperation with C
libraries that use function pointers as callbacks.

Closes ponylang#1690.
Praetonus pushed a commit to Praetonus/ponyc that referenced this issue Apr 21, 2017
These new language constructs can be used in FFI interoperation with C
libraries that use function pointers as callbacks.

Closes ponylang#1690.
Praetonus pushed a commit to Praetonus/ponyc that referenced this issue Apr 21, 2017
These new language constructs can be used in FFI interoperation with C
libraries that use function pointers as callbacks.

Closes ponylang#1690.
Praetonus pushed a commit to Praetonus/ponyc that referenced this issue May 16, 2017
These new language constructs can be used in FFI interoperation with C
libraries that use function pointers as callbacks.

Closes ponylang#1690.
Praetonus pushed a commit to Praetonus/ponyc that referenced this issue May 17, 2017
These new language constructs can be used in FFI interoperation with C
libraries that use function pointers as callbacks.

Closes ponylang#1690.
jemc pushed a commit that referenced this issue May 18, 2017
These new language constructs can be used in FFI interoperation with C
libraries that use function pointers as callbacks.

Closes #1690.
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

No branches or pull requests

3 participants