You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose there are two more variances to be extended MyString and Rational, and the function add_values now work for any pairs of the variances but not just the Int. If one of the candidate is of type MyString, then we do the concatenation.
Binary methods with functional decomposition
The text was updated successfully, but these errors were encountered:
Specification
Int
,Add
,Negate
.evalExp
,toString
,hasZero
on each data variance.Functional approach
noNegConstants
, we just need to add a new function and keep the remaining unchanged.Multiply
, we would need to alter 4 blocks of code.OOP
Multiply
.noNegConstants
.Specification 2
Suppose there are two more variances to be extended
MyString
andRational
, and the functionadd_values
now work for any pairs of the variances but not just theInt
. If one of the candidate is of typeMyString
, then we do the concatenation.Binary methods with functional decomposition
The text was updated successfully, but these errors were encountered: