26 May 2023 |
Palaiologos#5585 | so your example prints simply 1 2 3
4 5 6
7 8 9
0 0 0
0 0 0
0 0 0 | 11:55:43 |
Palaiologos#5585 | (this is the general case, there are special cases detected by the interpreter that make this entire process a tad faster) | 11:56:25 |
dzaima | so you still have prototypes there | 11:57:22 |
dzaima | oh, misread that first example; thought it did some weird padding, but no it just completely ignores the original shape beyond for usage in calculating the result shape | 11:59:55 |
dzaima | can't imagine that being useful like ever; list⍴highrank is already quite useless (unless list is the arguments shape with 1 s interspersed and/or some shape prepended, but that's not the case in general here) | 12:01:53 |
dzaima | ↑(3 3⍴⍳9)(1 2 3) being ↑(3 3⍴⍳9)(3 3⍴1 2 3) could be slightly useful, but I still doubt that it'd be more useful than erroring | 12:03:30 |
Marshall | BQN gives an error and doesn't really seem worse off for it. It's inconvenient for formatting when space padding would be useful. Some people might use the padding version for string processing, but this tends to make code that's broken if the input has spaces. | 12:16:55 |
Palaiologos#5585 | i see | 12:18:14 |
Palaiologos#5585 | is ⍬⍷A guaranteed to return 1⍴⍨⍴A ? | 14:40:53 |
loke | In reply to @mlochbaum:matrix.org BQN gives an error and doesn't really seem worse off for it. It's inconvenient for formatting when space padding would be useful. Some people might use the padding version for string processing, but this tends to make code that's broken if the input has spaces. Kap fills with zeroes, but I think the bqn approach is better. | 14:44:36 |
Marshall | ↰ Palaiologos#5585 For rank 1 or more yes, it's a lot like ∧/⍬ . Seems ⍬⍷scalar returns 0 : results are always 0 if the left argument has higher rank, but that's a pretty useless case. | 15:32:40 |
Palaiologos#5585 | i wonder how to make 6 6↑4 4⍴⍳16 consistent with this | 15:53:27 |
Palaiologos#5585 | may I add this to the APL wiki? | 16:48:48 |
bear8642#6022 | Why useless? Says you can't find matrix in a vector or similar. | 17:14:42 |
dzaima | but when would you ever have a need to get that as an answer in code? | 17:18:57 |
bear8642#6022 | Don't know but simplifies some if implementation as stop if >⍥≢ | 17:22:12 |
bear8642#6022 | * Don't know but simplifies some of the implementation as stop if >⍥≢ | 17:22:36 |
dzaima | would be as simple as having it error; and anyway if there isn't any use for it, it is by definition useless | 17:26:10 |
bear8642#6022 | But that might just be sub expression and want to count how many found. Feel an error is less useful than ⍸⍷ giving 0 | 17:35:55 |
dzaima | but still, would you want to count how many matrices are in a vector? | 17:36:44 |
dzaima | * but still, would you want to count how many certain matrices are in a vector? | 17:36:52 |
dzaima | (or, the original case - finding an empty list in a scalar) | 17:37:32 |
dzaima | to me it feels like the much more likely thing is accidentally swapping the args of ⍷ , than actually wanting an always-all-zeroes result | 17:38:39 |
bear8642#6022 | Ah, I was thinking you're searching constant in variable data | 17:39:31 |
bear8642#6022 | Erroring also feels nastier than just giving zeroes | 17:40:46 |
dzaima | ↰ bear8642#6022 I don't see any reason you'd want to search for a constant-rank thing in variable-rank data, where that variable rank is possibly (but not always) smaller than the searched-for thing either | 17:42:10 |
dzaima | (and having an all-zeroes result make any sense is even more unlikely) | 17:42:39 |
dzaima | variable-rank data is already uncommon enough | 17:43:23 |
27 May 2023 |
| casey20 joined the room. | 08:56:11 |
28 May 2023 |
Adám | If you find it useful, then yes. No need to ask first. | 03:44:07 |