-
Notifications
You must be signed in to change notification settings - Fork 148
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
Provide a more basic example #304
Comments
IMO I think it's good. I think the intro is pretty accessible, and personally I wouldn't suggest StaticArrays to someone in their first week of Julia since it's just an optimization and not a required feature. And I would tell people to just use function signatures with |
Sure I ended up getting it after some hours messing around. But it was initially too vague to be a simple drop in replacement for Array. I've worked in with haskel types/10 other languages for years so it shouldn't be (also explains using this package in my first week). Julia is meant to be easy to learn and for generalist scientists so I commented, I wouldn't have for another language so take it or leave it. |
What exactly tripped you up? Someone who just learned is in the best spot to propose changes. |
@rafaqz Now you've had some more time to play with it, can you give an example of what you would have found helpful? |
There was no example of a static array declaration followed by it's use as a typed argument in an example function - which seems basic but would have provided some certainty about what would definitely work. I was getting confusing type errors when everything looked like it should just work. It was possibly because I still had code altering an immutable array or something (I can't remember now) but the error did not mention that explicitly so I futzed around. |
Like: v1 = SVector(1, 2, 3)
f(v) = sum(v1)
f(v1) # Generic works
f(v::StaticArray) = sum(v1)^2
f([1,2,3])
f(v1)
f(v::StaticArray{Tuple{3},T,N}) where {T,N} = v[1] + v[2] + v[3] + 10 ? |
I'm going to close this because it's not clear there's something specific and actionable here. That's not to claim our documentation for this package is great, just that it's not clear from this issue what would have helped you specifically. |
Could you provide a more basic example in the readme that puts together
how to define a StaticArray, and how to then use it in a function with a type signature?
The readme starts maybe a little above the level of someone in their first week of julia...
The text was updated successfully, but these errors were encountered: