@Uriel If you can make it shorter without assignment, sure, go ahead. Unfortunately ⎕ can't go immediately before the { } because ∘.⎕{ } would parse as (∘.⎕){ } instead of ∘.(⎕{ })
@Adám @ngn hey guys, could someone give me a hand here? I'm trying to iterate over a vector while adding to it. I've currently got 2{n←1⋄z←⍵,⍨⍺⍴⍺⋄(≢z)<⊃⌽⍵:z,←⍵,⍨z[n]⍴⍺⋄n+1}5 20. I'd like to recurse (or loop) until ≢z≥20. The ⋄n+1 there is not relevant atm, I was just testing
@J.Sallé that code is wrong, it's supposed to be 2{n←1⋄z←(⊃⍵),⍨⍺⍴⍺⋄(≢z)<⊃⌽⍵:z,←(⊃⍵),⍨z[n]⍴⍺⋄n+1}5 20
@Ven
Rebuilding user command cache... done
Was OFF -trains=box -fns=off
VALUE ERROR
__field_initialize_result_←(⎕NS ⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''box on -fns=on -trains=tree''⊣enableSALT' ⋄ ⎕←+∘1(=∘1{v←⍺ ⍵ ⋄ ⍺⍺ ⍵:v ⋄ ∇ v})0
∧
Real time: 1.275 s
User time: 1.114 s
Sys. time: 0.056 s
CPU share: 91.71 %
Exit code: 0
@Ven
Rebuilding user command cache... done
Was OFF -trains=box -fns=off
VALUE ERROR
__field_initialize_result_←(⎕NS ⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''box on -fns=on -trains=tree''⊣enableSALT' ⋄ ⎕←+∘1(=∘1{v←⍺ ⍵ ⋄ ⍺⍺ v:v ⋄ ⍺(⍺⍺ ∇)v})0
∧
Real time: 1.313 s
User time: 1.166 s
Sys. time: 0.060 s
CPU share: 93.32 %
Exit code: 0
@Ven
Rebuilding user command cache... done
Was OFF -trains=box -fns=off
VALUE ERROR
__field_initialize_result_←(⎕NS ⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''box on -fns=on -trains=tree''⊣enableSALT' ⋄ ⎕←+∘1(=∘1{v←(⍺{⍺⍺ w})⍵ ⋄ ⍺⍺ ⍵:v ⋄ ∇∇ v})0
∧
Real time: 0.955 s
User time: 0.897 s
Sys. time: 0.031 s
CPU share: 97.15 %
Exit code: 0
@Ven
Rebuilding user command cache... done
Was OFF -trains=box -fns=off
VALUE ERROR
__field_initialize_result_←(⎕NS ⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''box on -fns=on -trains=tree''⊣enableSALT' ⋄ ⎕←+∘1(=∘1{v←(⍺{⍺⍺ w})⍵ ⋄ ⍺⍺ ⍵:v ⋄ 1})0
∧
Real time: 0.990 s
User time: 0.905 s
Sys. time: 0.046 s
CPU share: 96.09 %
Exit code: 0
@J.Sallé Well, ⍬=0 will extend the scalar (0) to be paired up with every element of the vector (⍬), i.e. none, so the result is 0⍴something boolean, i.e. 0
@J.Sallé Let's straighten some things out. You have g←(⊃⍺)≡⍬:g, (which could be shortened to g←⍬≡⊃⍺:g,) but the guard only fires if the condition (and therefore g) is true, so you might as well write :1,