2 ms·
I don't understand why they represent it as a object with a single key, whose value is an array: - If it's an object, then nothing is going to enforce there on
by mcphage 5y ago
I don't understand why they represent it as a object with a single key, whose value is an array:
- If it's an object, then nothing is going to enforce there only being one key.
- If it's a unary operator, then the value doesn't need to be wrapped in an array, but then how does it distinguish between an unary operator, whose operand is an array, vs. an n-ary operator?
Both of these problems would be solved by having each clause be an array, with the first value being the operator, and the rest of the operands being the parameters. That way having multiple operators isn't even syntactically possible, and having multiple operands is just as simple as the unary operand case.