From d8263e0527dcaedaaaa0a531d124f57ee0206cf2 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Mon, 20 Feb 2023 08:35:03 -0800 Subject: [PATCH] Move and rename push_thing_onto_expression(). --- implementations/C/joy.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/implementations/C/joy.c b/implementations/C/joy.c index 61f3c6f..9fb3ca1 100644 --- a/implementations/C/joy.c +++ b/implementations/C/joy.c @@ -262,16 +262,6 @@ concat_lists(JoyList a, JoyList b) } -void -push_thing_in_unit_list(JoyTypePtr term, JoyListPtr expression) -{ - JoyList node = newJoyList; - node->head = term; - node->tail = EMPTY_LIST; - push_quote_onto_expression(node, expression); -} - - /* ?- gronk("fn", `[+] step`). @@ -540,6 +530,16 @@ push_quote_onto_expression(JoyList el, JoyListPtr expression) } +void +push_thing_onto_expression(JoyTypePtr term, JoyListPtr expression) +{ + JoyList node = newJoyList; + node->head = term; + node->tail = EMPTY_LIST; + push_quote_onto_expression(node, expression); +} + + JoyTypePtr next_term(JoyListPtr expression) { @@ -778,7 +778,7 @@ dip(JoyListPtr stack, JoyListPtr expression) { JoyList quote = pop_list(stack); JoyList node = pop_any(stack); - push_thing_in_unit_list(node->head, expression); + push_thing_onto_expression(node->head, expression); push_quote_onto_expression(quote, expression); }