AngouriMath

Navigation

← Back to list of members

ToSet​(System.​Collections.​Generic.​IEnumerable{AngouriMath.​Entity})

 Method (no overloads)

Summary

Converts your IEnumerable into a set of unique values.

Returns

A Set

Example

Elements are deduplicated by the expression they are, not by the value they
have, so two ways of writing the same number both survive:
Console.WriteLine(new Entity[] { 1, 2, 2, "x", "x" }.ToSet());
Console.WriteLine(new Entity[] { "x + x", "2x" }.ToSet());

Prints
{ 1, 2, x }
{ x + x, 2 * x }

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online