| Line 1: |
Line 1: |
| | === Hash # Operator === | | === Hash # Operator === |
| | | | |
| − | # Operator can have multiple meanings, when used as a binary operator or as suffix. [[Hash # Operator | Hash # Operator ]]. | + | # Operator can have multiple meanings, when used as a binary operator or as suffix. |
| | | | |
| | # can be used to (1) arrafy functions, (2) index, search and filter arrays, and (3) index and search Objects. | | # can be used to (1) arrafy functions, (2) index, search and filter arrays, and (3) index and search Objects. |
| Line 7: |
Line 7: |
| | ====# To Arrayfy Functions==== | | ====# To Arrayfy Functions==== |
| | | | |
| − | Any functions can be enabled with Array handling for all (or some) parameters, by using # operator. For example: v:=u+a*t; creates a function v which computes the expression u+a*t, with u, a, and t as parameters. However, this function only takes simple parameters as inputs. To make the function v to be able to compute combinations of arrays as parameters, using [[Z_Programming_and_Combinatorial_Arguments | Combinatorial Arguments]], simply use the notation v# to enable array handling capabilities to each of the parameters. If we wish to exclude any parameter, provide an array of such parameters index as the suffix to #. For example, v#[1] will exclude "a" (the 1st index parameter) from handling input arrays. | + | Any function can be enabled with Array handling for all (or some) parameters, by using # operator. For example: v:=u+a*t; creates a function v which computes the expression u+a*t, with u, a, and t as parameters. However, this function only takes simple parameters as inputs. To make the function v to be able to compute combinations of arrays as parameters, using [[Z_Programming_and_Combinatorial_Arguments | Combinatorial Arguments]], simply use the notation v# to enable array handling capabilities to each of the parameters. If we wish to exclude any parameter, provide an array of such parameters index as the suffix to #. For example, v#[1] will exclude "a" (the 1st index parameter) from handling input arrays. |
| | | | |
| | Once arrayfied, the function can take arrays as arguments, and for each of the cartesian product of the parameters, a result will be computed. For example, once arrayfied, v(1..2,3..4,1..10) will compute the value for v for each combination of the three parameter arrays. | | Once arrayfied, the function can take arrays as arguments, and for each of the cartesian product of the parameters, a result will be computed. For example, once arrayfied, v(1..2,3..4,1..10) will compute the value for v for each combination of the three parameter arrays. |