Call your helper functions I
, K
, Y
, Z
, g
, k
, l
, u
or w
Add++ doesn't have any way to combine multiple functional builtins into one command (for those familiar, like Jelly's $¥
quicks). If you want to e.g. filter on a complex condition, you'll need to define a helper function containing the code for that condition.
When calling other functions from functional mode, you surround the name with {...}
:
D,main,@,€{triple}
D,triple,@,3*
However, if the braces are omitted, it will only take the next character immediately after the quick. In this case, if there's a name clash between a builtin and a user-defined function, the interpreter defaults to the builtin.
So, for this example,
D,main,@,€f
D,f,@,5+
The €
will actually call the f
builtin (prime factors), not the function f
(add 5).
If the builtin isn't defined however, such as g
, it will use the function instead. Therefore, you can save 2 bytes per helper function call like
D,main,@,€g
D,g,@,5+
The undefined builtins are I
, K
, Y
, Z
, g
, k
, l
, u
and w
, so name your helper functions these first, then move onto having to use braces if you have more than 9 helpers