From 8a0b8da88438bb6e1824643822ca67b71becfc03 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 6 Nov 2013 18:54:46 +0900 Subject: [PATCH] missing pic_eqv_p (when PIC_NAN_BOXING disabled) --- src/value.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/value.c b/src/value.c index 3e979b66..c38252e9 100644 --- a/src/value.c +++ b/src/value.c @@ -249,4 +249,24 @@ pic_eq_p(pic_value x, pic_value y) } } +bool +pic_eqv_p(pic_value x, pic_value y) +{ + if (pic_type(x) != pic_type(y)) + return false; + + switch (pic_type(x)) { + case PIC_TT_NIL: + return true; + case PIC_TT_SYMBOL: + return pic_sym(x) == pic_sym(y); + case PIC_TT_FLOAT: + return pic_float(x) == pic_float(y); + case PIC_TT_INT: + return pic_int(x) == pic_int(y); + default: + return false; + } +} + #endif