A fauna of functions
Red's built-in functions can be categorized as follows. The type is indicated within ()
:
- operators (
op!
), which can be used with infix notation, such as a+
b, a/
b, and so on. - native (
native!
) functions, such asif
,either
,while
,throw
,all
,wait
, and so on; you can see a complete list by using? op!
in the console. - routine (
routine!
) functions, such asexists?
,write-clipboard
, and so on; you can see a list using? routine!
It is also used in Red to define a function that calls a Red/System function (see Chapter 10, Advanced Red).
- action (
action!
) functions, such ascopy
,move
,clear
,to
,form
, and so on; you can see a complete list using? action!
The native, routine, and action functions are written in Red/System. Action functions are special in that they are polymorphic—they are defined for more than one datatype. Which action code is executed depends on the type of its first argument.
- mezzanine (
function!
) functions, which are higher-level functions written in Red...