diff --git a/docs/sphinx_docs/_build/html/_modules/joy/library.html b/docs/sphinx_docs/_build/html/_modules/joy/library.html index b0d5920..aa2024e 100644 --- a/docs/sphinx_docs/_build/html/_modules/joy/library.html +++ b/docs/sphinx_docs/_build/html/_modules/joy/library.html @@ -678,7 +678,14 @@
joy.library.concat(stack, expression, dictionary)[source]¶Concatinate the two lists on the top of the stack.
+ [a b c] [d e f] concat
+----------------------------
+ [a b c d e f]
+joy.library.shunt(stack, expression, dictionary)[source]¶Like concat but reverses the top list into the second.
-shunt == [swons] step
+shunt == [swons] step == reverse swap concat
+
+ [a b c] [d e f] shunt
+---------------------------
+ [f e d a b c]
diff --git a/joy/library.py b/joy/library.py
index 3157dc8..081e982 100644
--- a/joy/library.py
+++ b/joy/library.py
@@ -645,7 +645,14 @@ def reverse(S):
@inscribe
@SimpleFunctionWrapper
def concat(S):
- '''Concatinate the two lists on the top of the stack.'''
+ '''Concatinate the two lists on the top of the stack.
+ ::
+
+ [a b c] [d e f] concat
+ ----------------------------
+ [a b c d e f]
+
+'''
(tos, (second, stack)) = S
for term in reversed(list(iter_stack(second))):
tos = term, tos
@@ -658,7 +665,11 @@ def shunt(stack):
'''Like concat but reverses the top list into the second.
::
- shunt == [swons] step
+ shunt == [swons] step == reverse swap concat
+
+ [a b c] [d e f] shunt
+ ---------------------------
+ [f e d a b c]
'''
(tos, (second, stack)) = stack