OSDN Git Service

Move pop_list().
authorSimon Forman <sforman@hushmail.com>
Sat, 18 Mar 2023 18:41:16 +0000 (11:41 -0700)
committerSimon Forman <sforman@hushmail.com>
Sat, 18 Mar 2023 18:41:16 +0000 (11:41 -0700)
implementations/uvm-ncc/joy.c

index 61d70e9..c9aa909 100644 (file)
@@ -362,17 +362,37 @@ ht_has(char *str, u32 index, u32 length)
 
 /******************************************************************************/
 
+
+u32
+pop_list(u32 stack)
+{
+       if (!stack) {
+               error = NOT_ENOUGH_VALUES_ON_STACK;
+               return 0;
+       }
+       u32 list = head(stack);
+       if (TYPE_OF(list) != joyList) {
+               error = NOT_A_LIST;
+               return 0;
+       }
+       return list;
+}
+
+
 u32
 push_symbol(char *symbol, u32 stack)
 {
        return cons(JOY_VALUE(joySymbol, ht_insert(symbol)), stack);
 }
+
+
 u32
 push_int(u32 n, u32 stack)
 {
        return cons(JOY_VALUE(joyInt, n), stack);
 }
 
+
 /******************************************************************************/
 
 bool
@@ -557,22 +577,6 @@ joy_eval(char *symbol, u32 stack, u32 expression)
 }
 
 
-u32
-pop_list(u32 stack)
-{
-       if (!stack) {
-               error = NOT_ENOUGH_VALUES_ON_STACK;
-               return 0;
-       }
-       u32 list = head(stack);
-       if (TYPE_OF(list) != joyList) {
-               error = NOT_A_LIST;
-               return 0;
-       }
-       return list;
-}
-
-
 u64
 swaack(u32 stack)
 {