[erlang-questions] working with sets

Vance Shipley vances@REDACTED
Fri Jan 4 02:12:55 CET 2008


On Fri, Jan 04, 2008 at 01:21:51AM +0100, Robert Virding wrote:
}  I would use ordsets to test with as it is then easy to actually see and
}  understand the sets. Understanding a set from sets is not always trivial.
}  The interface is the same and if the sets are small then maybe it is
}  perfectly alright to use ordsets anyway.

Ah yes, that's much simpler.

    1> OrdSet1 = ordsets:from_list([1,2,3]). 
    [1,2,3]
    2> OrdSet2 = ordsets:from_list([4,5,6]).
    [4,5,6]
    3> OrdSet3 = ordsets:from_list([7,8,9]).
    [7,8,9]
    4> OrdSet = ordsets:from_list([OrdSet1,OrdSet2,OrdSet3]).
    [[1,2,3],[4,5,6],[7,8,9]]
    
I'll roll up on this.

	-Vance



More information about the erlang-questions mailing list