handle header […]←rank0 properly
This commit is contained in:
parent
563c30c596
commit
4ab84c05f6
5
src/vm.c
5
src/vm.c
@ -503,7 +503,10 @@ NOINLINE Block* compileAll(B bcq, B objs, B allBlocks, B allBodies, B indices, B
|
||||
FORCE_INLINE bool v_merge(Scope* pscs[], B s, B x, bool upd, bool hdr) {
|
||||
assert(TY(s) == t_arrMerge);
|
||||
B o = c(WrappedObj,s)->obj;
|
||||
if (!isArr(x) || RNK(x)==0) thrF("[…]%c𝕩: 𝕩 cannot have rank 0", upd? U'↩' : U'←');
|
||||
if (!isArr(x) || RNK(x)==0) {
|
||||
if (hdr) return false;
|
||||
else thrF("[…]%c𝕩: 𝕩 cannot have rank 0", upd? U'↩' : U'←');
|
||||
}
|
||||
|
||||
B* op = harr_ptr(o);
|
||||
usz oia = IA(o);
|
||||
|
||||
@ -4,6 +4,10 @@
|
||||
a←"zero"‿"one" ⋄ !a≡a⊸{𝕩?1⊑𝕨;0⊑𝕨}¨0‿1
|
||||
!"No header matched argument" % { 𝕊a‿b: a+b ; d𝕊a‿b‿c: a+b+c} ↕⥊3
|
||||
!"No header matched argument" % {d𝕊a‿b: a+b ; 𝕊a‿b‿c: a+b+c} ↕⥊2
|
||||
{[a,b]: 1; 9} @ %% 9
|
||||
{[a,b]: 1; 9} <4 %% 9
|
||||
{[a,b]: 1; 9} ↕4 %% 9
|
||||
{[a,b]: 1; 9} ↕4‿2 %% 9
|
||||
{𝕊a‿b: a+b ; 𝕊a‿b‿c: a+b+c} ↕⥊2 %% ⟨1⟩
|
||||
{𝕊a‿b: a+b ; 𝕊a‿b‿c: a+b+c} ↕⥊3 %% ⟨3⟩
|
||||
{4=⊑𝕩? "four" ; "idk: "‿𝕩}4+↕3 %% "four"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user