Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Develop the function eval: AExp -> N where (eval ae) returns the number denoted by the expression ae. For example, (eval ae1) should return -51, and (eval ae2) should return 16.
  2. Wiki Markup
    \[Challenge\] Assume that our expression language includes many basic operations, not just the four supported by {{AExp}}.  We would want a single representation for the application of a binary operator to arguments and use a separate data definition enumerating all of our operations. Rewrite the preceding data definitions, examples,
     and the function {{eval}} using for this.  As a further challenge, extend your data definition to accommodate unary operations including negation and absolute value as unary operators.

...