Just because mathematics allows an implied multiplication doesn't mean Raku
does -- in fact I can't think of any programming language which does. You
need to stick an explicit multiplication operator ('*' or '×') between the
5 and the left parenthesis.

The reason for the error message is that adding parentheses after something
is interpreted as trying to invoke a function. Callable objects such as
functions have a CALL-ME method which is what is invoked to call the
function. An integer lacks such a method, since it isn't callable.

On Tue, 2 Mar 2021 at 19:13, ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

>
> Hi All,
>
> Math problem:
>      x = 60÷5(7−5)
>
> raku -e 'say 60÷5(7−5)'
> No such method 'CALL-ME' for invocant of type 'Int'
>    in block <unit> at -e line 1
>
> Seems raku does not like the ().  How do I fix this
> and maintain the flow and look of the equation?
>
> -T
>
> The correct answer is 24
>
>
>

Reply via email to