-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
library global variables #961
Comments
Clever. While this may seem like a hack at first, maybe it's totally fine --- the interface to C variables can be creating a 1-element array that you read and write. I think |
Yeah, that is very clever. Seems like a reasonable way to do this to me. The only issue is the interface to it — manipulating C globals via indexing with 1 seems pretty annoying. |
Some interface options:
|
Could also use a zero-dimensional array: julia> g = Array(Int)
0-dimensional Int64 Array:
-4
julia> g[] = 1
1 Has the benefit that 0-d arrays always have a single unique value and can't be grown. Writing |
Superseded by #1270. |
I'd like to add a function to access library global variables, e.g.,
The following seems to work,
but i'm opening this issue because there's probably a better way to do this.
The text was updated successfully, but these errors were encountered: