@@ -69,20 +69,30 @@ export operation
69
69
70
70
Returns the arguments to the function call in a function call expression.
71
71
`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`.
72
79
"""
73
80
function arguments end
74
81
export arguments
75
82
76
83
"""
77
- unsorted_arguments (x::T)
84
+ sorted_arguments (x::T)
78
85
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.
83
93
"""
84
- unsorted_arguments (x) = arguments (x)
85
- export unsorted_arguments
94
+ sorted_arguments (x) = arguments (x)
95
+ export sorted_arguments
86
96
87
97
88
98
"""
0 commit comments