@TessellatingHeckler To switch to the new runtime, all you have to do is prepend the provided functions to the beginning of the constants array (second argument) instead of calling the result of the runtime on them.
End of src/cjs.bqn
-ref ⇐ ∾∾⟜(@+10)¨ E_isdef◶E_proc‿E_redef¨ impl∾<"⟨"∾"⟩"∾˜1↓⥊","⊸∾˘chr
+ref ⇐ ∾∾⟜(@+10)¨ E_isdef◶E_proc‿E_redef¨ impl
Beginning of src/cjs.bqn
+⟨IsArray,Type,Log,GroupLen,GroupOrd,!,+,-,×,÷,⋆⌊,=,≤,≢,⥊,⊑,↕,⌜,`,⊘⟩
And then you can cut the runtime short and run tests.
For example, I'd try cutting it off at the definition of ≠ around line 30 and adding ≠3‿2‿1‿0 or something like that. Then just print the result of that "runtime".
The first actual computation is for identity, which is halfway down in the current runtime. Everything before that should run fine, and then you'll be able to test it freely as long as you never reduce on an empty list.
@TessellatingHeckler That one's correct, so I'm guessing there's an issue between the runtime and output instead of with ≢ itself. It has to be one of the functions in (0<=) instead, I think.
getting an int where it should be a single item array smells of powershell array unrolling; that's why the [current code](https://gist.github.com/HumanEquivalentUnit/5c737af7514274e91deb3ef57e4629d2) has `,$e[0]` inside `$ge` and that was the fix for getting mixed arrays of 21 things vs 42 things. And it has `return ,$s.pop()` in stack case 25. That is the last instruction run
@Marshall is that set by identity ← (0⊑⟨"´: Identity not found"!0˜⟩) {(0⊑𝕨){𝕗=𝕩}◶𝕩‿(1⊑𝕨)}´ ⟨+‿0,-‿0,×‿1,÷‿1,⋆‿1,√‿1,∧‿1,∨‿0,¬‿1,|‿0,⌊‿∞,⌈‿¯∞,<‿0,≤‿1,=‿1,≥‿1,>‿0,≠‿0⟩ and Identity with a capital is the same definition?
@TessellatingHeckler Yes, identity is defined as the result of a reduction so it ends up with a subject role and has to use a lowercase letter. Identifiers are matched case-insensitively.
@Adám is something like {1≥r←≢⍴⍵:⍕⍵ ⋄ ⊃{⍺,((r-1)/⎕UCS 10),⍵}/↓(∇⍤¯1)⍵} useful for APL Cart? It takes a simple array and generates a vector that looks the same in the session, by "collapsing" successive dimensions with newline characters (⎕UCS 10)
Rationale is to be able to turn a simple array into something that can be fed as the 'HTML' argument to ⎕NEW 'HTMLRenderer (⊂('HTML' ...))
Ok, it doesn't really look like the same thing, but for basic usage is pretty helpful IMO.
@ngn I was just about to ask you a really dumb question, but then I decided to give it another go by myself, so I wouldn't have to bother you. I managed to do it alone. And then I decided to bother you either way! Aren't you glad I did it? :P
click on own avatar and then "profile" or "chat profile" (i can't explain what the difference is..), it should be editable. i just pasted the url as text.
Interesting. In playing around with Dyalog I note that [x] binds stronger in GNU APL than Dyalog. So 10 20 30 (⍳10)[2] returns 10 20 30 2 in GNU APL while it returns 30 in Dyalog.
Is there a benefit to the Dyalog way of doing it? I can't think of any case where that would be preferred compared to the GNU APL way.
@EliasMårtenson benefit - you reduce the need of parenthesis to the left of brackets. And it should be rare enough that you want to create a vector with an item of a bracket axis pick
@rak1507 Yeah. The problem is that nor the 0 cells nor the 1 cells are what you want
⊂⍤(2 2∘⍴∘⊃)⍤0⊢⍳2 2 2 2 works with ⍤0 and 2 2∘⍴¨⍤1⊢⍳2 2 2 2 works with ⍤1 (notice the last one is the same you had in the beginning, but with extra steps)
Is there a simple way to generate all 2x2 matrices that consist of numbers from 1-9, have no repeated elements, and don't contain pairs that are the transpose of each other? (For example, it would contain 2 2 ⍴ 2 3 6 9 but not 2 2 ⍴ 2 6 3 9)
@rak1507 I think the simplest way is to generate all 2×2 matrices with elements in 1-9 and then filter them out, but that is not the most efficient way.
@rak1507 Ah, but you started out by saying "Is there a simple way to generate all 2x2 matrices that consist of numbers from 1-9, have no repeated elements, and don't contain pairs that are the transpose of each other" and then your code didn't do that, so I was trying to understand what the extra step was
I also failed to interpret your extra step, wasn't even sure if a b c and d were different matrices, or the digits in the matrix, and then I didn't know if aa was multiplication or juxtaposition XD
@dzaima heh, i changed (2∘⊃>3∘⊃) to (>/2 3⊇), but (2∘⊃>3∘⊃) is actually a bit faster - ~2.2ms avg
@rak1507 well, it is working with a ton of small arrays and executing trains many many times, both being things dzaima/APL can be slightly bettter at than dyalog
@rak1507 i have the backing of the whole jvm, which is, in most cases, pretty much just pure virtual function and small object spam, so it's reasonable it's quite optimized for it
I guess if you're following GNU (and I'm remembering correctly), then operators have higher precedence than stranding, but that only means that the programmer might have to parenthesize the right operand.
once you have parsed strands, you parse operators, from left to right. Each monadic operator gets bound to whatever is on its left, and every dyadic operator gets a left operand of the thing to its left (which, due to the order of parsing might be some other derived monadic or dyadic operator) and the thing on its right (which must be a single "thing") is its right operand