Remix.run Logo
middayc 16 hours ago

This is another subject but mathematical operators are and behave (for better and worse - there are also negative consequences of this consistency) like all other op-words, they just don't need . in front and correct, non-op-word is prepended by _.

    12 + 23    ; is technically
    12 ._+ 23  ; or not using op-word is
    _+ 12 23   ; or if we bind function _+ to add
    add: ?_+   ; we get
    12 .add 23 ; and
    add 12 23
It has downside because op-words don't behave exactly as math expressions would, but you can use parenthesis and we have a math dialect which includes full math precedence rules.

    math { 12 * 2 + 23 * 3 }