-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
Bare methods and bare lambdas (RFC 34) #1858
Conversation
Before we merge this, I want to note the documentation and other "how we teach this changes" that we should have ready at the same time:
|
} | ||
|
||
member = ast_sibling(member); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't there only be a single member in a bare type - the bare method?
Under what circumstances might a bare type have any fields or non-bare methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is the constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks. 👍
I've added examples and opened a tutorial PR. |
{ | ||
i = 1; | ||
offset = 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is complaining about this - either need to surround this block with #if PONY_LLVM >= 309
, or add a (void)offset;
statement to prevent compiler warnings/errors about this variable not being used when the PONY_LLVM >= 309
condition on the later line is not met.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
These new language constructs can be used in FFI interoperation with C libraries that use function pointers as callbacks. Closes ponylang#1690.
Awesome work! |
This was broken as a side effect the placement of a check introduced in #1858, and was fixed by just changing the order of the checks so that we don't expect to be in a method body frame if we are in a default argument frame.
This was broken as a side effect the placement of a check introduced in #1858, and was fixed by just changing the order of the checks so that we don't expect to be in a method body frame if we are in a default argument frame.
These new language constructs can be used in FFI interoperation with C libraries that use function pointers as callbacks.
Closes #1690.