3 ms·
So it's a special notation that I can overload to use with multiple types. I can already do that with normal function call notation. How does the added complexi
by mrob 11y ago
So it's a special notation that I can overload to use with multiple types. I can already do that with normal function call notation. How does the added complexity benefit me?
- Maken 11y agoWell, using "abs()" for it would be a bad idea, because "|x|" (or "||x||") means "whatever is the distance I've defined between two elements of this particular space". For all that I know, the only reason to write "|x|" instead of "norm(x)" or "length(x)" is because brevity and because it is a well accepted notation. Edit: wrong post.
- kaitai 11y agoI force my students to use this overloaded notation because I want to make very clear to them the commonality of ideas. They need to know that determinant of a matrix, length of a vector, and absolute value are all ways of measuring "size" in different contexts that fit together into a harmonious whole. abs(Matrix) just doesn't... do that. Doesn't make sense.