Rename `anytype` to `anyval`
Sorry, this is kind of nitpicking, but it's been bothering me. The value of a variable of type `anyerror` is some error. The value of a variable of type `anyframe` is some frame. The value of a variable of type `anytype` is usually not a type. Said another way, A variable that holds some unknown error is an `anyerror`. A variable that holds some unknown frame is an `anyframe`. A variable that holds some unknown type is a `type`. A variable that holds some unknown value is an `anytype`? `var` was a bad name because it was overloaded with the mutability specifier. But aside from that, IMO it was an ok name. I don't think we should restore it but I think `anytype` is also confusing. `any` might be a good choice except that it is a common enough variable or function name that the language probably shouldn't reserve it. `infer` was suggested previously, but doesn't convey that the type can change over the variable's lifetime. Maybe `anyvalue`, `anyval`, or `vartype` would be better?
Posted by SpexGuy on Jul 17, 2020, 6:00 AM
Tags
Related issues
- struct's lifetime requirements can be bypassed via covariant field assignment
- Proposal to Reorganize the Moderation Team and Review Moderation Policies
- Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
- proposal: container/...: generic collection types
- Better Custom Endpoint BYOK
- A concrete policy for backward compatibility until Godot 5.0
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (Other)
struct's lifetime requirements can be bypassed via covariant field assignment
Proposal to Reorganize the Moderation Team and Review Moderation Policies
Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
proposal: container/...: generic collection types
Better Custom Endpoint BYOK
A concrete policy for backward compatibility until Godot 5.0
New MTP models not supported
Tracking: 429 / Capacity Issues
Rename `anytype` to `anyval`
Sorry, this is kind of nitpicking, but it's been bothering me. The value of a variable of type `anyerror` is some error. The value of a variable of type `anyframe` is some frame. The value of a variable of type `anytype` is usually not a type. Said another way, A variable that holds some unknown error is an `anyerror`. A variable that holds some unknown frame is an `anyframe`. A variable that holds some unknown type is a `type`. A variable that holds some unknown value is an `anytype`? `var` was a bad name because it was overloaded with the mutability specifier. But aside from that, IMO it was an ok name. I don't think we should restore it but I think `anytype` is also confusing. `any` might be a good choice except that it is a common enough variable or function name that the language probably shouldn't reserve it. `infer` was suggested previously, but doesn't convey that the type can change over the variable's lifetime. Maybe `anyvalue`, `anyval`, or `vartype` would be better?
Comments (0)
No comments yet. Start the discussion.