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

calling-c: elaborate on the x_dpy example #525

Closed
wants to merge 1 commit into from

Conversation

greenfork
Copy link
Contributor

The following code is not valid Pony code

let x_dpy = @XOpenDisplay(Pointer[U8])

The following code is not valid Pony code

    let x_dpy = @XOpenDisplay(Pointer[U8])
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Dec 29, 2023
@greenfork greenfork mentioned this pull request Dec 29, 2023
@@ -80,7 +80,8 @@ use @eglGetDisplay[Pointer[_EGLDisplayHandle]](disp: Pointer[_XDisplayHandle])
primitive _XDisplayHandle
primitive _EGLDisplayHandle

let x_dpy = @XOpenDisplay(Pointer[U8])
let x_dpy_name: String = // ...
Copy link
Member

Choose a reason for hiding this comment

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

So the code here already "doesn't compile" as it isn't valid. I don't think this change makes things better.

I think that this could be slightly better if the string is given a realistic display name.
This could be made "much better" by taking all the C calling code and make it "real" by putting the "FFI code examples" in code that would at least compile.

@SeanTAllen
Copy link
Member

@ponylang/committer I think the examples in this section are kind of a mess. They aren't valid code and leave alot for someone to guess how they are correct. I don't think that this change is helpful but I think it does highlight for me that the exmaples in this section are problematic.

I'd prefer to kick out an issue to fix the "this is basically Pony pseudo code" issues in this section.

If other committers feel this change is an improvement, we can both merge this and kick out an issue.

@SeanTAllen
Copy link
Member

Closed in favor of #526

@SeanTAllen SeanTAllen closed this Jan 9, 2024
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Jan 9, 2024
@greenfork greenfork deleted the calling-c-elaborate branch January 9, 2024 19:42
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.

None yet

3 participants