tricu

A lazy functional language based on Tree Calculus
Log | Files | Refs | README | LICENSE

arithmetic.tri (453B)


      1 !import bd2c14d6db6b69308a5252a8e839705a55d30e815f012900b094315263e08d81 *
      2 !export *
      3 
      4 -- Let's do some arithmetic! Our import supplies add and mul (multiply).
      5 -- Function calls use spaces between the function and its inputs.
      6 total = add 5 7
      7 multiplied = mul 5 7
      8 
      9 -- Parentheses make one calculation the input to another.
     10 grouped = mul (add 5 7) 2
     11 
     12 -- Try changing the numbers to calculate the cost of two things you'd buy.
     13 -- Next: Your first function.