Baremetal Lisp interpreter and compiler for low-resource devices
修订版 | 83084ed69c65cd33548af86594b3555f5f33c774 (tree) |
---|---|
时间 | 2020-09-13 08:24:04 |
作者 | AlaskanEmily <emily@alas...> |
Commiter | AlaskanEmily |
Fix a silly mistake with type hints
@@ -115,8 +115,11 @@ static void sl_i_defun(struct SL_I_Runtime *rt, | ||
115 | 115 | while(iter != SL_S_NIL){ |
116 | 116 | arg_pair = SL_S_PTR_FROM_TAG(iter->head); |
117 | 117 | atom = SL_S_PTR_FROM_TAG(arg_pair->head); |
118 | - if(SL_I_LIKELY(SL_S_COMPARE_ATOMS(atom, &sl_x_nil))) | |
118 | + if(SL_I_LIKELY(SL_S_IS_NIL(atom) || | |
119 | + SL_S_COMPARE_ATOMS(atom, &sl_x_nil))){ | |
120 | + | |
119 | 121 | goto type_hint_ok; |
122 | + } | |
120 | 123 | /* Validate that we know what this type hint is. */ |
121 | 124 | #define SL_I_TYPE_HINT_CHECK(X) \ |
122 | 125 | if(SL_S_COMPARE_ATOMS(atom, &sl_x_ ## X ## _hint)) \ |
@@ -972,7 +975,7 @@ SL_S_FUNC(void) *SL_I_Call(struct SL_I_Runtime *rt, | ||
972 | 975 | frame.defs[i].name = bind->args[i].name; |
973 | 976 | value = SL_I_Execute(rt, args->head); |
974 | 977 | hint = bind->args[i].hint; |
975 | - if(!SL_S_COMPARE_ATOMS(hint, &sl_x_nil)){ | |
978 | + if(!(SL_S_IS_NIL(hint) || SL_S_COMPARE_ATOMS(hint, &sl_x_nil))){ | |
976 | 979 | /* Validate the type. */ |
977 | 980 | #define SL_I_TYPE_ERROR "Invalid argument type for func " |
978 | 981 | #define SL_I_SET_TYPE_ERROR do{ \ |