User:PkmnQ/qoob derivatives
- This is still a work in progress. It may be changed in the future.
This page details some qoob derivatives.
Dequeue (-
)
An additional construct can be defined as follows:
-
Dequeue a value and discard it
With this, the dequeuing aspect of []
becomes less useful, so these variations can be considered:
[]
still dequeues
Any mention of "qoob + -
" should be assumed to refer to this unless specified otherwise.
This variation can be compiled into regular qoob using the following substitutions:
qoob + - |
qoob |
---|---|
0 |
0
|
1 |
10
|
- |
[]
|
[ |
[[]
|
] |
]
|
[]
peeks
Regular qoob is easily compiled into this variation by replacing [...]
with [-...]
.
In the other direction, this variation can be compiled into regular qoob using the following substitutions:
qoob + - variation |
qoob |
---|---|
0 |
100
|
1 |
1010
|
- |
[][]
|
[ |
[]0[[]1010[[]10[1]0]
|
] |
[]0]100[[]10[1]0]
|
This requires dequeuing and re-enqueuing the entire queue every loop iteration. A more efficient compilation may be possible.
Roll (=
) and invert (*
)
Two more constructs can be defined as follows:
=
Dequeue a value from the front of the queue and enqueue the same value at the back*
Dequeue a value from the front of the queue and enqueue the opposite value at the back
This variation can be compiled into regular qoob using the following substitutions:
qoob + = + * |
qoob |
---|---|
0 |
010
|
1 |
100
|
= |
[1]0[1]0
|
* |
[0]1[0]0
|
[ |
[[][]
|
] |
][]
|
0
, *
, []
subset
- This section is still a work in progress. It may be changed in the future.
1
, *
, []
subset
- This section is still a work in progress. It may be changed in the future.
Duplicate (:
)
- This section is still a work in progress. It may be changed in the future.