4 ms·
That’s not an instruction on how to read the code aloud, but a way of describing a certain fact about the function. If you were actually reading it aloud, I wo
by chrismorgan 6y ago
That’s not an instruction on how to read the code aloud, but a way of describing a certain fact about the function.
If you were actually reading it aloud, I would strongly avoid that use of the word “where”, because it’ll be confused with a where clause:
fn print<T>(v: T) where T: ToString
The two are semantically identical, but they put the constraint in different places, so using the word “where” will confuse things, especially when it leads to you repeating the “T” in a way that where clauses do but the first form doesn’t.
For myself, I would probably read the original line of code as “function print, generic over type tee implementing to string, taking parameter vee of type tee”.
The where clause version I’d read as “function print, generic over type tee, taking parameter vee of type tee, where tee implements to string”.