« first day (421 days earlier)      last day (2527 days later) » 

00:00
@Pavel ^ It will be one of my main responsibilities to devise a new array notation for things like that. I'm thinking [1 2 3 ⋄ 4 5 6]. What do you think?
@Adám That looks really nice for 2d arrays. But as you've pointed out, Dyalog supports 15d arrays, so it wouldn't really work for all cases I think.
@Pavel Sure. 2 3 4⍴⍳24 would be [[1 2 3 4 ⋄ 5 6 7 8 ⋄ 9 10 11 12] ⋄ [13 14 15 16 ⋄ 17 1 19 20 ⋄ 21 22 23 24]]. And you can of course use line breaks instead of diamonds:
[[ 1  2  3  4
   5  6  7  8
   9 10 11 12]
 [13 14 15 16
  17 18 19 20
  21 22 23 24]]
Yeah, that doesn't look bad
What about something like [1 2 ⋄ 3 4 ⋄⋄ 5 6 ⋄ 7 8]?
@Pavel No, I want you to be able to insert blank lines with no effect.
@Pavel Compare to:
⍞←10{a←2×⍺ ⋄ ⋄ a-⍵}12
@Adám 8
00:08
@Adám What would a matrix of Matrices look like
@H.PWiz E.g. 2 2⍴⊂2 2⍴⍳4:
@Adám Yes (oh I missed the :)
[[1 2 ⋄ 3 4] [1 2 ⋄ 3 4]
 [1 2 ⋄ 3 4] [1 2 ⋄ 3 4]]
or just [[1 2 ⋄ 3 4] [1 2 ⋄ 3 4] ⋄ [1 2 ⋄ 3 4] [1 2 ⋄ 3 4]].
The diamond disambiguates an array from indexing.
@Adám Does ⋄ have to be interchangable with line break in all contexts?
@Pavel I think it should be. It has until now (with one tiny exception), and I think it should stay that way.
I also want a notation that allows vectors to be defined over multiple lines, so e.g. (1 2 3) (4 5 6) could be written as:
(1 2 3
 4 5 6)
and therefore (1 2 3 ⋄ 4 5 6) too.
Btw, each "segment" would be minimum rank-1, so you can write 1 1⍴42 as [42⋄] and a one-column matrix 3 1⍴⍳3 as:
[1
 2
 3]
or [1 ⋄ 2 ⋄ 3].
00:14
@Adám I had the thought that [[1 2 ⋄ 3 4] ⋄ [5 6 ⋄ 7 8]] could be a "regular" syntax, which does allow linebreaks, and [1 2 ⋄ 3 4 ⋄⋄ 5 6 ⋄ 7 8] be a "shorthand" syntax that does not; that's probably a bad idea in general though.
@Pavel Yeah, too complicated, I think.
Btw, by defining
(A
 B)
as ((A)(B)) we automatically get a notation for multi-line trains!
avg←+⌿÷≢ could be written as
avg←(+⌿   ⍝ sum
     ÷    ⍝ divided by
     ≢ )  ⍝ tally
And atops could literally be written with one part atop of the other:
(-/
 +⌿2 3⌷⍉)
Nope, {(+/⍵)÷≢⍵} for me.
would be the same as (-/(+⌿2 3⌷⍉)).
@Pavel Don't like tacit?
Trains are still too scary
@Pavel Maybe we should do a lesson on trains in depth.
@Pavel I'll be using one really neat train in tomorrow's webinar.
00:21
I finally understand how to read them but I'm still not sure how to make them come together. Especially when you have more than 3 functions being combined into trains of trains, I just get lost.
@Pavel OK, let's aim to do that next week.
Thanks
I'm never sure when to stick a ⊢ or ⊣ in.
@Pavel Tacit doesn't usually refer to the arguments, only the the result of applying a function to them. But if you really just need an argument as-is, you apply an identity function.
Whenever I try to make trains it inevitably looks like a dfn with ⍵⍺ replaced with ⊢⊣ and the braces removed
@Pavel Fair enough, but then you look for things like (⊣f⊢) and replace that with f and (⊢f⊣) becomes f⍨ and (f⊢) becomes ⊢∘f and (f⊣) becomes ⊢∘f⍨.
@Pavel E.g. the function I'll show tomorrow: {i←(⍵⍸⍺) ⋄ (i↑⍵)⍪⍺⍪(i↓⍵)}
So notice how i and are arguments to two functions, and then there is the constant in the middle.
00:37
Yeah
{i←(⍵⍸⍺) ⋄ i((⊣↑⊢)⍪⍺⍪(⊣↓⊢))⍵}
{i←(⍵⍸⍺) ⋄ i(↑⍪⍺⍪↓)⍵}
And since we now only use i once, we can just substitute it in:
{(⍵⍸⍺)(↑⍪⍺⍪↓)⍵}
:O
We could of course sacrifice efficiency by calculating ⍵⍸⍺ twice:
{((⍵⍸⍺)↑⍵)⍪⍺⍪((⍵⍸⍺)↓⍵)}
Now we go tacit:
((⊢⍸⊣)↑⍵)⍪⊣⍪((⊢⍸⊣)↓⊢)
And simplify as per above rules:
(⍸⍨↑⊢)⍪⊣⍪(⍸⍨↓⊢)
And finally, we can remove the unneeded parens:
(⍸⍨↑⊢)⍪⊣⍪⍸⍨↓⊢
But this is only for golfing, as it is inefficient.
On a slightly unrelated note, what does this function actually do?
@Pavel You'll see tomorrow! ;-)
00:44
Well, I won't be able to catch it live (school), but I'll hopefully see the recording later.
@Pavel I would explain it now, but I really need to go to bed. it is 00:45 here. G'nite!
01:16
@Pavel Same, sadly
 
