Simplified function syntax does not always work

Issue #600 closed
Tey' created an issue

I found two problems while playing with the simplified syntax:

  • 3 * sin 3 fails (regression since 06/02/2016 release). The compiler considers sin 3 as an implicit multiplication so it compiles 3 * sin first. 3 * (sin 3) works, and 3 * sin -3 fails as well obviously.

  • 3 + sin -3 fails while 3 + sin 3 does not. The compiler tries to add 3 with sin as it mistakes - for the subtraction operator. I'm not sure it has ever worked.

Not sure it is worth fixing that, as there's a workaround (use parenthesis) and I don't see an easy way to do it.

Comments (11)

  1. Pol Welter

    For the first: Well, simplified function notation queries the function repo to check if the left operand is indeed a function. Adding this check as an exception to implied multiplication might work ...?

    Second: Dunno, don't care ;) It indeed is present in 0.11 already.

  2. Helder Correia repo owner

    Actually, would anyone oppose to removing the simplified function notation? The UI even helps the user by automatically inserting () and placing the cursor in between the parens. I've never liked the simplified function notation since it is not that readable (and especially now with the new features), and it adds unncessary complexity to the parser IMO. @polwel @thadrien @fk

  3. Pol Welter

    Never used it either. I am afraid quite a few users do though. Then again, with autocompleter it is actually more work not to type the parentheses...

    Really won't miss it.

  4. Hadrien Theveneau

    I'm on it. I will supress it if it is more simple to suppress it, or correct it if it is more simple to correct it.

  5. Log in to comment