Expressions
Expressions avoid the problem where inputs of an Operator in the Logic Programmer always need a separate Variable Card. To get started, click on an input slot of an operator. While a slot is selected, you can type a raw value, such as 3 or hello, or directly place an item in the slot when it expects an Item or a Fluid. Right-clicking a slot clears it, and Escape cancels the selection.
While an operator input slot is selected, the list of Operators on the left will only show the operators that produce a value that is acceptable for that slot. Clicking on an operator will put it inside the slot and open it, which allows you to recursively determine the inputs of that new operator. The breadcrumbs on the top allow you to navigate within nested operators in the expression. Double-click on an operator in a slot to open it. All of this allows a single Variable Card to contain a whole expression, such as (2 * 5) + 4.
The arrow button at the top right of the Logic Programmer opens a panel on the right in which you can see a text-based representation of the expression, which you can modify directly.
The + Parameter button below the title adds a Parameter to your expression. You can drag a parameter onto a slot to use it in an operator. While a parameter is selected, you can type to rename it and use the arrows to change its type. Right-click a parameter to remove it. An expression with at least one parameter results in an Operator, which can for example be used directly as a Predicate in Filter, or with Apply, Map and Reduce. For example, (item: Item) => item.nbt().size() > 3 is a Predicate that only accepts items with more than three NBT tags.
For power-users, you can directly type in expressions yourself, or copy-paste them to and from different worlds and players. You can call operators as methods on any value, such as (item: Item) => item.size() > 3. Giving parameters a type makes sure that the right operator is chosen when several share a name. You can also refer to other cards by their ID or label using the #5 syntax. Raw values can be written as "text", 5, 5L, 1.5, true and [1, 2]. More complex values must be written with their type, such as @Item{id: "minecraft:diamond"}.