5 ms·
> Use spacing to specify the order of arithmetic operations Reminds me of EWD1300: > Surround the operators with the lower binding power with more space than
by creata 3y ago
> Use spacing to specify the order of arithmetic operations
Reminds me of EWD1300:
> Surround the operators with the lower binding power with more space than those with a higher binding power.
- compressedgas 3y agoThe merd language http://merd.sourceforge.net/ http://merd.sourceforge.net/ from 2003 states: > horizontal layout: 1+2 * 3 is (1+2) * 3 (merd innovation!)
- raddan 3y agoAnnoyingly, SmallTalk actually does this, so they got there first. The reason is that operators are just methods (and numbers are objects) and so arithmetic dispatches left to right unless parens are used, ala (1.+(2)).*(3)
- fbdab103 3y agoOutside of giving mathematicians a stroke, is that really unreasonable? I kind of like the idea of treating operations more regularly.
- skulk 3y agoI'm pretty sure APL (if not APL, definitely J) also does this too and APL was designed as a common "mathematical" language for expressing computation.
- akkartik 3y agoAlso my https://github.com/akkartik/wart https://github.com/akkartik/wart
- skulk 3y agoI'm really curious what that broken G+ link next to "batshit liberal" says.
- akkartik 3y agoHa! I should fix that. It's Steve Yegge's post on software liberals vs conservatives, hold on let me find it. Edit: Here's a bootleg: https://gist.github.com/mrnugget/49ad3ee4043c746e42187e2820ddc2f6 https://gist.github.com/mrnugget/49ad3ee4043c746e42187e2820d...