txlyre 7 hours ago
parent
commit
f77849196a
1 changed files with 7 additions and 4 deletions
  1. 7 4
      jk.c

+ 7 - 4
jk.c

@@ -1034,7 +1034,7 @@ bool value_equals(value_t *x, value_t *y)
   }
 
   case VERB:
-    return strcmp(x->val.verb->name, x->val.verb->name) == 0;
+    return strcmp(x->val.verb->name, y->val.verb->name) == 0;
 
   case SYMBOL:
     return strcmp(x->val.symbol, y->val.symbol) == 0;
@@ -1334,7 +1334,10 @@ double get_numeric(value_t *v)
   if (v->tag == CHAR)
     return v->val._char;
 
-  return v->val.number;
+  if (v-tag == NUMBER)
+    return v->val.number;
+
+  return NAN;
 }
 
 bool value_is_truthy(value_t *x)
@@ -3060,7 +3063,7 @@ value_t *verb_buckets(interpreter_t *state, verb_t *self, value_t *x,
     return y;
 
   if (y->tag != ARRAY)
-    y = verb_enlist(state, NULL, x);
+    y = verb_enlist(state, NULL, y);
   else if (!y->val.array->data)
     return y;
 
@@ -4670,7 +4673,7 @@ value_t *verb_format(interpreter_t *state, verb_t *self, value_t *x,
                      value_t *y)
 {
   if (y->tag != ARRAY)
-    y = verb_enlist(state, NULL, x);
+    y = verb_enlist(state, NULL, y);
   else if (!y->val.array->data)
     return y;