!TobkTZMOkZJCvcSvwq:matrix.org

APL

528 Members
Discussion about the APL language20 Servers

Load older messages


SenderMessageTime
26 May 2023
@_discord_356107472269869058:t2bot.ioPalaiologos#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
@_discord_356107472269869058:t2bot.ioPalaiologos#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:matrix.orgdzaima so you still have prototypes there 11:57:22
@dzaima:matrix.orgdzaima 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:matrix.orgdzaima can't imagine that being useful like ever; list⍴highrank is already quite useless (unless list is the arguments shape with 1s interspersed and/or some shape prepended, but that's not the case in general here) 12:01:53
@dzaima:matrix.orgdzaima ↑(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
@mlochbaum:matrix.orgMarshall 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
@_discord_356107472269869058:t2bot.ioPalaiologos#5585 i see 12:18:14
@_discord_356107472269869058:t2bot.ioPalaiologos#5585 is ⍬⍷A guaranteed to return 1⍴⍨⍴A? 14:40:53
@loke:dhsdevelopments.comloke
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
@mlochbaum:matrix.orgMarshall 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
@_discord_356107472269869058:t2bot.ioPalaiologos#5585 i wonder how to make 6 6↑4 4⍴⍳16 consistent with this 15:53:27
@_discord_356107472269869058:t2bot.ioPalaiologos#5585 may I add this to the APL wiki? 16:48:48
@_discord_506589628418097152:t2bot.iobear8642#6022 Why useless? Says you can't find matrix in a vector or similar. 17:14:42
@dzaima:matrix.orgdzaima but when would you ever have a need to get that as an answer in code? 17:18:57
@_discord_506589628418097152:t2bot.iobear8642#6022 Don't know but simplifies some if implementation as stop if >⍥≢ 17:22:12
@_discord_506589628418097152:t2bot.iobear8642#6022 * Don't know but simplifies some of the implementation as stop if >⍥≢ 17:22:36
@dzaima:matrix.orgdzaima 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
@_discord_506589628418097152:t2bot.iobear8642#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:matrix.orgdzaima but still, would you want to count how many matrices are in a vector? 17:36:44
@dzaima:matrix.orgdzaima * but still, would you want to count how many certain matrices are in a vector? 17:36:52
@dzaima:matrix.orgdzaima (or, the original case - finding an empty list in a scalar) 17:37:32
@dzaima:matrix.orgdzaima 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
@_discord_506589628418097152:t2bot.iobear8642#6022 Ah, I was thinking you're searching constant in variable data 17:39:31
@_discord_506589628418097152:t2bot.iobear8642#6022 Erroring also feels nastier than just giving zeroes 17:40:46
@dzaima:matrix.orgdzaima 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:matrix.orgdzaima (and having an all-zeroes result make any sense is even more unlikely) 17:42:39
@dzaima:matrix.orgdzaima variable-rank data is already uncommon enough 17:43:23
27 May 2023
@casey20:matrix.orgcasey20 joined the room.08:56:11
28 May 2023
@_discord_651823008347979793:t2bot.ioAdám If you find it useful, then yes. No need to ask first. 03:44:07

There are no newer messages yet.


Back to Room ListRoom Version: 6