github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/gen/includes/expr-strict-types.inc.md (about)

     1  ### Type Safety
     2  
     3  Because shells are historically untyped, you cannot always guarantee that a
     4  numeric-looking value isn't a string. To solve this problem, by default Murex
     5  assumes anything that looks like a number is a number when performing addition.
     6  
     7  ```
     8  » str = "2"
     9  » int = 3
    10  » $str + $int
    11  1
    12  ```
    13  
    14  For occasions when type safety is more important than the convenience of silent
    15  data casting, you can disable the above behaviour via `config`:
    16  
    17  ```
    18  » config set proc strict-types false
    19  » $str + $int
    20  Error in `expr` (0,1): cannot Add with string types
    21                      > Expression: $str + $int
    22                      >           : ^
    23                      > Character : 1
    24                      > Symbol    : Scalar
    25                      > Value     : '$str'
    26  ```