On 11/13/19 8:53 PM, Nick Rosbrook wrote: >> Any particular reason to use `cslice` here rather than `mapslice` (or >> vice versa)? >> >> Not a big deal, but since they're of the came element in the C struct, >> it seems like it would be better to give them the same name. (Don't >> have a strong opinion on which one). > > IIRC, I found the name `mapslice` a little confusing, since it wasn't > of type []map[T1]T2. But, as to the inconsistent naming between the > two functions, I agree. I'll name them both `cslice`.
I think I named it that way because it's a slice fake-up of the struct element `map`. But it certainly has the risk of confusing people, and I'm a big believer in absolutely minimizing useless cognitive load. :-) Another approach might be to just choose a short "metavariable" for this sort of thing; i.e., if you use `i` and `j`, everyone knows they're going to be indexes for nested loops. `cslice` is OK but is probably longer than necessary. Anyway, I'll let you paint this bike shed whatever color you want; just make sure all sheds for the same struct are the same color. ;-) -George _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel