Glossary
- work limit
The interpreter’s work limit is only an approximate limit. This is because a block can be short enough to not trigger the limiter while outputting more characters than its original body. Additionally, the work limit is referring to the maximum output size before processing is halted.
Example:
Imagine an interpreter with a work limit of 15 characters encountering the following script:
{=(hello):Hello|Hi|Good day|Good morning|Good evening} {hello(4):|} {hello(5):|} {hello(1):|}This entire script is 90 characters long (not counting line breaks). The work limit is 15, so the output should not (massively) exceed 15 characters.
Referenced by:
- zero-depth
For certain inputs, the splitting delimiter must not be contained within a nested block, for example within a variable block that is being retrieved for splitting.
Correct Examples:
The
AnyBlockrequires|inparameterandpayload:{any({my_var}==test|{other_var}):{msg}|{error_msg}}The
AnyBlockrequires|as separators of the conditions and to split the responses. The above example will succeed if{my_var}equals"test"OR if{other_var}contains a truthy expression.On success, the
{msg}block is interpreted and returned.On failure, the
{error_msg}block is interpreted and returned.
The
ListBlockrequires tildes (~) inpayload:{list({index}):{first}~{second}~third~fourth}The
ListBlockrequires list items to be split by tildes (~). The above example will succeed and return the appropriate item, e.g. “third” if{index}is2(remember: theListBlockis 0-indexed) or the interpreted result of{first}if{index}is0.
Incorrect Examples:
AnyBlockwith|not at zero-depth inparameter:{any({conditions}):Success|Failure}This
AnyBlockwill ONLY work as expected if{conditions}is literally “true” or “false” (which are special-cased constants for boolean expressions).For all other situations, it will only return the
Failurereply because{conditions}is not a proper boolean expression.AnyBlockwith|not at zero-depth inpayload:{any({my_var}==test|{other_var}):{outcomes}}This
AnyBlockhas the same conditions as in the Correct Example above, BUT:On success, the entire
{outcomes}block is interpreted and returnedOn failure, nothing is interpreted and an empty string is returned
Note
This MAY be desirable for situations where the failure case should return an empty string. However, it is worth making this intent clear by writing the block like this, with an empty string in the failure case section:
{any({my_var}==test|{other_var}):{outcomes}|}(A better variable name to replace
outcomeswould also be worth considering.)ListBlockwith~not at zero-depth inpayload:{list({index}):{list_of_things}}This
ListBlockwill always return the entire interpreted contents of{list_of_things}because there is no zero-depth~to split the list items.
Referenced by:
Introduction to Nesting Blocks
EmbedBlock(since v1.5.0)CycleBlock(does not have the requirement)ListBlock(does not have the requirement)RandomBlock(does not have the requirement)