Banjo

52 thoughts
last posted Nov. 9, 2015, 7:13 p.m.

47 earlier thoughts

0

Kawa's approach to quantities and binary arithmetic

http://www.gnu.org/software/kawa/internals/numbers.html

Kawa is a scheme dialect with the Scheme numerical tower enhanced with support for units of measure.

For binary operators, Kawa calls a method of the left-hand object. That object tries to see if it has been given an object type it recognises; if not, it will fallback to calling a "reversed" version on the right-hand side. The "reversed" version should not fall back yet again.

4 later thoughts