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

Fix struct reference in docs #7838

Closed
kmsquire opened this issue Aug 4, 2014 · 6 comments
Closed

Fix struct reference in docs #7838

kmsquire opened this issue Aug 4, 2014 · 6 comments
Assignees
Labels
docs This change adds or pertains to documentation

Comments

@kmsquire
Copy link
Member

kmsquire commented Aug 4, 2014

As noted here, the docs still incorrectly state that

Currently, it is not possible to pass structs and other non-primitive types from Julia to C libraries.

at the end of the first section here.

@kmsquire
Copy link
Member Author

kmsquire commented Aug 4, 2014

Actually, in the same post on Google docs, Jameson also stated that

There is a section in the manual about how to pass struct a to/from C.

I was looking for that, but couldn't find it in the latest docs. Did I miss it?

@vtjnash
Copy link
Sponsor Member

vtjnash commented Aug 5, 2014

hm, technically that statement isn't wrong – you can't pass structs and other non-primitive types from Julia to C (#3466), but it's misleading, since you can pass pointers to structs (pointers being a primitive types) and that's what you actually want to do about 99% of the time anyways.

http://docs.julialang.org/en/latest/manual/calling-c-and-fortran-code/#type-correspondences

@kmsquire
Copy link
Member Author

kmsquire commented Aug 5, 2014

Yep, that makes sense. Maybe it would be good to clarify that you can pass pointers to structs in that statement (which is what I'm doing, of course).

I did find that table after I wrote the second comment. I think I was looking for something more, but maybe I'll try to write something up myself at some point.

@binarybana
Copy link
Contributor

+1 for more description regarding this. The first time I needed to pass a pointer to a Julia struct I felt like I was floating over uncharted waters because I didn't appreciate the primitive type/pointer distinction.

@kmsquire kmsquire changed the title Fix incorrect struct reference in docs Fix struct reference in docs Aug 25, 2014
@ihnorton
Copy link
Member

Can this be closed? There is some discussion about by-value vs pointer to structs at http://docs.julialang.org/en/latest/manual/calling-c-and-fortran-code/#mapping-c-types-to-julia (two paragraphs above that anchor)

@kmsquire
Copy link
Member Author

No longer an issue, as the relevant text (and functionality) has totally changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

No branches or pull requests

5 participants