@@ -69,20 +69,30 @@ export operation
6969
7070Returns the arguments to the function call in a function call expression.
7171`iscall(x)` must be true as a precondition.
72+
73+ Depending on the type and internal representation of `x`,
74+ `arguments(x)` may return an unsorted collection nondeterministically,
75+ This is to make sure to retrieve the arguments of an expression when the order of arguments does not matter
76+ but the speed of the operation does.
77+ To ensure to retrieve arguments in a sorted manner, you can use
78+ and implement the function `sorted_arguments`.
7279"""
7380function arguments end
7481export arguments
7582
7683"""
77- unsorted_arguments (x::T)
84+ sorted_arguments (x::T)
7885
79- If x is a expression satisfying `iscall(x)` and your expression type `T` provides
80- and optimized implementation for storing the arguments, this function can
81- be used to retrieve the arguments when the order of arguments does not matter
82- but the speed of the operation does.
86+ Returns the arguments to the function call in a function call expression, in a **sorted fashion**.
87+ `iscall(x)` must be true as a precondition. Analogous to `arguments`,
88+ but ensures that the operation is deterministic and always returns
89+ the arguments in the order they are stored.
90+
91+ By default, this redirects to `arguments`, therefore implementing
92+ it is optional.
8393"""
84- unsorted_arguments (x) = arguments (x)
85- export unsorted_arguments
94+ sorted_arguments (x) = arguments (x)
95+ export sorted_arguments
8696
8797
8898"""
0 commit comments