| ▲ | miki123211 6 hours ago | |
What I would do here is something like: 1. standardize on JSON as the internal representation, and 2. write a simple (<1kloc) Python-based compiler that takes human-friendly, Pythonic syntax and transforms it into that JSON, based on operator overloading. So you would write something like:
and then in class Node (in the compiler):
Values like total_nonrefundable_credits would be objects of class Node that "know where they come from", not imperatively-calculated numbers. The __sub__ method (which is Python's way of operator overloading) would return a new node when two nodes are subtracted. | ||