@ngn afaik, J only cares about prototypes when it needs to fill, and there are only three fills (0s, spaces, and "aces" which are enclosed 0-length vectors).
@Zacharý from Arthur there's the freely downloadable (32-bit for non-commercial purposes) k4, there's the abandoned k5, and there's the latest and greatest k6
@Zacharý I don't think anyone uses NARS in production. I have no idea about GNU, but I suspect not. APL+ and APL2 are probably still the big two in production "out there", but with more and more coming to Dyalog as IBM has gone silent, and APL2000 only release updates for the sake of releasing updates.
@ngn This is very interesting. So now we have three competing extensions of ⍳ to multi-element arguments. APL does Cartesian coordinate mapping, J does fill of the product, and K does mixed-base counting.
@ngn Whichever one corresponds to 0⍴⊂,0 so I guess 0#,,0N
@ngn No but 3 (4 2 4)⍴ could fill three arrays of the given lengths with the given data. But the 3 is a bit redundant then. (⊂4 2 4)⍴ should be enough.
@ngn Yeah, in K the extension would be natural, and quite neat. I like it.
For Phase II (TotalEnergy) ... it might just be me being tired, but wouldn't the products of two adjacent elements of 5 5⍴¯1 1 always be ¯1, thus the answer be NOT 0 (for the first test case)? Sorry to derail the conversation. Also, ¯1ׯ1 is 1×1, so shouldn't test cases 2 and 3 give the same answer?
room topic changed to The APL Orchard: Learn and teach, questions about both golfing and general coding. For chatbot info, enter: )about [apl] [array-manipulation] [j] [k] [tips]
OK, I need to go to bed. Thank you guys for distracting me from the horrors of the real world.
Roger's latest blog post examines the #Dyalog #APL quicksort implementation and grade function. Read it at https://www.dyalog.com/blog/2018/05/is-it-sorted/
#tio alias message about %handle% You can evaluate a single line of APL by typing it into chat prefixed by ⍞←. Use ⎕← instead for boxed display and multi-line results and use ⋄ instead to silence the first statement. Use ] to call user commands. Do not use markdown, but fixed-width (4 initial spaces) is fine. Commands: )lb for language bar, )help for table of language elements, )docs for full documentation, )ref for PDF reference card, )idioms for idiom list.
@Zacharý
line(1,0) : error AC0505: error (SYNTAX ERROR) executing line "{0::⎕←⊃⎕DM⋄⎕←5 5⍴¯1 1 ⍝Just checking something}(⎕NS⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''←box on -f=on -t=tree''⊣enableSALT⋄⍬'"
^
Complete: 1 error.
DOMAIN ERROR: There were errors processing the script
'#'⎕NS ⎕FIX'file:///home/runner/.bin.tio.dyalog'
∧
Real time: 0.040 s
User time: 0.007 s
Sys. time: 0.017 s
CPU share: 61.04 %
Exit code: 0
@ngn Not for golfing per se (there's the tips) question for that. I was thinking of when you have a problem, and simply don't know how to solve it in APL, though you may know how you would solve it by hand.
@Adám well, remember this? I don't know if ways to convert ISO-Extended-APL code to ISO-APL should be a lesson or a list, but, eh, at least I gave this a try :P
I'd be kinda here for a lesson today. I'm currently multitasking my work on my final project for college and writing a novel, one APL lesson (or funny story, I don't mind) on my secondary monitor couldn't hurt.
@H.PWiz :-) I've been toying with the idea to make a book based on the chat lessons. Something like APL a day — the programmer's introduction to APL in 24 hours
@H.PWiz While English is your first language (I presume), we can always get someone to do a review of the language later. The main thing is the content. And as an active participant in those very lessons, you'd have a nice starting ground.
@H.PWiz Great. Let's have a look at that first thing this summer.
@H.PWiz Not without tricks, but we are thinking about ways to do that. Meanwhile, you can use ]defs to produce the current definition (including the assignment) and then just edit the line and press enter.
@H.PWiz A trick I came up with last week is to use a tradfn in a very not traditional way:
∇ Avg←Avg
Avg←+⌿÷1⌈≢
∇
@H.PWiz This makes a late binding tacit function that you can edit with )ed, save with ]save etc.