But…
This “single dispatching” can lead to contorted code
How to handle?
3+1
4.1+5.9
2+6.5
3.5+8
Two different code bodies
+ for int, + for float
Two cases inside each code body
One that coerces the argument, one that doesn’t
Previous slide
Next slide
Back to first slide
View graphic version