File becc.py contains an expression evaluator for BECC. It implements two functions:
-
s
: expression string to be evaluated -
debug
: Enable debug mode which steps through evaluation one command at a time. -
calc
: Instead of returning the reduced expression return the number of times$
operator was called. Used for decoding Church-encoded numbers for output.
Main evaluator functionality. Will reduce the expression and return it, unless calc
flag is set.
n
: number to be encoded
Returns a string representing and unquoted Church-encoded number. For example encode_nat(2)
will return "+<+-+-".