Strange behaviour with partial evaluation and sum() function

Hi all, I have encountered strange behaviour when using partial evaluation with the sum() function.

I get different answers with the same calculation.

Please see the attached screenshots to see what I mean.

This expression produces an incorrect result of 5.

Where this expression produces the correct result of 6.

Both expressions use the same sum(1, _)(2, 3) function.

Any ideas why the results are different?

 

Thanks,

Morné

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I haven't seen this before (don't use partial evaluation much outside of apply()), but it looks like in this case the value: parameter ignores the initial input into the partially-evaluated function.

    Thus this code:

    a!textField(
      value: concat("mike ", _)("ok1 ", "ok2 "),
      readOnly: true()
    )

    which when run in an expression rule editor returns "mike ok1 ok2", drops the "mike" part when used as the value: parameter of the text field.

Reply
  • 0
    Certified Lead Developer

    I haven't seen this before (don't use partial evaluation much outside of apply()), but it looks like in this case the value: parameter ignores the initial input into the partially-evaluated function.

    Thus this code:

    a!textField(
      value: concat("mike ", _)("ok1 ", "ok2 "),
      readOnly: true()
    )

    which when run in an expression rule editor returns "mike ok1 ok2", drops the "mike" part when used as the value: parameter of the text field.

Children
No Data