Stax 1.1.5
Stax v1.1.5
The web UI has been slightly re-organized.
- Some of the tools have been moved into a drop-down menu.
- There are a few different editor layouts available.
- There's a button to reset the code, input, and all ui state.
New features
- There are several instructions that normally operate on two values, but are no-ops when there's only a single value between both of the runtime stacks. Henceforth, these instructions will move the single value to the main stack if it's on the input stack. Affected instructions are
I
M
S
t
T
+
*
. - New instruction:
|$
compares two values and produces -1, 0, or 1. - New instruction:
|{
compares two arrays for set-wise equality. - New instruction:
|}
compares two arrays for multiset equality. (same elements in any order) - Minimum or maximum of an array via
|m
and|M
produces positive and negative infinity respectively. - New instruction:
%
splits an array at an index and pushes both parts separately. This deprecates:/
. - New instruction:
:@
pops element from array at specified index. It pushes the remaining array and popped element separately. - New instruction:
:$
performs a cartesian product or power. When operating on an array and an integer, it will be the cartesian power. When operating on an array of arrays, it will be the cartesian product of sub-arrays. - New instruction:
:E
gets the first and last element of an array in a 2-array. - Many instructions that iterate over arrays are also able to iterate over implicit ranges
[1..n]
when they encounter an integer instead of an array. In the web implementation now, instead of materializing the entire array, they use a more efficient iterator structure. For example10000000mJ
will start print squares immediately, rather than allocating a 10-million element array first. - When debugging a program in the web interface, partial lines will immediately be visible in output. Formerly output only becamse visible when a newline terminated a line.
Bug fixes
- In the web UI, there were several instructions that internally used deprecated stax instructions. These internal usages were updated to supported instructions.
- Rotating an empty array using
|(
or|)
produces an empty array instead of crashing. |b
for multiset intersection mutated its second value, rather than making a copy first. If that array was copied from elsewhere, it could be incorrectly mutated as well.