2 ms·
Wouldn't that just be a struct?
by AboutTheWhisles 9y ago
Wouldn't that just be a struct?
- karmakaze 9y agoLike an ad-hoc anonymously typed struct. Only the members are named, so each time the type is specified it is with the member names, hence just using a type name is preferred. If it is really just used at one or two call sites and not propagated all is well, but invariably things tend to expand in use.
- wallnuss 9y agoI still don't quite see why you wouldn't just use a named struct, but you can create a alias for the NamedTuple type const MyAlias = NamedTuple{(:a, :b),Tuple{Int64,Int64}} MyAlias((2, 3)) # (a = 2, b = 3)