Scala objects masked as methods vs actual method (Stream.cons) -
i have been going through scala stream collection api , have noticed stream.cons implemented embedded object. advantage have on implementing function? under circumstances should 1 consider using technique?
cheers.
as object, defines unapply
in addition apply
, let pattern match on it.
Comments
Post a Comment