"Permutations" (Incremental Object)
IncrementalObject["Permutations"] [list]
creates an object that incrementally returns values that are permutations of list.
Examples
open all close allBasic Examples (1)
Scope (4)
An incremental object can be used in Table:
obj = IncrementalObject["Permutations"][{a, b, c}];
Table[e, {e, obj}]An incremental object can be used in Do:
obj = IncrementalObject["Permutations"][{a, b}];
Do[Echo[e], {e, obj}]The permutation values never repeat themselves even if there are repeated elements in the input:
obj = IncrementalObject["Permutations"][{a, a, b}];
Table[e, {e, obj}]Permutations can be processed incrementally even if the total number of permutations is very long:
obj = IncrementalObject["Permutations"][Range[20]];
Do[NextValue[obj], 10000]NextValue[obj]Properties & Relations (3)
The values return by a "Permutations" incremental object are the same as those returned by Permutations.
obj = IncrementalObject["Permutations"][{a, b, c}];
Table[e, {e, obj}]Permutations[{a, b, c}]InputForm (1)
InputForm returns the serialized contents of a "Permutations" incremental object:
InputForm[IncrementalObject["Permutations"][{a, b, c}]]This serialized form can be used to recreate the incremental object:
IncrementalObject["Permutations", {"Position" :> 1, "Length" :> 3, "Repetitions" :> False, "Data" :> {1, 2, 3, 1, 2, 3, 0, 0, 0}, "Source" :> {a, b, c}}]SameQ (1)
SameQ can be used to test whether two incremental objects contain the same sequence at the same position:
obj1 = IncrementalObject["Permutations"][{a, b, c, d}];
obj2 = IncrementalObject["Permutations"][{a, b, c, d}];
obj1 === obj2If one objects moves to the next value, the two objects are no longer the same:
NextValue[obj1];
obj1 === obj2Advancing the other object means that they are both now the same:
NextValue[obj2];
obj1 === obj2See Also
Related Guides
History
Introduced in 2026 (15.0)