-
Notifications
You must be signed in to change notification settings - Fork 306
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
[de-feature request] tuples for const-defined dimensions #622
Comments
Hi @swfsql, and welcome to the ecosystem! Will you please provide more information about the motivation for doing this? I generally find it convenient to use |
Thanks @jturner314 , This specific change - the return type of I hope this helps clarifying - and I'd like to restate that this is a pretty subjective ergonomic opinion from an inexperienced user! (and this change would surely be not welcomed for most users I believe) |
Oh, okay, you're talking about Now that Rust supports destructuring fixed-size arrays in addition to tuples, I actually think we should change all the
Length-one arrays are syntactically nicer than one-element tuples because they don't need the extra trailing comma. Additionally, arrays are more convenient than tuples because they can be iterated over easily. @swfsql, @LukeMathWalker, @bluss Thoughts? |
@jturner314 I've submitted a PR for reference. |
Sorry for the delay in answering, but it's quite an intense period. I know we have plans to review the way the whole dimension story works, and those plans will probably have to take into account the new language features that we could use to make the API nicer (e.g. const generics and GAT, for this specific case). Should we repeatedly iterate on this section of the API or should we try to batch improvements together? |
@LukeMathWalker I personally would enjoy the change but I agree, I don't it's worth for other users. On the other hand, I think there is a chance that the interface (exclusively) pushed by const generics would likely be this very change (tuples -> fixed-sized arrays). But a more drastic re-design may change it completely, so there would really be no-gains for this change. |
I think that we will end up switching from tuples to fixed-size arrays anyway when we overhaul the So, let's postpone this until we overhaul the |
updated to #622 (comment)
(so tuples replacement for arrays, and also still using arrays for 0-sized and 1-sized dimensions)
Hello, I'm new to this ecosystem here- and thanks a lot for your work on it!
As I was using the
ndarray
crate - it may be just me but - I thought that "what if we always use a tuple to indicate a shape's dimension?".I mean, this is already how it works most of the time, except for the
Ix1
and the dynamic case.That is, the only case, for compile-time defined number of dimensions, that doesn't fall into what I said above was the
Ix1
case, where a singleusize
is used as aPattern
to indicate a 1-dimensional array.I propose a de-featuring (feature removal) so that
Ix1
case would also require a 1-sized tuple, similarly to theIx2
(Ix3
, etc) cases.This would simply increase verbosity whenever a
Ix1
were to be used, so.. well.. maybe this [proposal] would be taking a step into the wrong direction.(I'll be PRing for a reference since this would require simple changes after all).
The text was updated successfully, but these errors were encountered: