예제 #1
0
파일: symbol.c 프로젝트: nrhtr/elixr
/* Used for table comparisons. Can't do fully general comparisons because regular
 * tables are used for interning the symbols needed for message sending.
 */
XR sym_num_eq(XR a, XR b)
{
    if (xrIsNum(a)) {
        if (xrIsNum(b)) {
            return (a == b) ? VAL_TRUE : VAL_FALSE;
        }
        return symbol_eq(0, a, b);
    }
    else
        return symbol_eq(0, b, a);
}
예제 #2
0
int find_var(XR locals, XR var)
{
    int found = -1;
    xrListEach(locals, index, item, {
        if (symbol_eq(0, item, var) == VAL_TRUE) {
            found = index;
        }
    });