11 hours later…
12:24
@Uriel average experience, i.e. neither having no idea nor boasting tremendous skills :P
13:20
@Adám please do!
@Adám hm, trains are pretty easy, maybe do something like the last lesson (how to use them and such)
@EriktheOutgolfer Apparently quite a few people think trains are pretty hard. That includes several people inside Dyalog, and probably many other APL old-timers too.
@Adám because there were no trains at the "old times"?
@EriktheOutgolfer Yes. I was confused at first too, but somehow I learned it. I think Dan (who made the two videos linked in the chat bot's profile) taught me.
13:47
Trains are indeed pretty hard.
14:22
@EriktheOutgolfer It's easy once you're an expert, or already know Jelly
@Pavel there really are only three types of a train, split into monadic and dyadic, atop, Xgh-fork and fgh-fork
eh, Jelly has a lot more, but in Jelly there are no "trains" exactly like Dyalog's
Isn't it all trains in jelly?
there are links, chains and lines (which are actually called links too), but none of them exactly resembles trains
 
4 hours later…
18:21
@EriktheOutgolfer I thought links were essentially trains (with quicks being operators), but all Jelly trains are atops, so Jelly's fgh is like Dyalog's h(gf).
18:56
@Adám you haven't got a full grasp of Jelly as it seems, you should read the tutorial :) this is only the case for monadic chains, and "f" isn't actually a function but the result of the preceding part of the link (should be referred to as v instead), and g and h in lowercase strongly suggest dyadic functions, while they're really monadic in what you describe...and no, forget about "Jelly trains", they're "chains"
in fact, there are forks in Jelly too, but only at the start of a dyadic chain (the ɗ quick can be used to create a 3-link dyadic chain to force a fork)
the exception is that, in a fork fgh, h must be dyadic (if it's monadic you need to put it as an argument to a { quick to force a fork)
If f is monadic, then, technically, you still don't have a fork, but it does behave like one in practice
if you want to discuss this further, you can ping me @ the Jelly room (ID 32533)
 
1 hour later…
20:16
@Adám In the webinar, what was it that highlighted the idiom? Is that part of the windows IDE, is it publicly available?
@H.PWiz Both the Windows IDE and the cross-platform RIDE have had this functionality for a long time.
@Adám It never happened to me in RIDE, I'll have to look at it later
@H.PWiz Oh, I just had a look at RIDE. It appears I'm mistaken and RIDE doesn't provide it. Sorry.
Not a problem, it does look quite cool though
20:36
tbf I don't know exactly why I claim that I golf in Dyalog Unicode when in fact I'm using Dyalog Classic...
@H.PWiz Yes, it is. I think you should request idiom recognition for RIDE. It bears much more wight if you do it than if I do.
I'll do that
@EriktheOutgolfer Are you really using Classic? Anyway, it doesn't matter, I'd write just "APL (Dyalog)" if it wasn't that TIO auto-generated the posts. Maybe I should ask Dennis to change "Dyalog Unicode" to just Dyalog, as that is the main product, and leave Classic as-is.
@H.PWiz For emphasis, you can write that you saw how cool it was in the webinar.
@Adám I mean the encoding is really handled by Classic though, no?
other than your SBCS
of course I don't have Classic installed on my system
@EriktheOutgolfer No. Unicode uses proper Unicode files and internally stores text as variable-width:
⍞←⎕DR¨'A⍤'
20:49
@Adám 80 160
@EriktheOutgolfer ^ 8 bits for 'A' and 16 bits for .
@Adám yeah, but Classic uses the Classic encoding which I use to count bytes with, unless I have misunderstood something
@EriktheOutgolfer Right, but that is only because you in theory could store it in a classic workspace where it truly is represented in 8 bits per char. But really, everybody URL encodes their solutions for TIO…
@Adám I think that would actually make a difference for e.g. '⍤'
@EriktheOutgolfer Yeah, well, that particular character is not in ⎕AV so classic can't represent it. The whole counting thing is a bit iffy. Really, Dyalog APL tokenises code at fix time, so if I understand correctly, even {(+/∨\' '≠⌽⍵)↑¨↓⍵} is a single byte.
20:55
@Adám Which byte?
@H.PWiz Not sure. There is a secret way to find out, but I never deal with low-level stuff like that.
@Adám wouldn't it be '⍤' in Unicode but '⎕U9060' in Classic though?
@EriktheOutgolfer No, Classic can only load as a token in code, not as a character in text.
@Adám ah, so it will actually error?
@EriktheOutgolfer Yes.
21:03
@Adám how directly the error describes the issue...
remind me to never use those chars in a string when golfing
@EriktheOutgolfer Just use Unicode with SBCS.
@Adám wait, the SBCS translates back to Unicode, not Classic?
@EriktheOutgolfer Yes, lately, we've been making a lot of progress in issuing helpful error messages. In version 17.0, getting a value error tells you the missing name, and the caret position is much more precise.
@EriktheOutgolfer Yes.
@Adám I mean, a whole new TRANSLATION ERROR just for this thing? wow
@EriktheOutgolfer No, it is a new thing, I think Richard's invention: dynamic error messages. Try it online!

« first day (421 days earlier)      last day (2527 days later) »