diff options
author | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2022-01-22 12:37:48 +0000 |
---|---|---|
committer | Peter Mikkelsen <petermikkelsen10@gmail.com> | 2022-01-22 12:37:48 +0000 |
commit | 26ee5089659da12e3c060edfefd056e2196b4363 (patch) | |
tree | 399784a877bc56b043e150dfb0ca96798c3e9398 /array.c | |
parent | 9dad240ddfbe770ddfc8e1556d77328696a6734c (diff) |
Implement scalar functions via a macro
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -138,6 +138,16 @@ commontype(Array *a, Array *b, Array **aa, Array **bb, int forcefloat) }else if(a->type == AtypeInt && b->type == AtypeFloat){ *aa = inttofloatarray(a); *bb = fnSame(b); + }else if(a->type == AtypeArray && b->type != AtypeArray){ + *aa = fnSame(a); + *bb = allocarray(AtypeArray, 0, 1); + (*bb)->arraydata[0] = b; + incref(b); + }else if(a->type != AtypeArray && b->type == AtypeArray){ + *aa = allocarray(AtypeArray, 0, 1); + (*aa)->arraydata[0] = a; + incref(a); + *bb = fnSame(b); }else return 0; return 1; |