source-academy / source-programs

Notable Source programs, developed for SICP JS and other educational projects
GNU General Public License v3.0
7 stars 18 forks source link

Add unary minus functionality for MCE #4

Closed arsalan0c closed 4 years ago

arsalan0c commented 4 years ago

Currently, the unary minus operation is not supported by the MCE with only binary minus being supported.

For example, parse_and_eval("-1;"); gives the following error:
Expected number on right hand side of operation, got undefined.
This is a result of the second number argument not being received by the minus primitive function.