← udo_call operator page · general/udo_call/all_args/positional_order
pandas ✅ · DuckDB ✅
A call with every argument, diff2(SC_1, SC_2) with SC_1 = 10 and SC_2 = 3, whose body x - y tells their order apart, as the page's max1 ( 2, 3 ) cannot.
User-defined operator call: "The arguments passed to the operator in the invocation are associated to the corresponding parameters in positional order". The page's max1, which the define operator page repeats, declares returns boolean for a body that returns an integer, and the script ends its definition with end operator, as the examples there do, not with end define operator as the syntax does.
x = 10 and y = 3, so SC_r = 7, an Integer as returns integer declares; swapped arguments would give -7.
define operator diff2 (x integer, y integer)
returns integer is
x - y
end operator;
SC_r := diff2(SC_1, SC_2);
| SC_1 | SC_2 |
|---|---|
| 10 | 3 |
{
"scalars": [
{"name": "SC_1", "type": "Integer"},
{"name": "SC_2", "type": "Integer"}
]
}
{
"scalars": [
{"name": "SC_r", "type": "Integer", "value": "7"}
]
}