Opperations applicable to most types - pf-lang/pipefish GitHub Wiki
The following operators and functions all come as standard for all types except error and func.
- Comparison using
==and!=. - The
typefunction (works withfunc). - The
inoperator (works withfunc). - The
literalfunction. - The
stringfunction.
Let's demonstrate them in the TUI:
The in operator also works for membership of lists, sets, and tuples, as we will discuss when we introduce those types. It is an error to compare elements of different types. "walrus" == 42 gives an error and not false.
All comparison in Pipefish is by-value: structs with identical fields are equal, lists with the same elements in the same order are equal, etc.