Open tiymat opened 1 week ago
The =
syntax is old code where I relied on a 3rd party module to handle expressions. However because the syntax for =
and expr
differs slightly (where I was able to make improvements to Murex's parser to natively support expressions), it meant I was nervous about replacing =
with the new code as it would cause braking changes. But the =
code is now deprecated and will be removed in the next major release of Murex.
expr
wasn't intended to be invoked manually because there's some special-case code handling parsing of expressions to make them more ergonomic, and that always doesn't translate well to statements. This is something I should update the docs to reflect.
That all said, the issue you ran into was definitely a bug because expr
was only checking the first parameter. That's now fixed in develop
Thanks for the fix! The specific part of the documentation that led to me trying it was the last example of the Usage
block in the expr reference.
@tiymat that's a very good point. Is the new docs (only in develop
at the moment) any clearer?
https://dev.murex.rocks/commands/expr.html#description
@tiymat that's a very good point. Is the new docs (only in
develop
at the moment) any clearer? https://dev.murex.rocks/commands/expr.html#description
Definitely!
Describe the bug: Invoking
expr
viaexpr
gives different results than invoking it with=
or just writing the expression.Expected behaviour: Invoking an expression by any of the 3 possible ways should provide the same result.
Screenshots:![image](https://github.com/lmorg/murex/assets/138939221/66179e6d-b5e2-4493-9a5a-113ee7d805c3)
Platform (please complete the following information):
uname -a
if supported: 6.9.7-arch1-1version --no-app-name
: 6.1.8300Additional context Bracketing the expression seems to fix the issue as a workaround. e.g.
expr (1 + 2)
gives 3.