The cascade mechanism provides a flexible way to choose between multiple options. Crucially, it is done in a way that makes it simple for plugins to tweak the logic or add their own options.
Some of the things that can be done with cascades are:
There are two parts to these changes. The underpinning is a new Cascade Filter Run Prefix that takes a list of filters and runs them in order, returning the result of the first one to return a value.
The second part is a series of improvements based on this new filter cascade mechanism. Conditional logic that was previously hidden within core templates can now be extended and tweaked much more easily than before.
Choosing the following elements of the core user interface is now handled with cascades:
The cascades can be inspected in $:/ControlPanel under Info -> Advanced -> Cascades.
See Cascades for more information.
The chief advantage is that the LetWidget performs the variable assignments in the same order as they are written, and permits references to earlier assignments. For example, here we swap the values of two variables:
<$let temp=<<foo>> foo=<<bar>> bar=<<temp>>> ... </$let>
focus-editoroperation to WidgetMessage: tm-edit-text-operation