-
Notifications
You must be signed in to change notification settings - Fork 5
Opperations applicable to most types
tim-hardcastle edited this page Nov 24, 2025
·
2 revisions
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.
🧿 Pipefish is distributed under the MIT license. Please steal my code and ideas.