ErrLess, 6 bytes
0m:rM.
A macro.
Explanation
0 { Push a 0 to the stack to identify the macro }
m { Start macro definition }
: { (L a b) -> (L (a b)) }
r { Rotate }
. { Halt (Return) }
M { End macro definition }
You can test it with the following program:
0m
:r.
M
{ Test cases: }
1,2x3x4x5x6x7x8x9xax 3 7
0" # a? { Outputs "(1 2 3 8 5 6 7 4 9 10)" and a newline }
3,8x1x4xaxaxaxax 0 5
0" # a? { Outputs "(10 8 1 4 10 3 10 10)" and a newline }
5,1x4x2x3x 0 4
0" # a? { Outputs "(3 1 4 2 5)" and a newline }
5,6x 0 1
0" # a? { Outputs "(6 5)" and a newline }
2,2x2x 0 1
0" # a? { Outputs "(2 2 2)" and a newline }
.
I haven't written an JS interpreter yet, so there's no TIO-like service for ErrLess yet. It's currently very WIP.