// Example of how to extend parserm.fs open System; open Microsoft.FSharp.Math;; open System.Collections.Generic;; open CSC7B;; // compile with -r parserm.dll // add the power operator newoperator "\^" 700;; // need escape char \ for some chars (not %) binops <- List.append binops ["^"];; let eval0 = eval; eval <- fun env exp -> match exp with | Binop("^",a,b) -> let ea,eb = (eval env a), (eval env b) int(Math.Pow(float(ea),float(eb))) | e -> eval0 env e;; advice_io(true,run);; // run with just console prompt and input advice