What is the meaning of this combinator in scala? /:
I've found it in several examples:
override def toString(): String = {
("" /: cfg) ((str: String, b: BasicBlock) => str + "Block " + b.id)
}
or
val successorIns = b.getSuccessors().map(in(_))
val newValue = (top() /: successorIns) (meet(_, _))
It is shorthand for foldLeft
. You can see the definition of it here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With