Why does ToRules
return a Sequence
expression? Why doesn't it return directly what {ToRules[...]}
does now? In what application is having Sequence
beneficial here?
Now we have to do x /. {ToRules[...]}
instead of x /. ToRules[...]
. I would have thought that this is the standard and most common application.
Examples:
ToRules[x == 1 || x == 2]
(* Sequence[{x -> 1}, {x -> 2}] *)
ToRules[x == 1]
(* {x -> 1} *)
ToRules[False]
(* Sequence[] *)
ToRules[True]
(* {} *)
Reduce`ReduceToRules
returns a list. $\endgroup$ToRules /@ solutions
. That's the only time I can recall liking theSequence
return value. $\endgroup$mySeq = Sequence[c -> d, e -> f]; {a -> b, mySeq, c -> d}
yields {a -> b, c -> d, e -> f, c -> d}. This can be quite useful. $\endgroup$