Skip to content

False statement in language/operators about Raku's evaluation model #4058

@florian-pe

Description

@florian-pe

The issue concers this page :
https://docs.raku.org/language/operators

Here is pretty much the first sentence

The precedence and associativity of Raku operators determine the order of evaluation of operands in expressions.

Which is false, as demonstrated by this example :

$ raku -e 'print(1) ** print(2) ** print(3); say ""'
WARNINGS for -e:
Useless use of "**" in expression "print(1) ** print(2) **" in sink context (line 1)
123

I made a github issure very recently about it, as I confounded operators precedence and associativity VS order of evaluation of operands. If there are no side effects, then it doesn't change anything and you wouldn't even know that the order is different, as a language user, but if there are side effects, then it becomes apparent that there is a distinction.

https://stackoverflow.com/questions/71941798/why-does-print-isnt-affected-by-operator-precedence/71942002

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation issue (primary issue type)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions