How to calculate a RPN expression having two different data types in Scala?
问题 The following program is suppose to calculate an expression with the possibility of having two different data types , Float and RDD . I already created an RPN from the infix expression and now I am trying to perform calculations on them. Note: I have also overloaded :+,-,/,* for doing calculations on RDD and float . def calcRPN(s: String): RDD[(Int,Array[Float])] = (s.split(' ').toList.foldLeft(Nil: List[Either[Float, RDD[(Int,Array[Float])]]) {foldingFunction}).head def foldingFunction(list: