Thursday, May 29, 2014

Persistent (Immutable) Collections

@Grapes(
    @Grab(group='org.pcollections', module='pcollections', version='2.1.2')
)
import org.pcollections.*

PSet set = HashTreePSet.empty()
set = set + "something"
println set
println(set + "something else")
println set // immutable

No comments:

Post a Comment