I have been learning Scala, it has been so good so far, sadly i have found certain behaviour that i don't fully understand. I hope you guys can give me some clues, the problem emerged when i coded this class:
class Point(iDim:Int,data:Array[Double],f: Array[Double] => Double) {
...
def this(idim: Int, obj :ObjectThatGenerate_ArrayofDouble, f: Array[Double] => Double){
this(idim,obj.generateArray(idim),f)
}
}
So when i use these constructors in my main code i need to do this
var p:Point = new Point (idim,obj,f _)
or
var p:Point = new Point (idim,dataArray,f _)
but if i delete the auxiliar constructor i only need to build the object like this:
var p:Point = new Point (idim, dataArray, f)
Why in scala when i have an auxiliary constructor i need to pass a partially implemented function "f _ " and when i don't have an auxiliary constructor i can pass the function directly "f "?, or the character "_" have another meaning in this context?