return (s2, push_quote(false_body_node, expression), dictionary)
+proc dip(stack: JoyListType, expression: JoyListType, dictionary: JoyMapType): (
+ JoyListType, JoyListType, JoyMapType) =
+ let (body_node, s0) = pop_list_node(stack)
+ let tos_as_list_of_one = s0.head ^^ empty_list.listVal
+ return (
+ s0.tail,
+ push_quote(body_node, push_quote_list(tos_as_list_of_one, expression)),
+ dictionary
+ )
+
+
#[
██████╗ ██████╗ ██████╗ ███████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██║ ██║██╔═══██╗██╔══██╗██╔══██╗██╔════╝
return (push_list((second ++ tos), s1), expression, dictionary)
+proc cons(stack: JoyListType, expression: JoyListType, dictionary: JoyMapType): (
+ JoyListType, JoyListType, JoyMapType) =
+ let (tos, s0) = pop_list(stack)
+ if s0.isEmpty:
+ raise newException(ValueError, "Not enough values on stack.")
+ return (push_list((s0.head ^^ tos), s0.tail), expression, dictionary)
+
# ██╗███╗ ██╗████████╗███████╗██████╗ ██████╗ ██████╗ ███████╗████████╗███████╗██████╗
# ██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗
# ██║██╔██╗ ██║ ██║ █████╗ ██████╔╝██████╔╝██████╔╝█████╗ ██║ █████╗ ██████╔╝
return clear(stack, expression, dictionary)
of "concat":
return concat(stack, expression, dictionary)
+ of "cons":
+ return cons(stack, expression, dictionary)
+ of "dip":
+ return dip(stack, expression, dictionary)
else:
raise newException(UnknownWordError, "Unknown: " & sym)