WEBVTT
00:00:14.000 --> 00:00:19.280
Welcome to Raycast, episode one hundred and twenty-nine.
00:00:19.600 --> 00:00:25.039
My name is Connor, host of Raycast, and today with us we have two panelists.
00:00:25.359 --> 00:00:27.920
The panel has grown, folks, by 50%.
00:00:28.559 --> 00:00:30.640
I guess we will go around and do brief introductions.
00:00:30.719 --> 00:00:32.960
We'll start with Adam and then we'll finish with Madeline.
00:00:33.359 --> 00:00:35.200
Right, so I'm Adam Butowski.
00:00:35.920 --> 00:00:40.960
I am the head of language design at Dialogue, and I've been doing APL for a long time.
00:00:41.280 --> 00:00:42.399
And over to you, Madeline.
00:00:42.799 --> 00:00:44.159
I'm Madeline Vagani.
00:00:45.119 --> 00:00:47.520
I am the creator of Tiny Apple.
00:00:47.600 --> 00:00:49.359
That's probably how you know me if you do.
00:00:49.600 --> 00:00:52.719
And yeah, I've been doing that for about four years now.
00:00:53.119 --> 00:00:53.520
Awesome.
00:00:53.679 --> 00:00:54.880
We are happy to have you today.
00:00:54.960 --> 00:00:58.320
We mentioned, I think it was uh a couple months ago now.
00:00:58.479 --> 00:01:04.159
I think it was back in June, and technically we're beginning of August, that we were looking to grow the panel.
00:01:04.239 --> 00:01:08.959
And so we are in the phase where we are going to be bringing on guest panelists for the next little while.
00:01:09.040 --> 00:01:13.439
And we are very excited to have Madeline as our first guest panelist.
00:01:13.519 --> 00:01:18.959
And I guess I usually say uh as mentioned before, my name is Connor, host of Raycast, massive fan of all the array languages.
00:01:19.120 --> 00:01:24.239
And with that, uh let me know if my audio is too loud because uh every single time it's too quiet.
00:01:24.319 --> 00:01:26.799
But now I see the mic going super red.
00:01:27.040 --> 00:01:28.959
So uh I might have to adjust this.
00:01:29.040 --> 00:01:35.439
But while I do that, we will throw it over to Adam, who I believe has two announcements for our episode today.
00:01:35.920 --> 00:01:51.120
Yeah, so the first one is at the APL Forge, uh, which is this annual thing that dialogue has going where people can submit projects that they've been uh doing in dialogue APL or for dialogue APL, um has concluded a round.
00:01:51.359 --> 00:01:52.640
Next one has started.
00:01:52.719 --> 00:01:56.400
Um you can always submit ideas, look at forge.dialog.com.
00:01:56.640 --> 00:02:01.120
But the point is here that the winners for this year have been unannounced.
00:02:01.280 --> 00:02:14.800
Um so there is uh there's something that might be known on the podcast here, but uh Carl Krokin with his uh boxing game and our very own Connor Hextra with his array box.
00:02:15.759 --> 00:02:17.360
So that's uh one thing.
00:02:17.520 --> 00:02:20.639
Uh the other thing has a little bit to do with Madeline, or a lot to do with Madeline.
00:02:20.719 --> 00:02:21.919
Oh, yeah, congratulations, Connor.
00:02:22.800 --> 00:02:23.280
Look at that.
00:02:23.360 --> 00:02:24.000
Look at that.
00:02:24.639 --> 00:02:32.879
Um for the audio listeners, there are now uh celebratory things, uh icons floating up over the screen.
00:02:33.039 --> 00:02:34.719
Uh courtesy of Madeline.
00:02:34.960 --> 00:02:36.240
Um it's courtesy of me.
00:02:36.319 --> 00:02:36.879
I'm doing it myself.
00:02:38.639 --> 00:02:39.439
I didn't know what to do.
00:02:39.840 --> 00:02:42.800
I wasn't sure I was gonna be able to get this to work on uh uh Google Meet.
00:02:43.199 --> 00:02:45.520
Okay, my screen is showing up on Madeline's face.
00:02:45.599 --> 00:02:46.159
I don't know why.
00:02:47.439 --> 00:02:48.479
Um right.
00:02:48.639 --> 00:02:51.360
The other thing uh has something to do with Madeline, actually.
00:02:51.439 --> 00:03:15.840
So Madeline's been uh had uh she she got this uh grant from the APL Trust to uh work on the APL 387 fund, and I uh happened to notice that APL64, which is the new offering from the traditional vendor of APL Plus, um it now ships with the very latest version just came out.
00:03:15.919 --> 00:03:19.840
Uh it now ships with APL 387 bundles.
00:03:20.560 --> 00:03:26.560
Um so that's pretty cool that they've sort of picked that up uh without anybody from our side at least the time.
00:03:28.000 --> 00:03:30.000
Like to have them part of the community a little bit.
00:03:30.240 --> 00:03:31.360
Create just a corner.
00:03:31.599 --> 00:03:40.080
Um also ships to APL 387, the next next uh latest version, every new build probably built uh that is cool to see.
00:03:40.400 --> 00:03:40.960
Interesting.
00:03:41.039 --> 00:03:48.319
So it is pervasively uh I try to think actually, too, on my site, the one that won for the contest plug.
00:03:50.000 --> 00:03:59.840
I don't even remember the shortcut, but I know control H is uh is for the help, and then yeah, you do use APL387 as well on the on for the font there.
00:04:00.080 --> 00:04:01.599
I think it changes within the languages.
00:04:01.840 --> 00:04:02.080
Yeah, yeah.
00:04:02.159 --> 00:04:05.280
If you go control B, it shows the fonts per language.
00:04:05.439 --> 00:04:10.719
So 387 is used for APL cap in tiny Apple.
00:04:10.960 --> 00:04:17.439
Uh J uses JetBrain's mono, Wiiwa uses Wii Wa386, and BQN uses BQN386.
00:04:17.600 --> 00:04:19.839
So half of the languages on a ring.
00:04:20.160 --> 00:04:20.720
But it could be more.
00:04:20.800 --> 00:04:24.319
You could you could switch BQN to use APL387 as well.
00:04:24.399 --> 00:04:27.120
It's now it now has full coverage for BQN, I believe.
00:04:27.360 --> 00:04:34.800
And Wiiwa support is in progress, or at least scheduled, planned, uh to happen as well.
00:04:34.959 --> 00:04:39.839
So you could actually go universally AJ, of course, doesn't care because it's just ASCII, of course, it covers Hasky.
00:04:40.079 --> 00:04:40.480
Right, right.
00:04:40.639 --> 00:04:49.360
We're aiming for APL387 to become the universal array or Iversonian array language fund so we can handle every Iversonian array language.
00:04:50.000 --> 00:04:51.040
Awesome.
00:04:51.600 --> 00:05:02.480
Well, uh I'm not sure if there's a link for that, but if there is, Adam will send it to me after the show and I will put it in the YouTube description slash uh show notes on the website arraycast.com.
00:05:02.879 --> 00:05:09.120
And I think with uh those two announcements out of the way, we are going to I don't we didn't actually officially decide.
00:05:09.199 --> 00:05:19.360
Are we doing uh little problem solving today in multiple languages, or are we gonna pivot and then call an audible at the last second live on uh YouTube uh to a different topic?
00:05:19.600 --> 00:05:21.120
What say the panel?
00:05:21.439 --> 00:05:27.839
I mean we can I think we can start with uh little problem solving and see what it takes us with discussions and things.
00:05:28.240 --> 00:05:28.560
Okay.
00:05:29.600 --> 00:05:30.959
We didn't discuss this either, folks.
00:05:31.040 --> 00:05:32.319
This is all happening live.
00:05:32.480 --> 00:05:33.920
Uh who's screen sharing?
00:05:34.000 --> 00:05:34.959
Is it gonna be Adam?
00:05:35.040 --> 00:05:40.000
Although, because Adam's got the laptop with the issues or the computer with the issues.
00:05:40.160 --> 00:05:42.720
Uh is it better if Madeline screen shares?
00:05:42.800 --> 00:05:44.480
What uh what should we do?
00:05:44.879 --> 00:05:47.759
Well let's let's look at the problem before we volunteer.
00:05:48.000 --> 00:05:59.600
Well, uh we can't look if no one screen shares, but I mean technically I can uh drag it over our faces if we want, but I can uh read the problem, although now I don't actually know.
00:05:59.759 --> 00:06:01.600
It's on my left monitor.
00:06:01.759 --> 00:06:25.279
So we're gonna be looking at this week's challenge, which just dropped in the last 12 hours if you're listening to this live, and plus however many hours if you're not listening to it live, and we're gonna skip task one of challenge 385 from Pearl Weekly Challenge and go to task two, which is a twist on a classic APL problem.
00:06:25.360 --> 00:06:29.040
So I will I'll I'll hover it over my whole screen now.
00:06:29.199 --> 00:06:34.959
I'll hover it over my face, and you can see our two other uh beautiful panelists, but not me.
00:06:35.199 --> 00:06:38.160
And it's called outermost parentheses.
00:06:38.399 --> 00:06:52.959
Uh you're given a valid parentheses string and it's asked to write a script to return the string after removing the outermost parentheses of every primitive string in the primitive decomposition of the given string.
00:06:53.120 --> 00:06:58.399
So if you're an audio-on listener, you'll have to pay attention to what is a primitive decomposition.
00:06:58.480 --> 00:07:07.839
But if you're watching this on YouTube, you probably just by looking at the examples, have already uh deduced what a primitive decomposition is.
00:07:08.000 --> 00:07:14.160
But basically, it is for any valid substring of that string.
00:07:14.319 --> 00:07:21.600
Um, well, I guess it has to start left to right, so because you could technically take an inner uh parentheses if you're not starting from left to right.
00:07:21.680 --> 00:07:37.519
But if you start from left to right and each time you can take a substring from that point uh that is a standalone valid set of uh parentheses, then like that's your first component or chunk of your primitive decomposition.
00:07:37.600 --> 00:07:38.879
And then you just recursively do that.
00:07:39.040 --> 00:07:44.079
So for the first example, it's left paren, right paren, left paren, right paren, left paren, right paren.
00:07:44.160 --> 00:07:49.040
So that decomposes into just three sets of left and right parens.
00:07:49.279 --> 00:08:00.480
And so the result of that example is an empty string because if you just have three pairs and you remove the outer parens, you're left with nothing.
00:08:00.720 --> 00:08:04.959
Um and then I don't think we need to go into the other examples.
00:08:05.040 --> 00:08:09.839
Um, but if you're watching on YouTube, there's a couple other example two, three, and four.
00:08:10.160 --> 00:08:16.720
So that is the uh the the sentences are they only consist of parentheses, right?
00:08:16.959 --> 00:08:19.680
Uh yes, it and it's it's guaranteed to be valid.
00:08:19.759 --> 00:08:22.160
You don't need to do a validity check up front.
00:08:22.319 --> 00:08:23.600
Um yeah, okay.
00:08:23.680 --> 00:08:29.360
So that it is actually an interesting problem because this this you can solve in in multiple ways that I can think of.
00:08:29.600 --> 00:08:29.920
Perfect.
00:08:30.160 --> 00:08:30.560
Immediately.
00:08:30.879 --> 00:08:39.679
A little inside baseball, Adam said, huh, you know, it's not too interesting before, because uh everybody knows how to do this because it go it dates all the way back.
00:08:40.159 --> 00:08:44.480
Was it the um notation as a tool of thought?
00:08:44.639 --> 00:08:53.120
Does it come up in this paper, or it comes up in a paper that is like decades old um that Iverson shows the outer product solution?
00:08:53.279 --> 00:08:56.559
Um I can't remember which paper it is, maybe someone in the chat.
00:08:56.720 --> 00:09:00.799
Uh although now I've lost my uh access to the chat.
00:09:00.879 --> 00:09:03.600
But yes, this is what we will be solving.
00:09:04.559 --> 00:09:07.440
That's a classic, classic sort of problem, at least.
00:09:07.519 --> 00:09:20.159
But but there are there are some interesting approaches because we're not interested in the actual level of parentheses, we're only interested in what's re what remains when we remove all those parentheses.
00:09:20.320 --> 00:09:25.840
Um that means we can I can I'll start with a sort of a cheating uh uh uh solution.
00:09:25.919 --> 00:09:27.200
Let me let me share my screen.
00:09:27.440 --> 00:09:31.519
Oh yeah, I just I just thought of a neat trick as well for solving it.
00:09:32.559 --> 00:09:32.960
Yeah.
00:09:33.279 --> 00:09:35.840
That avoids that avoids partitioning.
00:09:36.240 --> 00:09:36.799
Yeah.
00:09:37.039 --> 00:09:39.200
Well then I wonder if that actually works.
00:09:39.279 --> 00:09:41.120
That would be crazy if it works.
00:09:41.440 --> 00:09:54.159
I won't I don't want to spoil it for for the the listener right now, but I'm thinking of well so should we should should one of us um oh here we got the screen share, so we're getting rid of the problem description.
00:09:54.320 --> 00:09:55.519
Actually, here I'll link it.
00:09:55.759 --> 00:09:57.840
We never we never link these uh problem descriptions.
00:09:58.080 --> 00:10:03.600
It's linked in the uh YouTube um live comments, and now Adam is screen sharing.
00:10:03.840 --> 00:10:11.200
And uh let's uh should we do something the classic the classic well actually what is the classic or naive way you would solve this?
00:10:11.440 --> 00:10:13.519
I don't know, maybe there's not even agreement on that.
00:10:13.840 --> 00:10:21.679
No, I think the classic it's not naive, but like the classic thing is to look at the parenthesis level, right?
00:10:21.840 --> 00:10:31.039
And then so every time we have an open parenthesis, we can like increase the level that starts from zero by one, and every time we're closing parentheses, we can we decrease it by one.
00:10:31.200 --> 00:10:40.399
This gives us for every character the ones that are um that are um like the the level that they're at.
00:10:40.639 --> 00:10:45.200
Now I don't remember exactly how it was like there can be there can be other text, right?
00:10:45.279 --> 00:10:46.879
Because we want to return what's there, right?
00:10:46.960 --> 00:10:54.399
With this, we want uh this is yeah, sorry, I'm using an experimental interpreter that's going to give me errors all over the place.
00:10:54.639 --> 00:10:57.120
So um that's going to be fun.
00:10:57.279 --> 00:10:58.320
Uh one second.
00:10:58.720 --> 00:11:00.320
I'll I can do better.
00:11:00.960 --> 00:11:05.360
As you did mention that uh I'm the one that's using the laptop that has issues.
00:11:05.600 --> 00:11:07.279
And APLs that have issues.
00:11:07.519 --> 00:11:07.919
Sorry.
00:11:08.879 --> 00:11:10.320
I should be the reason.
00:11:10.720 --> 00:11:14.080
Uh let's close this one down if I can.
00:11:15.840 --> 00:11:20.399
Well it is crash if it can't close, or just I think it can close.
00:11:20.799 --> 00:11:21.120
Okay.
00:11:21.519 --> 00:11:22.399
Brand new one.
00:11:22.559 --> 00:11:24.879
Ladies and gentlemen, this is where you saw it first.
00:11:24.960 --> 00:11:27.120
This is dialogue version 22.
00:11:28.080 --> 00:11:29.279
Were we on 21?
00:11:29.360 --> 00:11:33.120
You're telling me you're telling me the 22 is gonna have less issues than the 21?
00:11:34.480 --> 00:11:42.799
No, it's just that my installation was well using experimental 21 for something somebody was working on it's not an issue.
00:11:43.120 --> 00:11:43.279
Okay.
00:11:43.600 --> 00:11:47.200
Uh I just wanted to confirm something because you don't have the problem description of Randall.
00:11:47.279 --> 00:11:49.600
So this is this should return ABC, right?
00:11:49.759 --> 00:11:53.360
And even even this should return ABC, if I understand right.
00:11:53.519 --> 00:11:56.080
But it's easier to see what we're doing.
00:11:56.399 --> 00:12:07.279
Um and so we can we can uh we can see what the correspondence is between these numbers, and then we can uh do a subtraction vertically.
00:12:07.840 --> 00:12:28.159
So for each parenthesis that's opening, we're subtracting one minus zero or zero minus one, so it gives us positive negative numbers, so it gives us the change um for and in the parenthesis level, and if we then do a running sum, then we get the parenthesis level.
00:12:28.240 --> 00:12:37.039
Of course, it's it's slightly offset because we say that the opening paren is part of the new inner parenthesis, but the closing parent is not, but we can adjust um for that.
00:12:37.519 --> 00:12:41.519
And so we can see that when we have an opening paren that's a one, we remove it.
00:12:41.679 --> 00:12:45.120
We have a closing parent that's a zero that needs to be removed.
00:12:45.360 --> 00:12:46.480
So this is actually enough.
00:12:46.559 --> 00:12:49.759
We don't even have to uh to do any of the adjustments.
00:12:49.840 --> 00:13:24.480
So we could here say this is our this is uh the depth, and and then we can say and if t is equal to um an open parent, and the depth is equal to uh to one, or parentheses for that here, or if t is a closing parent, and uh the depth is a zero, so this is this is our depth, and this is these are the parentheses that we want to eliminate.
00:13:24.639 --> 00:13:33.679
That means if we negate this uh hitting our buttons, that gives us a mask for the original text.
00:13:33.919 --> 00:13:42.240
Okay, so if we stick that into the mouse, and then we can do the mask and replicate on the text, and that we've got what we want.
00:13:42.559 --> 00:13:43.919
So this is one way we could do it.
00:13:44.320 --> 00:13:53.679
We could also adjust directly these numbers by some rotations so that we get a and a zero in those those positions.
00:13:53.759 --> 00:13:54.720
We can try doing that.
00:13:55.039 --> 00:14:00.159
Um so if we go back for a moment, so let's uh start with this one again.
00:14:00.240 --> 00:14:03.759
We've got D here, which is which is the level.
00:14:04.159 --> 00:14:09.759
Um we can we also have our original masks over here.
00:14:10.240 --> 00:14:24.720
So really what we want is that if there is a uh a one in the bottom and there's a one in the depth, right, or there's a one on top, and that's the opening.
00:14:24.879 --> 00:14:34.240
Right, but this is this means open uh this means opening these two together, and this means closing, and this is the uh this is the depth.
00:14:34.399 --> 00:14:38.559
So here we've got uh open close, open close.
00:14:38.799 --> 00:14:50.159
So if you have a zero over here and we've got a one down here, or if you've got a one up here and a zero down here, right, and the level is one, then those are the ones we want to eliminate.
00:14:50.960 --> 00:14:56.000
So and so we can say if we we can we can match that, right?
00:14:56.080 --> 00:15:13.279
We if we want a function where only one zero on top to the bottom gives one, and only uh we want zero at the top and one at the bottom to give zero, and then we want to eliminate them.
00:15:13.440 --> 00:15:15.759
So we can do some some mathematics here.
00:15:16.000 --> 00:15:23.919
If you want exactly these this one pointed out, uh that's that's where we could just do the top row, it's actually easier.
00:15:24.240 --> 00:15:26.080
So we can just we have the depth.
00:15:26.320 --> 00:15:30.080
Sorry, I'm just sort of moving around here uh between them.
00:15:30.879 --> 00:15:32.720
Do the depth, that's this one.
00:15:33.200 --> 00:15:37.200
Um and we also have the top and the bottom rows from these two.
00:15:37.440 --> 00:15:49.120
So if we split up the comparison into these two, and we say this is opening and this is closing, you stack them on top of each other, that's the same same matrix.
00:15:49.360 --> 00:15:55.759
Now we have them as separate um separate vectors, and it makes it a little bit easier to deal with them in this case.
00:15:56.159 --> 00:16:13.440
Um then if we got opening and the depth equals um one, and that's the same thing as I did before, and then then we can say or we have closing and the depth equals zero or NOR, right?
00:16:13.600 --> 00:16:15.360
Because that's we want the one the mask.
00:16:15.519 --> 00:16:16.000
There we go.
00:16:16.080 --> 00:16:18.320
And then we can take T like that.
00:16:20.399 --> 00:16:24.879
It won't have the same length, but we can put this as a mask, and then we can say mask.
00:16:25.759 --> 00:16:38.559
This is a fairly fairly clean way of of writing it as three segments without having to do a like a new comparison of and we just do this as the minimum number of comparisons that we have.
00:16:39.279 --> 00:16:43.840
Well, surely you don't need to check for closing, so you know, just say negation of the other one.
00:16:44.240 --> 00:16:46.879
What do you mean through that to look for closing?
00:16:47.120 --> 00:16:48.639
Well, C is just not O.
00:16:49.279 --> 00:16:50.080
Yeah, that's true.
00:16:50.480 --> 00:16:50.720
Right.
00:16:50.960 --> 00:16:52.559
This this is a more general one, right?
00:16:52.639 --> 00:16:57.440
This will work even if you have additional text in there, it's like sort of inadvertently that.
00:16:57.519 --> 00:16:58.240
So yeah, you're right.
00:16:58.320 --> 00:17:00.480
We can we can combine them like this.
00:17:00.799 --> 00:17:07.759
Uh which means well, we could we could combine them like this, and which which is the same.
00:17:08.240 --> 00:17:23.839
Um and then we can we have a by the way, a uh uh comment in the chat uh that saying they didn't know you could evaluate inside uh array notation to this degree where you can set it inside and next cells can use their soul.
00:17:24.160 --> 00:17:27.759
So every every value expression inside array notation is just normal APL expressions.
00:17:27.839 --> 00:17:32.240
So whatever side effects happen there, they're they just happen, so you can use them later.
00:17:32.720 --> 00:17:49.200
However, we don't even need to assign O here because we can we can use C over here, and then we can just say because we know it's Boolean, instead of and we can just say that it's less than this less than is actually the same thing as not left and yes right.
00:17:49.599 --> 00:17:51.599
So we don't need to set that.
00:17:52.160 --> 00:17:53.279
Did I make a mistake?
00:17:53.759 --> 00:17:56.720
Uh oh, because the depth, I forgot to set the depth.
00:17:56.960 --> 00:17:57.359
That's right.
00:17:57.440 --> 00:17:58.319
So we do need both.
00:17:58.880 --> 00:18:05.519
I forgot to say that D gets plus backslash uh open minus close.
00:18:08.000 --> 00:18:11.680
So this only prints the openings, not the closings.
00:18:12.240 --> 00:18:17.200
And then uh we can get rid of that for now.
00:18:17.759 --> 00:18:21.440
The depth and mass and results we have over here.
00:18:22.319 --> 00:18:23.839
Can we combine this further?
00:18:25.759 --> 00:18:27.839
Can't really think of a good way to do it.
00:18:28.720 --> 00:18:30.480
Well, what does this look tacitly?
00:18:30.559 --> 00:18:34.480
Because you got one, two, three assignments.
00:18:34.880 --> 00:18:37.680
Yeah, it's not going to be very nice tacitly.
00:18:37.920 --> 00:18:43.200
We c it can obviously be done, but we can try it, but it's not going to be beautiful.
00:18:43.440 --> 00:18:48.160
So so if you want to make it a function, yeah, first let's make make this a proper function.
00:18:48.400 --> 00:18:52.400
So we don't want to return these things, we just want to compute them.
00:18:54.400 --> 00:19:03.359
And okay, so this one is explicit and let's try to make this tested, but it's not as again, it's not going to be nice.
00:19:03.599 --> 00:19:06.160
So we'll start by this mask over here.
00:19:06.720 --> 00:19:21.039
We combine that, and every and then we also eventually we need um oh, we can actually do this as a giant behind because we're going to compute a hu a mask and then we're going to apply it to the original argument.
00:19:21.119 --> 00:19:24.880
So we're going to have some giant function over here, and it's going to be really nasty.
00:19:25.279 --> 00:19:29.440
Um, so let's space this out to help readability just a tiny little bit.
00:19:29.839 --> 00:19:38.240
And for this, we need uh we need to find the two um c and o.
00:19:38.720 --> 00:19:44.079
One of them is going to be uh the original, and the other one is going to be the not.
00:19:44.880 --> 00:19:47.119
And then we're going to subtract them from each other.
00:19:47.359 --> 00:19:53.039
That's over here to get the d, and then we do the um the running sum.
00:19:53.200 --> 00:19:55.680
So now we've we're up to d over here.
00:19:56.079 --> 00:20:06.000
The problem is that we don't just want d and continue computation, we also want back references to to O and C as for the formula over here.
00:20:06.319 --> 00:20:19.279
So we're going to glue these two together and have a function that's between these two, which by the way, this can also be a behind, but we can get back to that because we have a right tag here and a knot over here.
00:20:19.440 --> 00:20:21.440
Um but we'll get to that.
00:20:21.920 --> 00:20:30.400
Um okay, so this is D, and we now have uh this is there's going to be some repetition here, which is not going to be very nice.
00:20:30.960 --> 00:20:37.440
So we want where one equals taking the left part first, and O is on the left, that's the negated one.
00:20:37.599 --> 00:20:41.359
So we want the left argument and one equals D.
00:20:41.759 --> 00:20:45.839
That's so this is the the left side of the NOR over here.
00:20:46.319 --> 00:20:50.640
And the right side of the NOR is going to be exactly the same.
00:20:51.039 --> 00:20:53.200
We might be able to simplify this a little bit.
00:20:53.920 --> 00:20:58.160
Um we're just going to have zero here like that.
00:20:58.400 --> 00:21:00.480
So I think this is all we need.
00:21:00.880 --> 00:21:03.039
If I haven't made any mistakes, we can try it.
00:21:04.079 --> 00:21:07.279
It didn't even work properly because I made some mistake somewhere.
00:21:07.599 --> 00:21:09.759
I think I write that on the second.
00:21:10.319 --> 00:21:10.960
Oh, it's this one.
00:21:11.200 --> 00:21:11.920
Yeah, it should be right.
00:21:12.880 --> 00:21:13.759
There we go.
00:21:14.160 --> 00:21:14.480
Okay.
00:21:15.119 --> 00:21:18.559
But I mean, this you don't want to write this tacitly.
00:21:18.960 --> 00:21:21.039
And we're doing computation twice.
00:21:21.359 --> 00:21:32.480
So we could potentially avoid the computation but computing this twice by merging together these two somehow, but it's not going to be very nice.
00:21:32.799 --> 00:21:43.440
Uh we could eliminate this outer function here by nick by doing something like that would be nice either.
00:21:44.559 --> 00:21:46.079
I think we can read this.
00:21:46.640 --> 00:21:47.039
Nasty.
00:21:47.200 --> 00:21:48.079
Oh, that is nasty.
00:21:48.319 --> 00:21:52.160
We can move the negation in here on both of them.
00:21:52.880 --> 00:21:55.839
And that eliminates the outer thing here.
00:21:56.400 --> 00:21:59.359
What's the chance I'm going to get my parenthesis right at this point?
00:22:00.240 --> 00:22:03.039
Uh okay, don't need this anymore.
00:22:03.119 --> 00:22:04.640
We can just put it inside.
00:22:05.440 --> 00:22:05.759
Okay.
00:22:06.000 --> 00:22:09.839
And then we need to apply this both sides here.
00:22:10.400 --> 00:22:13.920
And the right argument is that one, and the negation is that one.
00:22:14.160 --> 00:22:14.960
This might work.
00:22:15.200 --> 00:22:16.640
Yeah, it still works.
00:22:17.279 --> 00:22:23.039
Oh, I guess I'm doing the symbolic like manipulation in my head at least of the APL code.
00:22:23.279 --> 00:22:25.839
But I wouldn't exactly call this nice.
00:22:26.400 --> 00:22:27.839
Condenses a bit.
00:22:28.240 --> 00:22:29.680
Can you read this gunner?
00:22:30.880 --> 00:22:50.880
Well, the thing that I'm thinking in my head is like, does it because like I have a solution, but it's just the outer product, uh subtraction, column-wise scan, or column-wise reduce, plus scan, and then I just add the uh equals write parent to it.
00:22:51.119 --> 00:22:52.240
Yeah, you can do that as well.
00:22:52.319 --> 00:22:57.440
That's the that's the other part, another approach to that getting the and or go should be.
00:23:04.400 --> 00:23:06.400
Yeah, where either thing goes in here.
00:23:06.720 --> 00:23:07.759
You can do that as well.
00:23:07.920 --> 00:23:09.680
Because we know that it's well formed.
00:23:09.839 --> 00:23:12.240
So so let's let's let's let's try this.
00:23:12.559 --> 00:23:28.559
And and for the listener, D is the result of the plus scan on either the solution that uh Adams built here where you're storing the opening and closing parens and just doing subtraction or the outer product column-wise subtraction.
00:23:28.799 --> 00:23:32.880
Yeah, that's um so if you so we have D already, the depth.
00:23:32.960 --> 00:23:37.039
And if you do a one uh actually it doesn't minus one, I think.
00:23:37.279 --> 00:23:40.160
Minus one rotate, not one rotate here.
00:23:41.119 --> 00:23:43.279
So it's a guy.
00:23:43.359 --> 00:23:48.480
I need to I need to stack T on top so I can we can even put D.
00:23:50.319 --> 00:23:52.400
How do you know what the next thing is going to be?
00:23:52.880 --> 00:23:54.960
If either is a zero, you have to remove it.
00:23:55.119 --> 00:24:00.720
So you just take the minimum or multiplication order of D and the rotate direction.
00:24:02.640 --> 00:24:10.720
Yeah, because uh you have zeros where it's closing, and if you shift them, it's gonna be in the next opening, which it definitely uses to be the next one.
00:24:11.039 --> 00:24:13.119
Oh, because oh, because of the constraints, right.
00:24:13.200 --> 00:24:15.839
Again, I'm thinking that what are the other characters, but it can't be.
00:24:15.920 --> 00:24:21.759
So you know that if we're hitting a zero, the next thing after the zero has to be a one.
00:24:22.160 --> 00:24:23.680
There are no other options.
00:24:23.920 --> 00:24:24.720
That's true.
00:24:24.960 --> 00:24:25.839
That's cute.
00:24:26.000 --> 00:24:36.640
So if there's an if there's a zero in one of these, which actually we can uh we can actually cheat a little bit because we can look at yeah, I mean there are different ways to do it.
00:24:36.720 --> 00:24:38.400
We can compare them with zero, right?
00:24:38.799 --> 00:24:41.200
But we could actually also just multiply them.
00:24:41.519 --> 00:24:45.440
I was thinking of sine of sign and take the sign of that, yeah.
00:24:45.680 --> 00:24:49.119
Um so if you need that's a mathematical approach, right?
00:24:49.200 --> 00:24:57.920
If the if you multiply them, then we get this, and then this then the sign is the mask, and then we can we can filter filter with that.
00:24:58.079 --> 00:25:02.640
So we do and this will turn out nicer in a little bit in tacit at least.
00:25:02.960 --> 00:25:09.200
So if we go so again, minus vertical reduction on open close.
00:25:09.839 --> 00:25:17.519
I mean, even though this outer product is actually not really good because we're doing more comp comparisons we really need to, but okay, fair enough.
00:25:17.680 --> 00:25:18.319
This is D.
00:25:18.720 --> 00:25:22.400
And then we can this we can write in a nice tacit fashion.
00:25:22.559 --> 00:25:27.680
So we can write negative one and then the argument times the rotation.
00:25:28.480 --> 00:25:42.720
You're missing the uh missing the plush, and then we can do the the sign there, so we can take this whole function, but of course it doesn't work well testing, totally test it.
00:25:42.880 --> 00:25:46.400
But if you do it at a D near, then we can write it like this.
00:25:46.559 --> 00:25:47.839
Just that's what I need.
00:25:48.319 --> 00:25:49.039
That's nice.
00:25:49.200 --> 00:25:57.119
I need to go like wait, because we This is only this will not work if there were other characters in there.
00:25:57.200 --> 00:25:58.000
It will only work.
00:25:58.240 --> 00:26:16.079
I know, but why do you need the D I mean I I guess you need the D font because you need to it's because of these monetic functions that uh it would we can totally do it tacitly, but it's just going to be really, really ugly because we need to we need to apply this monetic function.
00:26:16.240 --> 00:26:17.599
So we need to parenthesize.
00:26:17.680 --> 00:26:24.720
We can't bind it with an attack when we don't have not uh nothing either from B to N and J.
00:26:25.119 --> 00:26:25.359
Cap.
00:26:25.680 --> 00:26:26.799
We have to parenthesize it.
00:26:26.960 --> 00:26:29.920
And they use a lot of mutability in my opinion when you do this.
00:26:30.079 --> 00:26:31.839
But yeah, this works.
00:26:33.680 --> 00:26:36.319
I actually I think there are uh what do you say?
00:26:36.480 --> 00:26:43.680
Oh no, it is a couple characters shorter, I was gonna say uh than uh my previous solution.
00:26:44.000 --> 00:26:48.559
That's a neat trick, the rotate uh yeah.
00:26:48.960 --> 00:27:00.319
Seems like this would be uh ideal well, it's hard to tell without actually trying it, but in cap you'd have uh only two trains, so you don't need the parens, and then you also have an outer product glyph.
00:27:00.880 --> 00:27:04.799
Um wait, there's something else I want to try here.
00:27:05.039 --> 00:27:13.279
So we still have to go through the depth, but if we do the depth here, and we can put T on top, right?
00:27:13.599 --> 00:27:15.200
So it's more readable.
00:27:15.759 --> 00:27:20.160
So a one is what we want to get.
00:27:20.319 --> 00:27:23.599
I want to get rid of the ones that are one and open.
00:27:25.119 --> 00:27:26.160
No, I was thinking about that.
00:27:26.240 --> 00:27:29.359
We could look at the at the pattern that we've got.
00:27:29.839 --> 00:27:31.599
This is what we want to eliminate.
00:27:31.839 --> 00:27:32.640
Ah, okay.
00:27:32.799 --> 00:27:34.079
I think I have an idea.
00:27:34.319 --> 00:27:37.359
We can we can look for this pattern of zero, one.
00:27:38.160 --> 00:27:42.799
Those are the ones, the ones that are above a zero, one are the ones we want to eliminate.
00:27:43.359 --> 00:27:46.160
So so let's see, let's say we do it like this.
00:27:46.240 --> 00:27:52.720
I'm going to replace it with a notation inside a uh entire function so we can give a single parameter.
00:27:52.799 --> 00:27:54.799
Let's say we do a one rotate of this.
00:27:56.720 --> 00:27:59.680
Now it's the well, it doesn't really matter.
00:27:59.759 --> 00:28:01.759
Now it's the negative one zero.
00:28:01.839 --> 00:28:06.160
We can also rotate the other way around, and it's going to be the same negative one zero.
00:28:06.799 --> 00:28:13.119
And anywhere we have negative one zero, that's when that's what we want to eliminate.
00:28:13.680 --> 00:28:21.200
So if we look for this pattern, we can also do it after we do the uh do the running sound like this.
00:28:21.359 --> 00:28:35.440
So we can do one here, and now so what happened now when we rotated the first character uh to the end is that that uh we should do that one rotate here as well, otherwise it's hard to understand what's going on.
00:28:35.519 --> 00:28:43.279
So we take the first character move to the end, and that means that we're pairing that one the opening with a closing from here.
00:28:43.440 --> 00:28:47.279
So now what we want to eliminate are the characters that are above the zero one.
00:28:47.519 --> 00:28:52.079
So we've got one here, we've got one here, and we've got one one over here.
00:28:52.640 --> 00:28:59.759
Okay, so um if we we can start by doing it with fine because it's easy to spot what's going on.
00:28:59.920 --> 00:29:03.039
So this gives us a mask where we have we've got zero one.
00:29:03.599 --> 00:29:08.400
And we what we want is the next character after that as well.
00:29:08.880 --> 00:29:11.920
So we can do a a one rotate on that.
00:29:12.559 --> 00:29:14.640
Sorry, did I make a mistake here?
00:29:14.799 --> 00:29:19.200
Oh, yeah.
00:29:19.599 --> 00:29:22.720
That that points at the next character.
00:29:23.839 --> 00:29:25.119
Oh, minus one rotate, sorry.
00:29:25.359 --> 00:29:27.359
Minus one rotate points at the next character.
00:29:27.519 --> 00:29:28.640
So one of those two.
00:29:28.720 --> 00:29:44.960
So if we do if we do combine them again, so we can make this little train, this or the rotate, that those are the characters that we want to eliminate, which means the NOR on that is are the ones we want to keep.
00:29:45.200 --> 00:29:50.799
And it doesn't matter that we rotated the initial character to the end because the initial character will always be eliminated.
00:29:51.039 --> 00:29:52.079
There's no other way.
00:29:52.400 --> 00:30:07.200
So now we can do this whole thing like this, and we have to uh rotate well, it's rotated the step, so we have to rotate, we either rotate the mask or we can rotate the uh the input over here, so like that.
00:30:07.599 --> 00:30:08.400
Is it shorter?
00:30:08.640 --> 00:30:08.880
No.
00:30:09.519 --> 00:30:11.920
Sort of a different way of doing things.
00:30:12.240 --> 00:30:18.720
And this we can we can change this whole thing to use a pairwise um instead.
00:30:19.039 --> 00:30:31.039
So we can say we're looking for looking for looking for that, and then we we rotate it right and left, so we do want to put a zero in front or behind.
00:30:31.759 --> 00:30:36.559
So this is that alright, what I'm doing.
00:30:36.880 --> 00:30:38.799
Oh no, because these are actual numbers.
00:30:38.880 --> 00:30:39.519
Yeah, we can't do that.
00:30:39.680 --> 00:30:41.599
We have to look for the pattern of zero, one.
00:30:42.319 --> 00:30:43.519
It's not a boolean.
00:30:44.960 --> 00:30:46.240
But this works.
00:30:48.960 --> 00:30:52.400
Um I still think that's a better way to do this.
00:30:53.599 --> 00:31:04.559
Well, I posted uh in the chat um uh the cap equivalent of the last solution, which uh is very nice.
00:31:04.720 --> 00:31:06.400
Here I'm I'm blocking your screen now.
00:31:06.480 --> 00:31:08.400
You have to go to the YouTube live stream to see this.
00:31:08.480 --> 00:31:20.480
Uh but uh it's just nice because like I said, it it has the outer product primitive and uh oh and the and the the array with primitive that binds together, yeah.
00:31:20.720 --> 00:31:30.319
Yeah, so but I'm not sure I mean what we're doing here is this thing in cap, I would guess you can write that differently.
00:31:30.640 --> 00:31:31.920
Let me try it.
00:31:32.640 --> 00:31:35.039
I have uh I have it over here.
00:31:35.680 --> 00:31:39.759
I'm not showing my my array box, I don't know exactly what's on the on the stream.
00:31:40.000 --> 00:31:49.119
So because of the way things bind, I would think that we can how is it in cap to write a scalar character, you write like an add sign in front?
00:31:49.279 --> 00:31:50.960
I think yes, yeah, yeah.
00:31:51.279 --> 00:31:58.240
So if we do add open paren equals no, we're not allowed to do that, right?
00:31:58.559 --> 00:32:00.480
I wanted to do something like this.
00:32:01.440 --> 00:32:03.680
But we but it's that's a fork.
00:32:03.920 --> 00:32:10.160
Oh, but you can just do uh like equal to the closing one and then you do like oh and the not, yeah.
00:32:10.400 --> 00:32:13.279
Yeah, not uh before subtract or something like that.
00:32:13.519 --> 00:32:13.839
Right.
00:32:14.000 --> 00:32:23.759
So if we do equal to view this, um and then we do the not subtracted from that.
00:32:24.640 --> 00:32:25.279
Does it work?
00:32:25.440 --> 00:32:27.119
Or it already evaluates, right?
00:32:27.440 --> 00:32:31.039
Uh well no, if you hit enter, that gives the same result, so I guess.
00:32:31.359 --> 00:32:32.000
Yeah, yeah.
00:32:32.880 --> 00:32:36.240
I guess I should put some little confetti every single time you hit enter.
00:32:37.279 --> 00:32:39.440
I see is following what's happening here?
00:32:39.599 --> 00:32:43.440
So we're taking taking the closing paren and comparing with the whole string.
00:32:43.599 --> 00:32:51.680
Then we're taking the negation of that and subtracting the original value, that's what behind does, and then we do the the running sum.
00:32:51.920 --> 00:32:55.200
I think that's nicer than the outer products.
00:32:56.240 --> 00:33:02.160
Uh it is, although I have to say the at is an ISOR.
00:33:02.319 --> 00:33:03.279
Um yeah.
00:33:03.599 --> 00:33:06.960
But other than the VGN's way of writing it like this.
00:33:08.480 --> 00:33:11.119
I mean I do like the I do like the two characters.
00:33:11.200 --> 00:33:16.640
I just like the at is not very uh APL font-ish, you know.
00:33:17.279 --> 00:33:36.319
Or character, no, or symbolically, like it's using the right font, but it doesn't, it doesn't uh although you know you could argue that the a couple of these, like the the fork syntax and cap is a little um um yeah, something oh wait a minute.
00:33:36.640 --> 00:33:46.799
I think I think in BQN uh you don't need to do this at all because or or if if you've got if you one second.
00:33:47.039 --> 00:33:53.759
If you've got uh F and characters, these two are one off from each other, right?
00:33:54.559 --> 00:33:59.680
So you can actually just subtract adjacent characters just and go from there.
00:34:00.079 --> 00:34:05.920
Unfortunately, you don't you don't have uh pairwise uh No, you can't have everything, right?
00:34:06.480 --> 00:34:07.359
Yes, you can.
00:34:07.519 --> 00:34:09.119
You just go straight to Tiny Apple.
00:34:09.360 --> 00:34:11.920
Well, Tiny Apple has has appeared characters as well?
00:34:12.159 --> 00:34:12.639
Yeah, of course.
00:34:13.039 --> 00:34:13.519
Of course.
00:34:14.079 --> 00:34:14.480
Of course.
00:34:14.559 --> 00:34:17.920
And if it's if it's missing something, uh you just switch to it, you know.
00:34:18.079 --> 00:34:19.679
Okay, Matt Medelin, do you want to drive?
00:34:19.760 --> 00:34:21.119
You want to share your screen?
00:34:21.440 --> 00:34:29.840
Um also Marvel Com Coma in the chat says uh they solved this earlier today.
00:34:30.000 --> 00:34:37.440
If you've got uh link and you want to drop it in the chat, uh we can show your Wiwa solutions um if you want.
00:34:37.599 --> 00:34:42.960
You know, it's kind of putting you on the spot, but uh okay.
00:34:43.119 --> 00:34:47.599
So we want this the parabolic subtraction.
00:34:48.480 --> 00:34:48.800
Okay.
00:34:49.519 --> 00:34:53.760
Uh yeah, so this is right.
00:34:54.239 --> 00:34:59.840
Uh you know that it's negative negative one of the ones uh in the area we want to to eliminate.
00:35:00.159 --> 00:35:02.159
Oh, because it's right, so we just do this.
00:35:02.320 --> 00:35:05.920
No, I don't think that's right.
00:35:10.400 --> 00:35:15.199
Yeah, because think about it, the ones we want to eliminate, except at the edges, right?
00:35:15.679 --> 00:35:16.800
We know that we want to drop.
00:35:16.880 --> 00:35:17.840
Oh yeah, we could have done that.
00:35:17.920 --> 00:35:20.639
We could have done like a one drop, negative one drop as well.
00:35:20.800 --> 00:35:23.440
Because you know the person that character must be removed.
00:35:23.599 --> 00:35:30.320
So the ones we want to draw to get rid of are the ones where you got one negative one, right?
00:35:34.320 --> 00:35:34.800
What is this?
00:35:34.960 --> 00:35:43.519
This is it can be that that can exist though, nested in a primitive component, so I don't think that actually works, right?
00:35:43.679 --> 00:35:45.119
I'm pretty sure actually one of the examples.
00:35:45.440 --> 00:35:50.960
Oh yeah, it's no you have to go, yeah, you have to go to the scan, of course.
00:35:51.199 --> 00:35:51.920
Yeah, yeah.
00:35:52.000 --> 00:35:53.599
That's it doesn't help.
00:35:56.000 --> 00:36:02.719
Because we don't really care about the difference between like what do I find characters actually give you?
00:36:02.800 --> 00:36:04.880
Like compare.
00:36:05.360 --> 00:36:05.920
Yeah.
00:36:06.400 --> 00:36:07.920
If you do a scan on that.
00:36:09.920 --> 00:36:11.360
The second one is a sound scan.
00:36:11.920 --> 00:36:12.239
Yeah.
00:36:12.400 --> 00:36:12.639
Yeah.
00:36:14.800 --> 00:36:17.760
No, we still can't tell where what level it's at.
00:36:20.480 --> 00:36:32.239
There might be some way to do this using using the the differences, but well one thing you can certainly do instead of comparisons with the parentheses, you can just subtract 40, right?
00:36:33.360 --> 00:36:38.639
Or subtract the character before and what is 39?
00:36:40.239 --> 00:36:41.039
It's going to be all.
00:36:44.960 --> 00:36:47.440
Yeah, but I don't think it's that much better.
00:36:47.840 --> 00:36:50.239
It's probably clear to just write the comparison.
00:36:50.880 --> 00:36:52.719
No, it's not it's not even shorter.
00:36:57.280 --> 00:37:01.199
I'm sure there's some drag X way to do this with some balance and terrorist thing.
00:37:03.440 --> 00:37:07.920
Probably nothing.
00:37:08.559 --> 00:37:13.840
It seems like there should be a way to do it without the whole depth, but not true.
00:37:14.079 --> 00:37:16.559
Because it gives you a lot of information that you don't need.
00:37:17.920 --> 00:37:18.320
Yeah.
00:37:23.440 --> 00:37:25.760
Should we look at Marblecoma solutions?
00:37:25.840 --> 00:37:31.840
Uh and then see if we're inspired to find a way to avoid the the depth.
00:37:32.079 --> 00:37:33.360
Um I guess.
00:37:35.920 --> 00:37:37.599
What's uh cluster?
00:37:38.239 --> 00:37:40.880
Um they said they created a GitHub discussion.
00:37:40.960 --> 00:37:44.239
I believe that's probably on the Arraycast site.
00:37:44.559 --> 00:37:50.480
I don't know that's where we opened it then, I think I'm gonna Yeah, it does.
00:37:56.239 --> 00:37:56.559
Okay.
00:37:57.360 --> 00:38:01.760
Oh, admittedly, it's not loading on my computer.
00:38:02.000 --> 00:38:08.159
Well, load for you, so yeah, we're on part two.
00:38:12.159 --> 00:38:12.480
Okay.
00:38:14.159 --> 00:38:16.719
Okay, so this is the same thing exactly we had right.
00:38:17.039 --> 00:38:22.320
Yes, they add add open paren and do the do a negation and subtraction.
00:38:22.639 --> 00:38:29.360
It's just choosing which character you do, then doing a what's the plus thing doing the second plus?
00:38:29.760 --> 00:38:30.400
That's a plus scan.
00:38:31.760 --> 00:38:33.840
That's a plus scan, but what's what's the other plus?
00:38:34.239 --> 00:38:36.559
Uh it's adding the original, I think it's Connors.
00:38:36.800 --> 00:38:42.079
It's adding the because this one keeps around the original mask, and then it gets added to the sum scan.
00:38:42.320 --> 00:38:43.599
Yeah, okay.
00:38:44.079 --> 00:38:46.320
And then yeah, you just replicate.
00:38:46.559 --> 00:38:49.679
Yeah, yeah, I think it's like the ones really have some shit.
00:38:50.239 --> 00:38:51.840
I still think that's a better way to do that.
00:38:55.199 --> 00:38:55.679
I don't know.
00:38:56.559 --> 00:38:58.000
Oh, because it's greater than one.
00:38:58.159 --> 00:38:58.719
Why greater?
00:38:59.039 --> 00:38:59.920
Then I've gratitude.
00:39:00.639 --> 00:39:03.440
Oh, oh, because it's yeah, okay, it's the eye mission.
00:39:03.760 --> 00:39:04.239
Right.
00:39:09.840 --> 00:39:20.400
Yeah, Marble Coma in the chat says uh didn't see the start of the uh stream, but uh not surprised that it's the same because it's a pretty natural solution.
00:39:20.639 --> 00:39:39.599
To be honest though, like if if I were not as array-brained as I am now, like the functional way to solve this coming from like Haskelland is to do like a split and then a drop, you know, first, drop last, and then a recombination.
00:39:40.000 --> 00:39:44.079
Um how do you choose what to split on the depth screen?
00:39:44.480 --> 00:39:46.400
Yeah, you'd have to do that as well.
00:39:47.599 --> 00:40:04.880
But like uh Haskell and functional languages, to my knowledge, don't really have uh I mean I I I guess you could do like a filter after a zip with the depth if you wanted to, but like that's not where my functional brain would go to first.
00:40:05.199 --> 00:40:15.199
Like it like especially in Haskell when you have words and unwords, like you're very used to this kind of you know, splitting and recombining pattern.
00:40:15.440 --> 00:40:15.679
I don't know.
00:40:15.760 --> 00:40:20.159
You'd I guess you'd have to ask a I mean actually, Madeline, you're a you're a Haskell programmer.
00:40:20.480 --> 00:40:22.000
I think it would just be a fold.
00:40:22.239 --> 00:40:23.599
You would just do a fold?
00:40:23.840 --> 00:40:24.239
Yeah.
00:40:24.480 --> 00:40:34.320
After zipping with the depth, or I guess you'd just do a just a depth as a state and the result um just add if stuff to you.
00:40:34.719 --> 00:40:35.199
Really?
00:40:35.440 --> 00:40:37.840
That's that's that's and that's your Haskell brain?
00:40:37.920 --> 00:40:39.360
That's not like your array brain.
00:40:40.400 --> 00:40:43.679
Um I have a fun solution then.
00:40:43.920 --> 00:40:46.239
Oh, this is wait, wait, wait, wait.
00:40:46.320 --> 00:40:47.840
Let's let's do this Haskell thing first.
00:40:47.920 --> 00:40:51.519
Uh this is the first time ever for Raycast, episode 129, folks.
00:40:51.760 --> 00:40:56.480
If you're live on YouTube, you know what's happening, but if you're an audio listener, you're confused.
00:40:56.719 --> 00:40:59.119
We are at play.haskell.org.
00:40:59.280 --> 00:41:00.880
Didn't even know it existed, folks.
00:41:01.039 --> 00:41:05.840
Uh back in 2018 slash 19 when I was a Haskell fan.
00:41:06.000 --> 00:41:08.719
Uh I didn't I don't think this existed back then.
00:41:08.880 --> 00:41:10.639
And or if it did, I didn't know about it.
00:41:10.719 --> 00:41:14.159
And so we're watching live coded Haskell.
00:41:14.880 --> 00:41:19.519
We got monads, even though you might not know they're there, they're there, folks.
00:41:20.880 --> 00:41:23.840
And uh monetic functions?
00:41:24.079 --> 00:41:24.480
Nope.
00:41:24.719 --> 00:41:25.440
Well, yeah, yeah.
00:41:25.920 --> 00:41:27.119
Clash of the monads.
00:41:27.199 --> 00:41:29.840
That's what we should do an episode called Clash of the Monads.
00:41:30.079 --> 00:41:36.639
Uh although I guess it's kind of they're very simple on the APL side of things.
00:41:38.960 --> 00:42:03.519
Um thinking is if so we started at that zero, and then so if it's the XLM that is okay, so you have zero and and whatever, um x is and or something, we need to just do the same thing but increment so um like this yeah, so that's great and then zero.
00:42:03.920 --> 00:42:07.360
Um zero is a great, I guess it doesn't really matter.
00:42:07.679 --> 00:43:08.079
Um then if we have um and closing one, then uh one and closing is going to be zero and the same strength, and everything else is uh I think we can hear Adam's one and not come back later with the working association.
00:43:08.400 --> 00:43:09.920
Sure, I can I can share my screen.
00:43:10.000 --> 00:43:17.840
I've come up with a couple of interesting developments over here and experimenting, so we'll be the judge of that.
00:43:20.639 --> 00:43:25.760
Uh maybe not if the screen never shares.
00:43:26.320 --> 00:43:27.360
Uh give it a moment.
00:43:27.519 --> 00:43:28.159
Give it a moment.
00:43:28.320 --> 00:43:31.039
It just um has to hang a little bit here.
00:43:31.280 --> 00:43:34.800
Okay, so a couple of things that I that I started exploring.
00:43:34.960 --> 00:43:37.440
One was let's just yeah, let's look at that first.
00:43:37.599 --> 00:43:41.599
Let's look at the at the depth depth vector that I've been working on.
00:43:41.920 --> 00:43:51.679
Um so we have been doing it, we did it before with like saying like the closing trend and then uh uh not behind minus.
00:43:52.000 --> 00:43:54.079
And uh sorry, get rid of this.
00:43:54.480 --> 00:43:56.880
It's just nice and short.
00:43:57.039 --> 00:44:02.800
Another thing that's nice and symmetrical is if we Like open parent or closed friend doesn't matter.
00:44:02.960 --> 00:44:08.159
So we want so equality that's all the open parents and unequality that's all the closed parameters.
00:44:08.239 --> 00:44:09.760
So we can write that as a nice fork.
00:44:10.000 --> 00:44:12.880
Like that equality minus the unequal unequality.
00:44:12.960 --> 00:44:15.119
I thought that's that's sort of neat.
00:44:15.519 --> 00:44:22.159
Either way, uh once we've we have the depth vector, we can go back to go back to this one.
00:44:22.400 --> 00:44:24.559
Then I did it with uh with petitioning.
00:44:24.639 --> 00:44:26.480
So so here's the depth vector.
00:44:26.800 --> 00:44:42.000
And if we then look at at the pattern here, then we can see if we should we can split every time there's a zero, and then every section and has begins with open and closed band that need to be eliminated.
00:44:42.159 --> 00:44:54.320
We can actually eliminate the closing one by using by exploiting the EPL2 partition function because it starts a new segment whenever uh we increase the value and and it discards anything that has a zero.
00:44:54.400 --> 00:45:02.559
So if we if we switch to um to the magnitude here, then we can see the pieces that we're going to uh to get.
00:45:02.719 --> 00:45:06.320
So now we can use this to partition t.
00:45:06.800 --> 00:45:12.480
So and all we need to do now is drop the first from each one and merge.
00:45:13.519 --> 00:45:15.599
Oh, drop the first from each one.
00:45:15.760 --> 00:45:18.559
Yeah, because that's the opening parameter never got eliminated.
00:45:18.639 --> 00:45:24.639
The closing one got eliminated by the um but the petitioning having hit zero.
00:45:25.360 --> 00:45:33.280
So we can we can write all of this together as a tested function, even if you want, because this is just a behind this whole thing here.
00:45:33.519 --> 00:45:36.559
But there's a lot of monetic functions going on.
00:45:37.039 --> 00:45:39.360
We can write as a DN with here.
00:45:40.079 --> 00:45:42.880
And yeah, so this is a valid function.
00:45:43.199 --> 00:45:47.920
Here's a single monetic function, there's a datic function, an array, and a monetic function.
00:45:48.000 --> 00:45:49.519
So that's uh that that's valid.
00:45:49.679 --> 00:45:50.880
That's the trick.
00:45:51.519 --> 00:45:56.559
Um we can also write this, but there's a lot of lot of monetic function application going on.
00:45:56.639 --> 00:46:07.599
But if we go back to what I did before with the equal minus unequal, that comes out nicely and as a um as a dadic function.
00:46:07.679 --> 00:46:10.239
We still have to do a right check here or bind.
00:46:10.639 --> 00:46:20.639
We can stick the uh plus scan on top of the minus, and the result of the whole thing, we can we can put the sign.
00:46:20.960 --> 00:46:22.400
So this gives us this.
00:46:24.000 --> 00:46:29.280
Now we have a fork in here with a left argument and the right argument.
00:46:29.519 --> 00:46:31.039
So another another fork.
00:46:31.199 --> 00:46:35.840
We can bind the left argument instead, being that that's a derived function.
00:46:36.079 --> 00:46:39.840
This whole thing, a single derived function, not a not a train.
00:46:40.000 --> 00:46:42.239
We don't need parentheses over here either.
00:46:42.480 --> 00:46:51.199
So now we have a fully tested solution that is as short as the hybrid tested explicit one, which I think is the shortest we've got so far in the APR.
00:46:51.440 --> 00:46:52.800
Is it very readable?
00:46:52.960 --> 00:46:56.719
Maybe not, but uh I don't think it works.
00:46:56.880 --> 00:47:14.880
So this is partition diagram by where we have the sign of the equality width open for n minus the unequality open for n, and we've done this some scan of that, then drop the first of each and recombine.
00:47:16.000 --> 00:47:21.599
What are all the different ways now we've spelt the depth vector?
00:47:22.079 --> 00:47:25.360
So it's got outer product, yeah.
00:47:25.519 --> 00:47:28.159
So the outer product one, right?
00:47:28.320 --> 00:47:36.880
So we can say so depth outer is open closeprint jot dot equals the right argument.
00:47:37.360 --> 00:47:52.159
Yeah, we got uh depth separate, we would just say open print minus closeprint, which we can we can make that look nice if we put uh that's nice and palindromic sort of like that.
00:47:52.400 --> 00:47:57.920
Um we have done it with a negation or like a not.
00:47:58.239 --> 00:48:03.199
So we just look at the close print in APL because we only have a one hook operator.
00:48:03.360 --> 00:48:04.719
We use the close printer for that.
00:48:04.960 --> 00:48:08.320
We could actually use the open print and not equal as well, doesn't really matter.
00:48:08.639 --> 00:48:11.360
Not behind minus.
00:48:11.519 --> 00:48:13.519
So this isn't even the whole depth, right?
00:48:13.599 --> 00:48:19.199
This is only getting the um this onto with onto the subtraction.
00:48:19.360 --> 00:48:21.360
So this this is missing, I think.
00:48:21.519 --> 00:48:22.239
There we go.
00:48:22.480 --> 00:48:24.639
Now they're all these are all equivalent here.
00:48:25.920 --> 00:48:26.400
Yeah.
00:48:27.599 --> 00:48:31.920
And um do we have another way to do it?
00:48:32.079 --> 00:48:35.920
Well then you just had your late equal not equal fork.
00:48:36.320 --> 00:48:38.480
Yeah, but it's the same, okay.
00:48:38.639 --> 00:48:39.039
Sure.
00:48:39.119 --> 00:48:45.840
So dfork, if you want, which is open parent equal minus unequal.
00:48:48.079 --> 00:48:49.840
Oh, here's another one we can do.
00:48:50.079 --> 00:48:52.400
Can you do something one minus two times?
00:48:52.559 --> 00:48:53.840
I think that works.
00:48:54.159 --> 00:48:59.920
Uh one minus two times the the right side, you mean?
00:49:00.320 --> 00:49:02.960
One minus two times closing equals.
00:49:04.239 --> 00:49:08.159
Yeah, that's just the mathematical way of expressing the same thing.
00:49:08.320 --> 00:49:09.760
One minus is a knot.
00:49:10.000 --> 00:49:12.239
Oh, right, it's just the same one as the knot, yeah, yeah.
00:49:13.679 --> 00:49:15.840
So but yeah, I mean that's that's valid.
00:49:16.000 --> 00:49:25.199
But I just realized now that everywhere we've been doing open for n, that's sort of not very elegant because we know the first character is an open paren.
00:49:25.519 --> 00:49:29.039
So we can actually write write it in a neater fashion.
00:49:29.119 --> 00:49:35.280
If for example, this one, so let's say we have t, we know that the first character t is open for n.
00:49:35.519 --> 00:49:41.679
So we can write uh first unequal to the whole thing, which is a behind.
00:49:41.920 --> 00:49:44.000
Look at this behind here, right?
00:49:44.320 --> 00:49:47.760
And then we do the not behind minus on that.
00:49:48.239 --> 00:49:49.679
Yeah, that's really nice.
00:49:50.000 --> 00:49:54.000
No constants involved, and it works for all types of brackets now.
00:49:54.960 --> 00:49:58.320
That's nice, and then we do the scan and so on.
00:49:59.039 --> 00:50:00.480
I like that better.
00:50:01.519 --> 00:50:13.599
I really want the last primitive because in this one it would be it'll be nice to do uh first and first equals minus the last equals.
00:50:14.000 --> 00:50:16.800
But of course, we could just write first unequals if you want.
00:50:17.199 --> 00:50:18.800
So this is another way to do it.
00:50:19.920 --> 00:50:23.280
All look sort of symmetrical, but this needs parentheses.
00:50:23.760 --> 00:50:29.199
There are many ways of spelling things because these do too many comparisons.
00:50:29.280 --> 00:50:31.119
This this should be the fastest.
00:50:31.280 --> 00:50:33.199
This or with the constant, it doesn't matter.
00:50:33.360 --> 00:50:37.280
Because a Boolean negation on the mask that's going to be very fast.
00:50:38.800 --> 00:50:40.800
So I think I prefer this.
00:50:41.760 --> 00:50:45.039
So that that's one part of the problem is get to the depth vector.
00:50:45.199 --> 00:50:49.039
So far, we haven't come up with any good solutions that doesn't need the depth vector.
00:50:49.280 --> 00:50:52.000
Um, or any solutions that don't need the depth vector.
00:50:52.320 --> 00:50:53.920
And have the house code when you show it.
00:50:54.239 --> 00:50:55.280
Yeah, you want to show it?
00:50:55.440 --> 00:50:55.840
Yeah.
00:50:56.320 --> 00:51:02.719
I just forgot how types work, but uh okay.
00:51:03.679 --> 00:51:06.159
So yeah, it's just basically a fold.
00:51:06.320 --> 00:51:12.400
You keep around the current depth and the result as a state, and then you just fold over the string.
00:51:12.559 --> 00:51:18.719
And so if it's zero and it's opening, then you want to increase the depth but not add anything to string.
00:51:18.880 --> 00:51:22.960
Um, if it's one and it's closing, you want to decrease it and not do anything.
00:51:23.119 --> 00:51:26.639
Otherwise, you just add and increase and decrease based on what it is.
00:51:26.719 --> 00:51:35.840
Uh then you just pick out the the string and you reverse it because you append it instead of yeah, prepend it instead of appending because it's faster, and then you spread.
00:51:36.079 --> 00:51:38.639
You can probably do with a right folder as well, it's probably better.
00:51:38.800 --> 00:51:41.039
You can just do this, I think.
00:51:41.440 --> 00:51:45.679
Uh you don't need to reverse because you're just bending it up the other way.
00:51:45.920 --> 00:51:47.360
That's better.
00:51:48.480 --> 00:51:52.480
But yeah, it's not a good selection, but I think that is how I would approach it in a screen.
00:51:52.960 --> 00:51:54.320
I think this works as well.
00:51:54.960 --> 00:51:56.320
No, uh, whatever.
00:51:56.400 --> 00:51:59.280
Uh because I have to reverse opening and closing it.
00:52:00.800 --> 00:52:04.880
But uh no, I don't think it would look good in any array language.
00:52:05.199 --> 00:52:07.920
Uh yeah.
00:52:08.559 --> 00:52:12.480
I mean so you could I mean I can try writing some tiny.
00:52:14.159 --> 00:52:22.159
Uh so then I want to make a folding string.
00:52:22.480 --> 00:52:24.239
Let's just make a different thing.
00:52:24.559 --> 00:52:34.000
So I want to check if it's you might not want to do it user fold, you might want to use loop over the order elements instead.
00:52:34.159 --> 00:52:34.960
It's easier.
00:52:35.280 --> 00:52:35.920
What do you mean?
00:52:36.880 --> 00:52:38.639
You're just carrying the state, right?
00:52:38.880 --> 00:52:39.119
Yeah.
00:52:39.519 --> 00:52:41.440
So you can just have a state variable.
00:52:42.079 --> 00:52:42.400
Yeah.
00:52:42.639 --> 00:52:45.599
Well, they don't already have a way to do loop so they don't fold in.
00:52:46.559 --> 00:52:51.519
Um I guess you could use uh an LTL, but that's not gonna look good, I think.
00:52:52.159 --> 00:52:57.039
Uh no, there's no good way to just make a loop.
00:53:03.760 --> 00:53:05.920
Let's bring more lines up on some idea.
00:53:08.400 --> 00:53:24.239
Then if it's one and closing then return zero and if it's um there and so I guess oh I can make it side synchronized.
00:53:24.320 --> 00:53:38.719
I think if just return um the first one plus uh I guess minus one omega's closing.
00:53:39.360 --> 00:53:46.159
Uh and another one is going to be uh omega second one.
00:53:51.440 --> 00:53:59.840
Um I don't know.
00:54:00.000 --> 00:54:02.639
But yeah, and it it's definitely not going to be pretty.
00:54:11.519 --> 00:54:16.159
Yeah, I don't know, but yeah, it's definitely worse than the array once.
00:54:16.559 --> 00:54:19.440
But I think there's a good way to spell the array once in Haskell.
00:54:19.840 --> 00:54:22.960
So I think people usually just make this fold.
00:54:23.440 --> 00:54:27.760
Maybe with a boolean like checking for equality first, maybe I would do that.
00:54:28.000 --> 00:54:29.760
So the function's total.
00:54:30.000 --> 00:54:34.639
But other than that, uh yeah, I don't think there's a better way.
00:54:35.199 --> 00:54:38.480
I'm I'm working on some state machine thing.
00:54:38.960 --> 00:54:48.880
Uh I can show you, but on Disney again, not going to be it's not a APLE, yeah, but it's it's more a general purpose thing you can do.
00:54:49.119 --> 00:54:53.119
Uh see the computer gets around to sharing.
00:54:53.840 --> 00:55:07.360
So so here we set up in an initial state, an initial and a result accumulator, and then we do our just use the fork here when passing in the open paren.
00:55:08.159 --> 00:55:09.920
And this is the the whole array.
00:55:10.000 --> 00:55:12.480
So this each is actually looping over the left argument.
00:55:12.960 --> 00:55:13.199
All right.
00:55:13.840 --> 00:55:16.400
Um and just passing that in.
00:55:16.639 --> 00:55:28.000
So if we so if the equal minus minus unequal, that's the what we what we did before, and and then we're testing the state.
00:55:28.079 --> 00:55:42.719
So if if the state is zero, um again, if the current state and the current character is zero and open paren, then uh we want to eliminate it.
00:55:43.280 --> 00:55:48.000
So which means if they so this is eliminate, we're just gonna write that for now.
00:55:48.239 --> 00:55:54.239
And the other case is if the state, oh, it's not you, it's one here.
00:55:54.639 --> 00:56:02.159
And if the state and the left argument is a zero and a closing paren, that's where we should write this out.
00:56:02.639 --> 00:56:04.880
It's going to be selected like this.
00:56:08.159 --> 00:56:17.840
Okay, so if the state and the um and the current character that is one and open paren, we want to eliminate it.
00:56:18.000 --> 00:56:27.039
If the state is um and the current character is a zero and a closing paren, we want to eliminate it.
00:56:27.199 --> 00:56:34.880
So now we can say if this is a member of one of these two, then we want to eliminate it.
00:56:35.280 --> 00:56:41.360
Which means we can take this and we can especially use it behind there, just for good order.
00:56:41.599 --> 00:56:48.880
Which means if one of those are true, we want to drop from the current character that we're dealing with.
00:56:49.360 --> 00:56:56.000
And I think we don't even need to, we don't even need to update an accumulator there because this just gives the budget.
00:56:56.239 --> 00:56:57.440
There's empty vectors and nuts.
00:56:57.599 --> 00:56:59.519
Now we just enlist that.
00:56:59.599 --> 00:57:00.960
So that works.
00:57:01.199 --> 00:57:12.079
I suppose that's sort of philosophically sticking the same thing that you're doing in NASCAR, even though here I'm carrying it an outer state, so muting this, but yeah.
00:57:12.320 --> 00:57:14.480
So I suppose we could do this.
00:57:15.119 --> 00:57:17.760
Uh yeah, we could do this as a reduction.
00:57:18.079 --> 00:57:22.639
It's going to be the same thing, but it's just going to be more complicated to keep track of things.
00:57:22.880 --> 00:57:24.800
Also, this is completely unreadable.
00:57:24.960 --> 00:57:28.719
But actually, we can we can state some logic, right?
00:57:28.800 --> 00:57:38.800
If it's yeah, if it's a one and open paren, a zero and close paren, that's the same thing as saying that it's equal to the open paren, right?
00:57:39.039 --> 00:57:41.280
No, because it's not a movie.
00:57:42.400 --> 00:57:42.880
Yeah.
00:57:43.280 --> 00:57:50.639
We could we could separate this out and say if uh if d is less than or equal to to one.
00:57:51.280 --> 00:57:57.280
You could probably do the index of d in one zero is equal to the index of omega in open close.
00:57:57.519 --> 00:58:00.400
No, because that no, I think that's good.
00:58:00.639 --> 00:58:02.079
Oh, but we could say this, right?
00:58:02.239 --> 00:58:07.199
It's we can we only want to eliminate it if d is less than or equal to zero.
00:58:07.519 --> 00:58:07.920
Yeah.
00:58:08.159 --> 00:58:11.199
And we also want to eliminate it.
00:58:11.280 --> 00:58:17.599
The other criteria is that yeah, we can that doesn't really work, right?
00:58:18.079 --> 00:58:18.639
Oh, right.
00:58:18.719 --> 00:58:22.559
The other criteria is that b equals this is fun.
00:58:22.800 --> 00:58:24.639
Omega equals open brand.
00:58:26.960 --> 00:58:27.360
That's fun.
00:58:29.119 --> 00:58:36.800
You don't need the less than or equal to one, because then it's definitely going to be false if because these are yeah, if d is true right, then it can't be true, right?
00:58:36.960 --> 00:58:37.440
Yeah, exactly.
00:58:37.599 --> 00:58:38.639
So so it has to be.
00:58:38.719 --> 00:58:39.679
That's the only case.
00:58:39.920 --> 00:58:40.800
So there we go.
00:58:40.960 --> 00:58:41.679
That's nice.
00:58:41.840 --> 00:58:45.280
Which means there's only one there's only one D left.
00:58:45.599 --> 00:58:47.760
Uh yeah, well, we have that.
00:58:47.840 --> 00:58:48.320
Yeah.
00:58:48.639 --> 00:58:49.360
That's nice.
00:58:49.519 --> 00:58:51.360
We could do an something very unusual.
00:58:51.440 --> 00:58:52.960
We could do an equal reduction.
00:58:53.599 --> 00:58:56.079
That doesn't it's not shorter, but it's cute.
00:58:57.119 --> 00:59:01.039
And this one we can go back to what we had before.
00:59:02.559 --> 00:59:03.199
Shorter.
00:59:03.519 --> 00:59:04.880
Oh, did we make a mistake?
00:59:05.119 --> 00:59:06.559
Has to be a closing card, yeah.
00:59:06.960 --> 00:59:08.079
Or unequal.
00:59:08.320 --> 00:59:12.239
Yeah, or you put the negation on the other side, but then you need the self.
00:59:13.119 --> 00:59:14.639
Yeah, self reading dialogue.
00:59:14.800 --> 00:59:15.119
Yeah.
00:59:15.280 --> 00:59:17.440
Yeah, so this is this is a real state machine.
00:59:17.760 --> 00:59:19.039
This is the state, the depth.
00:59:19.119 --> 00:59:25.840
We're updating the depth as we as we go along using our one of our many methods of of doing this.
00:59:26.079 --> 00:59:28.880
Um, and then you know we do it.
00:59:28.960 --> 00:59:32.239
But I mean, this drop thing is a bit of a a bit cheating.
00:59:32.400 --> 00:59:40.079
Like really, what we should do here is we should say um we should collect instead.
00:59:40.320 --> 00:59:47.119
Either we can have an accumulator, so we'll put that in here, and then we say r, comma, gets that.
00:59:47.280 --> 00:59:56.480
Then we don't need to do the the in list, that's a more general solution, or we can uh get the mask out.
00:59:56.719 --> 01:00:05.280
I mean so we just we just want to find out what what the mask is here, so and add to the mask.
01:00:05.599 --> 01:00:07.199
These are the ones we want.
01:00:07.280 --> 01:00:08.400
This is the opposite, right?
01:00:08.559 --> 01:00:10.400
Because of the quality here.
01:00:10.559 --> 01:00:11.760
Um that's fine.
01:00:11.920 --> 01:00:15.519
We could flip the nut, or we can do some clever things here.
01:00:15.599 --> 01:00:17.760
So I think we have to do like this.
01:00:17.920 --> 01:00:18.719
There you go.
01:00:18.960 --> 01:00:20.639
And now we can use the mask.
01:00:21.920 --> 01:00:27.360
That's a state and um accumulator.
01:00:27.920 --> 01:00:35.760
Yeah, I mean you don't really need um we just return the boolean from the eek.
01:00:36.159 --> 01:00:36.800
Oh yeah.
01:00:37.199 --> 01:00:38.480
Of course, we have that here.
01:00:38.719 --> 01:00:39.920
Of course, send me.
01:00:40.320 --> 01:00:43.920
So this gives us the Boolean, and we could just do that.
01:00:44.400 --> 01:00:46.880
We don't need to satisfy them at all.
01:00:47.840 --> 01:00:50.239
Which means we can do it behind.
01:00:55.840 --> 01:00:59.280
Yeah, I mean it's not good, but it's neat, I guess.
01:00:59.519 --> 01:01:02.000
Yeah, yeah, it's going to have horrible performance.
01:01:02.320 --> 01:01:09.920
Now I'm thinking now I'm thinking instead of initializing D like this and having like nested, what if we can we do this?
01:01:10.079 --> 01:01:11.760
Can we store a state?
01:01:12.239 --> 01:01:20.559
We start start with a state of zero and we use a function that lives inside here, and we update D as we go along.
01:01:21.360 --> 01:01:22.159
That works.
01:01:22.400 --> 01:01:23.039
Yeah, sure.
01:01:23.280 --> 01:01:26.719
But you can only use the function once, and you have to reset it.
01:01:27.199 --> 01:01:28.000
Oh right.
01:01:28.559 --> 01:01:30.880
Well, no, it can't be zero at the end, is it not?
01:01:31.039 --> 01:01:32.559
If the string is valid.
01:01:33.039 --> 01:01:36.239
Oh uh yeah, we live yeah, you're right.
01:01:36.400 --> 01:01:37.920
Uh it happens to be that it works.
01:01:38.000 --> 01:01:39.840
Yeah, so we can actually use this.
01:01:40.719 --> 01:01:43.760
Yeah, you can say it resets itself when it's done.
01:01:43.920 --> 01:01:45.519
Very nice of it to do that.
01:01:45.760 --> 01:01:47.519
Carla, you're following what how this works?
01:01:47.599 --> 01:01:50.400
This is using lots of interesting features, you would say.
01:01:51.280 --> 01:01:52.079
Uh not really.
01:01:52.239 --> 01:01:52.719
Go ahead.
01:01:52.800 --> 01:01:55.840
And uh we lost Carlos.
01:01:56.239 --> 01:01:59.679
Okay, so so this is a behind, right?
01:01:59.840 --> 01:02:11.599
Where we uh this is a classic or oft-repeated pattern by me, where we are have a function that is in that computes a mask, and then we're using that to filter.
01:02:11.760 --> 01:02:14.079
So filtered by this function.
01:02:14.320 --> 01:02:22.400
Now, this function, which is here, uh well, actually the whole function is here, but we're going to apply it to each character.
01:02:22.639 --> 01:02:29.280
And the function lives inside a namespace that at definition time had a single member D that is zero.
01:02:29.440 --> 01:02:30.960
So it's an object, right?
01:02:31.199 --> 01:02:31.840
A state.
01:02:32.000 --> 01:02:35.440
But this object, this state is not observable outside of f.
01:02:35.519 --> 01:02:41.840
There's no way to access it whatever, other than like doing a memory dump, something like that, looking at what's in memory of the computer.
01:02:42.079 --> 01:02:45.599
So this function operates inside this namespace.
01:02:45.760 --> 01:02:50.960
So when it refers to D, it's the D that's inside this namespace, and it mutates that.
01:02:51.280 --> 01:02:55.360
So we're using our formula from before to update the state.
01:02:55.440 --> 01:03:05.840
This is the same, this effectively for every character gives us the the running sum of uh the subtraction of the auto product and that we did before.
01:03:06.000 --> 01:03:09.599
But we only entered it for every character in the state at that point.
01:03:09.840 --> 01:03:17.440
So we we update the state for this character, and then we do this little bit of clever thing here.
01:03:17.519 --> 01:03:19.679
Uh we I can expand this again.
01:03:20.079 --> 01:03:23.280
D is different from this equals this.
01:03:23.840 --> 01:03:29.119
Right, then we say this is the current character an open paren.
01:03:30.480 --> 01:03:37.199
Then we want to keep it only if the current state, so that's a one, only if the current state is not a one.
01:03:38.159 --> 01:03:40.800
A one with an open parent, that's what we want to eliminate.
01:03:41.039 --> 01:03:55.199
And if it's this highlighted part here, if the right argument, the current character is a closed parent, like this gives zero, then we only want to keep it uh if the current state is not zero.
01:03:55.280 --> 01:04:02.079
Because if you have a closed parent at state zero, that's zero, then that's what we that's an outer one, and we want to eliminate that.
01:04:02.159 --> 01:04:07.039
So this gives us a Boolean mask for every character, whether or not we want to keep that.
01:04:07.679 --> 01:04:23.119
And as Madeline correctly pointed out, where we know that everything is well balanced in a string, which means that when we reach the very last character, which will be a closing parent, and will be eliminated, and then the state, the depth state is back to zero.
01:04:23.280 --> 01:04:32.159
Because we always increase the depth nesting depth and go back again to zero scheme, which means that the function is ready for the next invocation.
01:04:32.480 --> 01:04:40.800
Now, if you run two of these in parallel, then they might get might get mixed up because they have the same state.
01:04:40.960 --> 01:04:43.920
Uh I'm not sure if we can induce that, but maybe.
01:04:44.639 --> 01:04:45.360
I think so.
01:04:45.599 --> 01:04:48.000
I think we can actually force that to happen.
01:04:48.159 --> 01:04:52.320
So if you do like T and we'll make another one.
01:04:54.639 --> 01:05:03.840
T2, like this, and then we can do if you run F in the background on T, that should print.
01:05:03.920 --> 01:05:06.800
Yeah, and F in the background of T2, that's fine.
01:05:06.880 --> 01:05:13.679
So if you run it on both, oh sorry, I'm gonna call it that still works because it does the whole run.
01:05:13.920 --> 01:05:22.480
But if we redefine this to insert a delay of like a tenth of a second or something, then they could possibly get out of sync.
01:05:22.880 --> 01:05:24.000
I think, yeah.
01:05:24.239 --> 01:05:30.320
Now we get a messed up result because they they stump on each other's state, statefulness is bad.
01:05:31.679 --> 01:05:37.119
This reminds me of the quote just because you can doesn't mean you should.
01:05:37.440 --> 01:05:37.760
No.
01:05:39.360 --> 01:05:39.760
Absolutely.
01:05:40.400 --> 01:05:43.360
This is not how you're supposed to do it in an array language.
01:05:44.159 --> 01:05:51.039
But there are things that are not easily done within just by computing vectors and going on.
01:05:51.119 --> 01:05:53.920
Sometimes you do need to compute a state as you go along.
01:05:54.000 --> 01:05:55.519
And then this is sort of a general method.
01:05:55.840 --> 01:05:59.760
I'm not sure you should do it with a namespace, but what we did before, when we set it up.
01:06:08.480 --> 01:06:10.559
This is a general way to do it in every language.
01:06:13.199 --> 01:06:17.599
It does require mutating things at least in a global variable.
01:06:22.480 --> 01:06:26.719
Alright, last thing while we wind down, you should take a look at the caps.
01:06:26.800 --> 01:06:34.480
I converted your APLs dialog APL solution to a cap solution using the using three different behinds.
01:06:34.639 --> 01:06:38.559
Uh the links in the bottom of the YouTube chat.
01:06:38.960 --> 01:06:41.920
That's uh this one coming up over here.
01:06:42.960 --> 01:06:44.000
Oh look at that.
01:06:44.320 --> 01:06:45.199
Emoji rendering.
01:06:46.719 --> 01:06:47.280
What?
01:06:47.599 --> 01:06:48.639
That's the old one, I think.
01:06:48.800 --> 01:06:49.360
That's the old one.
01:06:50.239 --> 01:06:50.880
There's a new one?
01:06:51.119 --> 01:06:51.920
There's a new one.
01:06:52.239 --> 01:06:55.119
Oh looks the chat did not date for me.
01:06:56.159 --> 01:07:02.239
Maybe I haven't been seeing people's comments and things, because I don't see I don't see anything since you wrote the cap is very beautiful.
01:07:02.480 --> 01:07:08.239
Uh here, let me I can message and mess up our live stream the chat, and then you can click on it there.
01:07:08.559 --> 01:07:09.440
Or you can just share.
01:07:10.000 --> 01:07:15.280
Uh I could, but that would risk it's coming.
01:07:15.360 --> 01:07:15.920
It's on the way.
01:07:16.159 --> 01:07:17.280
It's in cyberspace.
01:07:17.519 --> 01:07:18.639
No messages yet.
01:07:20.719 --> 01:07:21.440
Oh yeah.
01:07:21.679 --> 01:07:26.800
I was gonna say I guess I could've just read to you the four character hash code.
01:07:27.599 --> 01:07:28.239
Yes.
01:07:28.800 --> 01:07:30.159
But so this is the one?
01:07:30.480 --> 01:07:30.719
Yeah.
01:07:30.880 --> 01:07:38.800
Well it hasn't it hasn't updated because there's something about the URLs, because it looks like an ID, uh it tries to jump to that heading.
01:07:38.880 --> 01:07:41.519
So I think I have to put it like a new window for it to work.
01:07:41.679 --> 01:07:44.559
That might be a deficiency in the design of a RainBox.
01:07:45.119 --> 01:07:46.639
Is that really how it works?
01:07:47.039 --> 01:07:54.960
Because you're using a hash there instead of just using a slash or some other character, and you're using it to read, then you can't switch it when you're on already on the page.
01:07:55.119 --> 01:07:58.880
The browser thinks, oh, you just want to jump to a different location in the same document.
01:08:00.079 --> 01:08:04.639
Wow, that emoji rendering is so aggressive compared to my emoji rendering.
01:08:04.880 --> 01:08:07.760
Mine's very I think mine's the iPhone soft.
01:08:07.920 --> 01:08:09.360
Yours is like the Microsoft software.
01:08:09.840 --> 01:08:12.480
Depends on the operating system and the browser and so on.
01:08:12.719 --> 01:08:24.640
Well here actually, I this is the beauty of uh I can I can drag and drop my little thing so people that's that's my emoji, which is m much cuter than uh the Microsoft 3D one.
01:08:24.800 --> 01:08:28.720
Anyways, this is the You just need to add the emojis to 37, I think.
01:08:29.119 --> 01:08:29.520
Sorry?
01:08:30.239 --> 01:08:32.479
We just have to add the mojis to APL37.
01:08:32.800 --> 01:08:33.600
Yeah, yeah.
01:08:33.840 --> 01:08:36.399
Well, we do do we agree on which rendering though?
01:08:36.479 --> 01:08:44.239
It's probably uh No, then the what we just compose them all with little bases.
01:08:45.039 --> 01:08:48.720
If if it was then they should be like line line drawing art.
01:08:50.399 --> 01:09:08.800
Honestly, it's obviously you were joking when you you said that, but there's actually something uh behind using uh APL glyphs to render, like you know, you got a f four different glyphs to render uh the different you know, you can do all of them to be too much work, but you could do a few.
01:09:09.119 --> 01:09:20.720
Uh anyways, this is yes, the dialogue APL converted to cap, which is a little confusing because they switch up some of the symbols on you, so it it makes it a little bit harder to read.
01:09:20.960 --> 01:09:24.000
Yeah, so this is this is the uh the petitioning thing.
01:09:24.239 --> 01:09:27.680
If you hit F1, hit F1, it's beautiful, beautiful.
01:09:27.920 --> 01:09:29.039
Look at that, folks.
01:09:29.359 --> 01:09:29.840
Look at that.
01:09:30.159 --> 01:09:30.720
Petition, right?
01:09:30.800 --> 01:09:34.479
So it uses the AP uh APL2 uh pairing of glyphs.
01:09:35.680 --> 01:09:37.359
So and this is first, right?
01:09:37.439 --> 01:09:39.600
That's for the same reason as an APL2.
01:09:39.920 --> 01:09:42.479
We could make it look the same in dialogue if you wanted.
01:09:42.720 --> 01:09:46.239
So yeah, that's this is exactly the same, right?
01:09:46.479 --> 01:09:46.640
Yeah.
01:09:46.960 --> 01:09:49.039
It's literally just no.
01:09:49.279 --> 01:09:50.880
Oh, this is tail, right?
01:09:51.039 --> 01:09:51.520
Yeah.
01:09:51.920 --> 01:09:52.239
Yeah.
01:09:52.479 --> 01:09:56.960
I thought it was called behead, but I think it's only called behead in J.
01:09:57.520 --> 01:09:59.279
But in in the in the ducks.
01:09:59.760 --> 01:10:06.960
Uh no, I think it's confused because your cursor is to the left of each, but if you just put it to I don't know, that is actually a bug.
01:10:07.039 --> 01:10:08.800
That should be highlighting drop first.
01:10:09.039 --> 01:10:11.279
Um first.
01:10:11.760 --> 01:10:12.640
Although interesting.
01:10:12.720 --> 01:10:14.399
Actually, let's diagnose this bug.
01:10:14.560 --> 01:10:19.279
Put your cursor to the right and then shift left, and maybe that's what it is.
01:10:19.359 --> 01:10:20.560
So it reads the cursor.
01:10:20.960 --> 01:10:22.239
That's oh that's what I did.
01:10:22.640 --> 01:10:23.439
That's really wrong.
01:10:23.600 --> 01:10:26.159
It forgets to look at the direction of the selection or something.
01:10:26.239 --> 01:10:28.560
But in anyway, if something is selected, it should go by the selection.
01:10:28.720 --> 01:10:29.359
Don't care about the code.
01:10:29.600 --> 01:10:30.479
It's supposed to work that way.
01:10:30.560 --> 01:10:31.520
I don't know what it's doing.
01:10:31.760 --> 01:10:33.279
I'll file a bug on my own repo.
01:10:33.920 --> 01:10:35.680
You didn't you didn't write the code, right?
01:10:36.319 --> 01:10:39.279
No one needs to write the code any day any anymore, you know.
01:10:39.439 --> 01:10:46.399
We're we're all just handcrafting uh APL code now, but the rest of it, if it's JavaScript, send it to the AI.
01:10:46.720 --> 01:10:49.119
So having drop first does the trick here.
01:10:50.399 --> 01:10:51.760
Yeah, that's what I was also thinking.
01:10:52.000 --> 01:10:55.760
I wasn't gonna code this one up, but then I was like, oh wait, doesn't uh cap have behead?
01:10:55.920 --> 01:10:58.319
Uh and you have that in tiny apple?
01:10:58.399 --> 01:10:59.119
Yeah, no.
01:10:59.760 --> 01:11:00.319
Ooh.
01:11:01.680 --> 01:11:04.239
A missing primitive, a missing primitive.
01:11:05.039 --> 01:11:08.720
The people demand all the primitives in Tiny Apple.
01:11:10.239 --> 01:11:11.840
Even Jay has behead.
01:11:11.920 --> 01:11:12.159
Yeah.
01:11:12.319 --> 01:11:15.680
Well, I thought that's the other one which is nighter, the minus one drop.
01:11:15.760 --> 01:11:17.279
I use that one more than one drop.
01:11:18.079 --> 01:11:18.560
Kurtel.
01:11:18.800 --> 01:11:19.600
Yeah, Curtel.
01:11:20.000 --> 01:11:20.319
Interesting.
01:11:21.840 --> 01:11:23.279
Here's a last question too.
01:11:23.359 --> 01:11:26.880
Is is oh I think it's a Google, I think it's a Google Share.
01:11:26.960 --> 01:11:37.119
I was gonna say there was like a slight Phantom help uh doc that I could see, but I I think it was uh the screen sharing software and not actually the website.
01:11:37.279 --> 01:11:39.199
Um anyways.
01:11:39.600 --> 01:11:40.000
Alright.
01:11:40.159 --> 01:11:42.319
This is this has been fun.
01:11:42.560 --> 01:11:45.680
Uh thanks to Marble Coma.
01:11:45.840 --> 01:11:48.079
Oh, uh my my chat's gone.
01:11:48.319 --> 01:11:49.039
Oh, there it is.
01:11:49.119 --> 01:11:57.840
Thanks to Marble Coma for sharing their uh Weevost solutions, and thanks to Madeline for coming on and showing us not only Tiny Apple, but also Haskell.
01:11:57.920 --> 01:11:59.279
Like I said, a first folks.
01:11:59.439 --> 01:12:06.159
That's why we need to grow the panel so we can get more functional languages on this array programming podcast.
01:12:06.479 --> 01:12:12.479
Any uh any last things uh to be said, to be to be done?
01:12:12.640 --> 01:12:14.560
If not, going once, going twice.
01:12:14.720 --> 01:12:17.600
With that, we will say happy array programming.
00:00:14.000 --> 00:00:19.280
Welcome to Raycast, episode one hundred and twenty-nine.
00:00:19.600 --> 00:00:25.039
My name is Connor, host of Raycast, and today with us we have two panelists.
00:00:25.359 --> 00:00:27.920
The panel has grown, folks, by 50%.
00:00:28.559 --> 00:00:30.640
I guess we will go around and do brief introductions.
00:00:30.719 --> 00:00:32.960
We'll start with Adam and then we'll finish with Madeline.
00:00:33.359 --> 00:00:35.200
Right, so I'm Adam Butowski.
00:00:35.920 --> 00:00:40.960
I am the head of language design at Dialogue, and I've been doing APL for a long time.
00:00:41.280 --> 00:00:42.399
And over to you, Madeline.
00:00:42.799 --> 00:00:44.159
I'm Madeline Vagani.
00:00:45.119 --> 00:00:47.520
I am the creator of Tiny Apple.
00:00:47.600 --> 00:00:49.359
That's probably how you know me if you do.
00:00:49.600 --> 00:00:52.719
And yeah, I've been doing that for about four years now.
00:00:53.119 --> 00:00:53.520
Awesome.
00:00:53.679 --> 00:00:54.880
We are happy to have you today.
00:00:54.960 --> 00:00:58.320
We mentioned, I think it was uh a couple months ago now.
00:00:58.479 --> 00:01:04.159
I think it was back in June, and technically we're beginning of August, that we were looking to grow the panel.
00:01:04.239 --> 00:01:08.959
And so we are in the phase where we are going to be bringing on guest panelists for the next little while.
00:01:09.040 --> 00:01:13.439
And we are very excited to have Madeline as our first guest panelist.
00:01:13.519 --> 00:01:18.959
And I guess I usually say uh as mentioned before, my name is Connor, host of Raycast, massive fan of all the array languages.
00:01:19.120 --> 00:01:24.239
And with that, uh let me know if my audio is too loud because uh every single time it's too quiet.
00:01:24.319 --> 00:01:26.799
But now I see the mic going super red.
00:01:27.040 --> 00:01:28.959
So uh I might have to adjust this.
00:01:29.040 --> 00:01:35.439
But while I do that, we will throw it over to Adam, who I believe has two announcements for our episode today.
00:01:35.920 --> 00:01:51.120
Yeah, so the first one is at the APL Forge, uh, which is this annual thing that dialogue has going where people can submit projects that they've been uh doing in dialogue APL or for dialogue APL, um has concluded a round.
00:01:51.359 --> 00:01:52.640
Next one has started.
00:01:52.719 --> 00:01:56.400
Um you can always submit ideas, look at forge.dialog.com.
00:01:56.640 --> 00:02:01.120
But the point is here that the winners for this year have been unannounced.
00:02:01.280 --> 00:02:14.800
Um so there is uh there's something that might be known on the podcast here, but uh Carl Krokin with his uh boxing game and our very own Connor Hextra with his array box.
00:02:15.759 --> 00:02:17.360
So that's uh one thing.
00:02:17.520 --> 00:02:20.639
Uh the other thing has a little bit to do with Madeline, or a lot to do with Madeline.
00:02:20.719 --> 00:02:21.919
Oh, yeah, congratulations, Connor.
00:02:22.800 --> 00:02:23.280
Look at that.
00:02:23.360 --> 00:02:24.000
Look at that.
00:02:24.639 --> 00:02:32.879
Um for the audio listeners, there are now uh celebratory things, uh icons floating up over the screen.
00:02:33.039 --> 00:02:34.719
Uh courtesy of Madeline.
00:02:34.960 --> 00:02:36.240
Um it's courtesy of me.
00:02:36.319 --> 00:02:36.879
I'm doing it myself.
00:02:38.639 --> 00:02:39.439
I didn't know what to do.
00:02:39.840 --> 00:02:42.800
I wasn't sure I was gonna be able to get this to work on uh uh Google Meet.
00:02:43.199 --> 00:02:45.520
Okay, my screen is showing up on Madeline's face.
00:02:45.599 --> 00:02:46.159
I don't know why.
00:02:47.439 --> 00:02:48.479
Um right.
00:02:48.639 --> 00:02:51.360
The other thing uh has something to do with Madeline, actually.
00:02:51.439 --> 00:03:15.840
So Madeline's been uh had uh she she got this uh grant from the APL Trust to uh work on the APL 387 fund, and I uh happened to notice that APL64, which is the new offering from the traditional vendor of APL Plus, um it now ships with the very latest version just came out.
00:03:15.919 --> 00:03:19.840
Uh it now ships with APL 387 bundles.
00:03:20.560 --> 00:03:26.560
Um so that's pretty cool that they've sort of picked that up uh without anybody from our side at least the time.
00:03:28.000 --> 00:03:30.000
Like to have them part of the community a little bit.
00:03:30.240 --> 00:03:31.360
Create just a corner.
00:03:31.599 --> 00:03:40.080
Um also ships to APL 387, the next next uh latest version, every new build probably built uh that is cool to see.
00:03:40.400 --> 00:03:40.960
Interesting.
00:03:41.039 --> 00:03:48.319
So it is pervasively uh I try to think actually, too, on my site, the one that won for the contest plug.
00:03:50.000 --> 00:03:59.840
I don't even remember the shortcut, but I know control H is uh is for the help, and then yeah, you do use APL387 as well on the on for the font there.
00:04:00.080 --> 00:04:01.599
I think it changes within the languages.
00:04:01.840 --> 00:04:02.080
Yeah, yeah.
00:04:02.159 --> 00:04:05.280
If you go control B, it shows the fonts per language.
00:04:05.439 --> 00:04:10.719
So 387 is used for APL cap in tiny Apple.
00:04:10.960 --> 00:04:17.439
Uh J uses JetBrain's mono, Wiiwa uses Wii Wa386, and BQN uses BQN386.
00:04:17.600 --> 00:04:19.839
So half of the languages on a ring.
00:04:20.160 --> 00:04:20.720
But it could be more.
00:04:20.800 --> 00:04:24.319
You could you could switch BQN to use APL387 as well.
00:04:24.399 --> 00:04:27.120
It's now it now has full coverage for BQN, I believe.
00:04:27.360 --> 00:04:34.800
And Wiiwa support is in progress, or at least scheduled, planned, uh to happen as well.
00:04:34.959 --> 00:04:39.839
So you could actually go universally AJ, of course, doesn't care because it's just ASCII, of course, it covers Hasky.
00:04:40.079 --> 00:04:40.480
Right, right.
00:04:40.639 --> 00:04:49.360
We're aiming for APL387 to become the universal array or Iversonian array language fund so we can handle every Iversonian array language.
00:04:50.000 --> 00:04:51.040
Awesome.
00:04:51.600 --> 00:05:02.480
Well, uh I'm not sure if there's a link for that, but if there is, Adam will send it to me after the show and I will put it in the YouTube description slash uh show notes on the website arraycast.com.
00:05:02.879 --> 00:05:09.120
And I think with uh those two announcements out of the way, we are going to I don't we didn't actually officially decide.
00:05:09.199 --> 00:05:19.360
Are we doing uh little problem solving today in multiple languages, or are we gonna pivot and then call an audible at the last second live on uh YouTube uh to a different topic?
00:05:19.600 --> 00:05:21.120
What say the panel?
00:05:21.439 --> 00:05:27.839
I mean we can I think we can start with uh little problem solving and see what it takes us with discussions and things.
00:05:28.240 --> 00:05:28.560
Okay.
00:05:29.600 --> 00:05:30.959
We didn't discuss this either, folks.
00:05:31.040 --> 00:05:32.319
This is all happening live.
00:05:32.480 --> 00:05:33.920
Uh who's screen sharing?
00:05:34.000 --> 00:05:34.959
Is it gonna be Adam?
00:05:35.040 --> 00:05:40.000
Although, because Adam's got the laptop with the issues or the computer with the issues.
00:05:40.160 --> 00:05:42.720
Uh is it better if Madeline screen shares?
00:05:42.800 --> 00:05:44.480
What uh what should we do?
00:05:44.879 --> 00:05:47.759
Well let's let's look at the problem before we volunteer.
00:05:48.000 --> 00:05:59.600
Well, uh we can't look if no one screen shares, but I mean technically I can uh drag it over our faces if we want, but I can uh read the problem, although now I don't actually know.
00:05:59.759 --> 00:06:01.600
It's on my left monitor.
00:06:01.759 --> 00:06:25.279
So we're gonna be looking at this week's challenge, which just dropped in the last 12 hours if you're listening to this live, and plus however many hours if you're not listening to it live, and we're gonna skip task one of challenge 385 from Pearl Weekly Challenge and go to task two, which is a twist on a classic APL problem.
00:06:25.360 --> 00:06:29.040
So I will I'll I'll hover it over my whole screen now.
00:06:29.199 --> 00:06:34.959
I'll hover it over my face, and you can see our two other uh beautiful panelists, but not me.
00:06:35.199 --> 00:06:38.160
And it's called outermost parentheses.
00:06:38.399 --> 00:06:52.959
Uh you're given a valid parentheses string and it's asked to write a script to return the string after removing the outermost parentheses of every primitive string in the primitive decomposition of the given string.
00:06:53.120 --> 00:06:58.399
So if you're an audio-on listener, you'll have to pay attention to what is a primitive decomposition.
00:06:58.480 --> 00:07:07.839
But if you're watching this on YouTube, you probably just by looking at the examples, have already uh deduced what a primitive decomposition is.
00:07:08.000 --> 00:07:14.160
But basically, it is for any valid substring of that string.
00:07:14.319 --> 00:07:21.600
Um, well, I guess it has to start left to right, so because you could technically take an inner uh parentheses if you're not starting from left to right.
00:07:21.680 --> 00:07:37.519
But if you start from left to right and each time you can take a substring from that point uh that is a standalone valid set of uh parentheses, then like that's your first component or chunk of your primitive decomposition.
00:07:37.600 --> 00:07:38.879
And then you just recursively do that.
00:07:39.040 --> 00:07:44.079
So for the first example, it's left paren, right paren, left paren, right paren, left paren, right paren.
00:07:44.160 --> 00:07:49.040
So that decomposes into just three sets of left and right parens.
00:07:49.279 --> 00:08:00.480
And so the result of that example is an empty string because if you just have three pairs and you remove the outer parens, you're left with nothing.
00:08:00.720 --> 00:08:04.959
Um and then I don't think we need to go into the other examples.
00:08:05.040 --> 00:08:09.839
Um, but if you're watching on YouTube, there's a couple other example two, three, and four.
00:08:10.160 --> 00:08:16.720
So that is the uh the the sentences are they only consist of parentheses, right?
00:08:16.959 --> 00:08:19.680
Uh yes, it and it's it's guaranteed to be valid.
00:08:19.759 --> 00:08:22.160
You don't need to do a validity check up front.
00:08:22.319 --> 00:08:23.600
Um yeah, okay.
00:08:23.680 --> 00:08:29.360
So that it is actually an interesting problem because this this you can solve in in multiple ways that I can think of.
00:08:29.600 --> 00:08:29.920
Perfect.
00:08:30.160 --> 00:08:30.560
Immediately.
00:08:30.879 --> 00:08:39.679
A little inside baseball, Adam said, huh, you know, it's not too interesting before, because uh everybody knows how to do this because it go it dates all the way back.
00:08:40.159 --> 00:08:44.480
Was it the um notation as a tool of thought?
00:08:44.639 --> 00:08:53.120
Does it come up in this paper, or it comes up in a paper that is like decades old um that Iverson shows the outer product solution?
00:08:53.279 --> 00:08:56.559
Um I can't remember which paper it is, maybe someone in the chat.
00:08:56.720 --> 00:09:00.799
Uh although now I've lost my uh access to the chat.
00:09:00.879 --> 00:09:03.600
But yes, this is what we will be solving.
00:09:04.559 --> 00:09:07.440
That's a classic, classic sort of problem, at least.
00:09:07.519 --> 00:09:20.159
But but there are there are some interesting approaches because we're not interested in the actual level of parentheses, we're only interested in what's re what remains when we remove all those parentheses.
00:09:20.320 --> 00:09:25.840
Um that means we can I can I'll start with a sort of a cheating uh uh uh solution.
00:09:25.919 --> 00:09:27.200
Let me let me share my screen.
00:09:27.440 --> 00:09:31.519
Oh yeah, I just I just thought of a neat trick as well for solving it.
00:09:32.559 --> 00:09:32.960
Yeah.
00:09:33.279 --> 00:09:35.840
That avoids that avoids partitioning.
00:09:36.240 --> 00:09:36.799
Yeah.
00:09:37.039 --> 00:09:39.200
Well then I wonder if that actually works.
00:09:39.279 --> 00:09:41.120
That would be crazy if it works.
00:09:41.440 --> 00:09:54.159
I won't I don't want to spoil it for for the the listener right now, but I'm thinking of well so should we should should one of us um oh here we got the screen share, so we're getting rid of the problem description.
00:09:54.320 --> 00:09:55.519
Actually, here I'll link it.
00:09:55.759 --> 00:09:57.840
We never we never link these uh problem descriptions.
00:09:58.080 --> 00:10:03.600
It's linked in the uh YouTube um live comments, and now Adam is screen sharing.
00:10:03.840 --> 00:10:11.200
And uh let's uh should we do something the classic the classic well actually what is the classic or naive way you would solve this?
00:10:11.440 --> 00:10:13.519
I don't know, maybe there's not even agreement on that.
00:10:13.840 --> 00:10:21.679
No, I think the classic it's not naive, but like the classic thing is to look at the parenthesis level, right?
00:10:21.840 --> 00:10:31.039
And then so every time we have an open parenthesis, we can like increase the level that starts from zero by one, and every time we're closing parentheses, we can we decrease it by one.
00:10:31.200 --> 00:10:40.399
This gives us for every character the ones that are um that are um like the the level that they're at.
00:10:40.639 --> 00:10:45.200
Now I don't remember exactly how it was like there can be there can be other text, right?
00:10:45.279 --> 00:10:46.879
Because we want to return what's there, right?
00:10:46.960 --> 00:10:54.399
With this, we want uh this is yeah, sorry, I'm using an experimental interpreter that's going to give me errors all over the place.
00:10:54.639 --> 00:10:57.120
So um that's going to be fun.
00:10:57.279 --> 00:10:58.320
Uh one second.
00:10:58.720 --> 00:11:00.320
I'll I can do better.
00:11:00.960 --> 00:11:05.360
As you did mention that uh I'm the one that's using the laptop that has issues.
00:11:05.600 --> 00:11:07.279
And APLs that have issues.
00:11:07.519 --> 00:11:07.919
Sorry.
00:11:08.879 --> 00:11:10.320
I should be the reason.
00:11:10.720 --> 00:11:14.080
Uh let's close this one down if I can.
00:11:15.840 --> 00:11:20.399
Well it is crash if it can't close, or just I think it can close.
00:11:20.799 --> 00:11:21.120
Okay.
00:11:21.519 --> 00:11:22.399
Brand new one.
00:11:22.559 --> 00:11:24.879
Ladies and gentlemen, this is where you saw it first.
00:11:24.960 --> 00:11:27.120
This is dialogue version 22.
00:11:28.080 --> 00:11:29.279
Were we on 21?
00:11:29.360 --> 00:11:33.120
You're telling me you're telling me the 22 is gonna have less issues than the 21?
00:11:34.480 --> 00:11:42.799
No, it's just that my installation was well using experimental 21 for something somebody was working on it's not an issue.
00:11:43.120 --> 00:11:43.279
Okay.
00:11:43.600 --> 00:11:47.200
Uh I just wanted to confirm something because you don't have the problem description of Randall.
00:11:47.279 --> 00:11:49.600
So this is this should return ABC, right?
00:11:49.759 --> 00:11:53.360
And even even this should return ABC, if I understand right.
00:11:53.519 --> 00:11:56.080
But it's easier to see what we're doing.
00:11:56.399 --> 00:12:07.279
Um and so we can we can uh we can see what the correspondence is between these numbers, and then we can uh do a subtraction vertically.
00:12:07.840 --> 00:12:28.159
So for each parenthesis that's opening, we're subtracting one minus zero or zero minus one, so it gives us positive negative numbers, so it gives us the change um for and in the parenthesis level, and if we then do a running sum, then we get the parenthesis level.
00:12:28.240 --> 00:12:37.039
Of course, it's it's slightly offset because we say that the opening paren is part of the new inner parenthesis, but the closing parent is not, but we can adjust um for that.
00:12:37.519 --> 00:12:41.519
And so we can see that when we have an opening paren that's a one, we remove it.
00:12:41.679 --> 00:12:45.120
We have a closing parent that's a zero that needs to be removed.
00:12:45.360 --> 00:12:46.480
So this is actually enough.
00:12:46.559 --> 00:12:49.759
We don't even have to uh to do any of the adjustments.
00:12:49.840 --> 00:13:24.480
So we could here say this is our this is uh the depth, and and then we can say and if t is equal to um an open parent, and the depth is equal to uh to one, or parentheses for that here, or if t is a closing parent, and uh the depth is a zero, so this is this is our depth, and this is these are the parentheses that we want to eliminate.
00:13:24.639 --> 00:13:33.679
That means if we negate this uh hitting our buttons, that gives us a mask for the original text.
00:13:33.919 --> 00:13:42.240
Okay, so if we stick that into the mouse, and then we can do the mask and replicate on the text, and that we've got what we want.
00:13:42.559 --> 00:13:43.919
So this is one way we could do it.
00:13:44.320 --> 00:13:53.679
We could also adjust directly these numbers by some rotations so that we get a and a zero in those those positions.
00:13:53.759 --> 00:13:54.720
We can try doing that.
00:13:55.039 --> 00:14:00.159
Um so if we go back for a moment, so let's uh start with this one again.
00:14:00.240 --> 00:14:03.759
We've got D here, which is which is the level.
00:14:04.159 --> 00:14:09.759
Um we can we also have our original masks over here.
00:14:10.240 --> 00:14:24.720
So really what we want is that if there is a uh a one in the bottom and there's a one in the depth, right, or there's a one on top, and that's the opening.
00:14:24.879 --> 00:14:34.240
Right, but this is this means open uh this means opening these two together, and this means closing, and this is the uh this is the depth.
00:14:34.399 --> 00:14:38.559
So here we've got uh open close, open close.
00:14:38.799 --> 00:14:50.159
So if you have a zero over here and we've got a one down here, or if you've got a one up here and a zero down here, right, and the level is one, then those are the ones we want to eliminate.
00:14:50.960 --> 00:14:56.000
So and so we can say if we we can we can match that, right?
00:14:56.080 --> 00:15:13.279
We if we want a function where only one zero on top to the bottom gives one, and only uh we want zero at the top and one at the bottom to give zero, and then we want to eliminate them.
00:15:13.440 --> 00:15:15.759
So we can do some some mathematics here.
00:15:16.000 --> 00:15:23.919
If you want exactly these this one pointed out, uh that's that's where we could just do the top row, it's actually easier.
00:15:24.240 --> 00:15:26.080
So we can just we have the depth.
00:15:26.320 --> 00:15:30.080
Sorry, I'm just sort of moving around here uh between them.
00:15:30.879 --> 00:15:32.720
Do the depth, that's this one.
00:15:33.200 --> 00:15:37.200
Um and we also have the top and the bottom rows from these two.
00:15:37.440 --> 00:15:49.120
So if we split up the comparison into these two, and we say this is opening and this is closing, you stack them on top of each other, that's the same same matrix.
00:15:49.360 --> 00:15:55.759
Now we have them as separate um separate vectors, and it makes it a little bit easier to deal with them in this case.
00:15:56.159 --> 00:16:13.440
Um then if we got opening and the depth equals um one, and that's the same thing as I did before, and then then we can say or we have closing and the depth equals zero or NOR, right?
00:16:13.600 --> 00:16:15.360
Because that's we want the one the mask.
00:16:15.519 --> 00:16:16.000
There we go.
00:16:16.080 --> 00:16:18.320
And then we can take T like that.
00:16:20.399 --> 00:16:24.879
It won't have the same length, but we can put this as a mask, and then we can say mask.
00:16:25.759 --> 00:16:38.559
This is a fairly fairly clean way of of writing it as three segments without having to do a like a new comparison of and we just do this as the minimum number of comparisons that we have.
00:16:39.279 --> 00:16:43.840
Well, surely you don't need to check for closing, so you know, just say negation of the other one.
00:16:44.240 --> 00:16:46.879
What do you mean through that to look for closing?
00:16:47.120 --> 00:16:48.639
Well, C is just not O.
00:16:49.279 --> 00:16:50.080
Yeah, that's true.
00:16:50.480 --> 00:16:50.720
Right.
00:16:50.960 --> 00:16:52.559
This this is a more general one, right?
00:16:52.639 --> 00:16:57.440
This will work even if you have additional text in there, it's like sort of inadvertently that.
00:16:57.519 --> 00:16:58.240
So yeah, you're right.
00:16:58.320 --> 00:17:00.480
We can we can combine them like this.
00:17:00.799 --> 00:17:07.759
Uh which means well, we could we could combine them like this, and which which is the same.
00:17:08.240 --> 00:17:23.839
Um and then we can we have a by the way, a uh uh comment in the chat uh that saying they didn't know you could evaluate inside uh array notation to this degree where you can set it inside and next cells can use their soul.
00:17:24.160 --> 00:17:27.759
So every every value expression inside array notation is just normal APL expressions.
00:17:27.839 --> 00:17:32.240
So whatever side effects happen there, they're they just happen, so you can use them later.
00:17:32.720 --> 00:17:49.200
However, we don't even need to assign O here because we can we can use C over here, and then we can just say because we know it's Boolean, instead of and we can just say that it's less than this less than is actually the same thing as not left and yes right.
00:17:49.599 --> 00:17:51.599
So we don't need to set that.
00:17:52.160 --> 00:17:53.279
Did I make a mistake?
00:17:53.759 --> 00:17:56.720
Uh oh, because the depth, I forgot to set the depth.
00:17:56.960 --> 00:17:57.359
That's right.
00:17:57.440 --> 00:17:58.319
So we do need both.
00:17:58.880 --> 00:18:05.519
I forgot to say that D gets plus backslash uh open minus close.
00:18:08.000 --> 00:18:11.680
So this only prints the openings, not the closings.
00:18:12.240 --> 00:18:17.200
And then uh we can get rid of that for now.
00:18:17.759 --> 00:18:21.440
The depth and mass and results we have over here.
00:18:22.319 --> 00:18:23.839
Can we combine this further?
00:18:25.759 --> 00:18:27.839
Can't really think of a good way to do it.
00:18:28.720 --> 00:18:30.480
Well, what does this look tacitly?
00:18:30.559 --> 00:18:34.480
Because you got one, two, three assignments.
00:18:34.880 --> 00:18:37.680
Yeah, it's not going to be very nice tacitly.
00:18:37.920 --> 00:18:43.200
We c it can obviously be done, but we can try it, but it's not going to be beautiful.
00:18:43.440 --> 00:18:48.160
So so if you want to make it a function, yeah, first let's make make this a proper function.
00:18:48.400 --> 00:18:52.400
So we don't want to return these things, we just want to compute them.
00:18:54.400 --> 00:19:03.359
And okay, so this one is explicit and let's try to make this tested, but it's not as again, it's not going to be nice.
00:19:03.599 --> 00:19:06.160
So we'll start by this mask over here.
00:19:06.720 --> 00:19:21.039
We combine that, and every and then we also eventually we need um oh, we can actually do this as a giant behind because we're going to compute a hu a mask and then we're going to apply it to the original argument.
00:19:21.119 --> 00:19:24.880
So we're going to have some giant function over here, and it's going to be really nasty.
00:19:25.279 --> 00:19:29.440
Um, so let's space this out to help readability just a tiny little bit.
00:19:29.839 --> 00:19:38.240
And for this, we need uh we need to find the two um c and o.
00:19:38.720 --> 00:19:44.079
One of them is going to be uh the original, and the other one is going to be the not.
00:19:44.880 --> 00:19:47.119
And then we're going to subtract them from each other.
00:19:47.359 --> 00:19:53.039
That's over here to get the d, and then we do the um the running sum.
00:19:53.200 --> 00:19:55.680
So now we've we're up to d over here.
00:19:56.079 --> 00:20:06.000
The problem is that we don't just want d and continue computation, we also want back references to to O and C as for the formula over here.
00:20:06.319 --> 00:20:19.279
So we're going to glue these two together and have a function that's between these two, which by the way, this can also be a behind, but we can get back to that because we have a right tag here and a knot over here.
00:20:19.440 --> 00:20:21.440
Um but we'll get to that.
00:20:21.920 --> 00:20:30.400
Um okay, so this is D, and we now have uh this is there's going to be some repetition here, which is not going to be very nice.
00:20:30.960 --> 00:20:37.440
So we want where one equals taking the left part first, and O is on the left, that's the negated one.
00:20:37.599 --> 00:20:41.359
So we want the left argument and one equals D.
00:20:41.759 --> 00:20:45.839
That's so this is the the left side of the NOR over here.
00:20:46.319 --> 00:20:50.640
And the right side of the NOR is going to be exactly the same.
00:20:51.039 --> 00:20:53.200
We might be able to simplify this a little bit.
00:20:53.920 --> 00:20:58.160
Um we're just going to have zero here like that.
00:20:58.400 --> 00:21:00.480
So I think this is all we need.
00:21:00.880 --> 00:21:03.039
If I haven't made any mistakes, we can try it.
00:21:04.079 --> 00:21:07.279
It didn't even work properly because I made some mistake somewhere.
00:21:07.599 --> 00:21:09.759
I think I write that on the second.
00:21:10.319 --> 00:21:10.960
Oh, it's this one.
00:21:11.200 --> 00:21:11.920
Yeah, it should be right.
00:21:12.880 --> 00:21:13.759
There we go.
00:21:14.160 --> 00:21:14.480
Okay.
00:21:15.119 --> 00:21:18.559
But I mean, this you don't want to write this tacitly.
00:21:18.960 --> 00:21:21.039
And we're doing computation twice.
00:21:21.359 --> 00:21:32.480
So we could potentially avoid the computation but computing this twice by merging together these two somehow, but it's not going to be very nice.
00:21:32.799 --> 00:21:43.440
Uh we could eliminate this outer function here by nick by doing something like that would be nice either.
00:21:44.559 --> 00:21:46.079
I think we can read this.
00:21:46.640 --> 00:21:47.039
Nasty.
00:21:47.200 --> 00:21:48.079
Oh, that is nasty.
00:21:48.319 --> 00:21:52.160
We can move the negation in here on both of them.
00:21:52.880 --> 00:21:55.839
And that eliminates the outer thing here.
00:21:56.400 --> 00:21:59.359
What's the chance I'm going to get my parenthesis right at this point?
00:22:00.240 --> 00:22:03.039
Uh okay, don't need this anymore.
00:22:03.119 --> 00:22:04.640
We can just put it inside.
00:22:05.440 --> 00:22:05.759
Okay.
00:22:06.000 --> 00:22:09.839
And then we need to apply this both sides here.
00:22:10.400 --> 00:22:13.920
And the right argument is that one, and the negation is that one.
00:22:14.160 --> 00:22:14.960
This might work.
00:22:15.200 --> 00:22:16.640
Yeah, it still works.
00:22:17.279 --> 00:22:23.039
Oh, I guess I'm doing the symbolic like manipulation in my head at least of the APL code.
00:22:23.279 --> 00:22:25.839
But I wouldn't exactly call this nice.
00:22:26.400 --> 00:22:27.839
Condenses a bit.
00:22:28.240 --> 00:22:29.680
Can you read this gunner?
00:22:30.880 --> 00:22:50.880
Well, the thing that I'm thinking in my head is like, does it because like I have a solution, but it's just the outer product, uh subtraction, column-wise scan, or column-wise reduce, plus scan, and then I just add the uh equals write parent to it.
00:22:51.119 --> 00:22:52.240
Yeah, you can do that as well.
00:22:52.319 --> 00:22:57.440
That's the that's the other part, another approach to that getting the and or go should be.
00:23:04.400 --> 00:23:06.400
Yeah, where either thing goes in here.
00:23:06.720 --> 00:23:07.759
You can do that as well.
00:23:07.920 --> 00:23:09.680
Because we know that it's well formed.
00:23:09.839 --> 00:23:12.240
So so let's let's let's let's try this.
00:23:12.559 --> 00:23:28.559
And and for the listener, D is the result of the plus scan on either the solution that uh Adams built here where you're storing the opening and closing parens and just doing subtraction or the outer product column-wise subtraction.
00:23:28.799 --> 00:23:32.880
Yeah, that's um so if you so we have D already, the depth.
00:23:32.960 --> 00:23:37.039
And if you do a one uh actually it doesn't minus one, I think.
00:23:37.279 --> 00:23:40.160
Minus one rotate, not one rotate here.
00:23:41.119 --> 00:23:43.279
So it's a guy.
00:23:43.359 --> 00:23:48.480
I need to I need to stack T on top so I can we can even put D.
00:23:50.319 --> 00:23:52.400
How do you know what the next thing is going to be?
00:23:52.880 --> 00:23:54.960
If either is a zero, you have to remove it.
00:23:55.119 --> 00:24:00.720
So you just take the minimum or multiplication order of D and the rotate direction.
00:24:02.640 --> 00:24:10.720
Yeah, because uh you have zeros where it's closing, and if you shift them, it's gonna be in the next opening, which it definitely uses to be the next one.
00:24:11.039 --> 00:24:13.119
Oh, because oh, because of the constraints, right.
00:24:13.200 --> 00:24:15.839
Again, I'm thinking that what are the other characters, but it can't be.
00:24:15.920 --> 00:24:21.759
So you know that if we're hitting a zero, the next thing after the zero has to be a one.
00:24:22.160 --> 00:24:23.680
There are no other options.
00:24:23.920 --> 00:24:24.720
That's true.
00:24:24.960 --> 00:24:25.839
That's cute.
00:24:26.000 --> 00:24:36.640
So if there's an if there's a zero in one of these, which actually we can uh we can actually cheat a little bit because we can look at yeah, I mean there are different ways to do it.
00:24:36.720 --> 00:24:38.400
We can compare them with zero, right?
00:24:38.799 --> 00:24:41.200
But we could actually also just multiply them.
00:24:41.519 --> 00:24:45.440
I was thinking of sine of sign and take the sign of that, yeah.
00:24:45.680 --> 00:24:49.119
Um so if you need that's a mathematical approach, right?
00:24:49.200 --> 00:24:57.920
If the if you multiply them, then we get this, and then this then the sign is the mask, and then we can we can filter filter with that.
00:24:58.079 --> 00:25:02.640
So we do and this will turn out nicer in a little bit in tacit at least.
00:25:02.960 --> 00:25:09.200
So if we go so again, minus vertical reduction on open close.
00:25:09.839 --> 00:25:17.519
I mean, even though this outer product is actually not really good because we're doing more comp comparisons we really need to, but okay, fair enough.
00:25:17.680 --> 00:25:18.319
This is D.
00:25:18.720 --> 00:25:22.400
And then we can this we can write in a nice tacit fashion.
00:25:22.559 --> 00:25:27.680
So we can write negative one and then the argument times the rotation.
00:25:28.480 --> 00:25:42.720
You're missing the uh missing the plush, and then we can do the the sign there, so we can take this whole function, but of course it doesn't work well testing, totally test it.
00:25:42.880 --> 00:25:46.400
But if you do it at a D near, then we can write it like this.
00:25:46.559 --> 00:25:47.839
Just that's what I need.
00:25:48.319 --> 00:25:49.039
That's nice.
00:25:49.200 --> 00:25:57.119
I need to go like wait, because we This is only this will not work if there were other characters in there.
00:25:57.200 --> 00:25:58.000
It will only work.
00:25:58.240 --> 00:26:16.079
I know, but why do you need the D I mean I I guess you need the D font because you need to it's because of these monetic functions that uh it would we can totally do it tacitly, but it's just going to be really, really ugly because we need to we need to apply this monetic function.
00:26:16.240 --> 00:26:17.599
So we need to parenthesize.
00:26:17.680 --> 00:26:24.720
We can't bind it with an attack when we don't have not uh nothing either from B to N and J.
00:26:25.119 --> 00:26:25.359
Cap.
00:26:25.680 --> 00:26:26.799
We have to parenthesize it.
00:26:26.960 --> 00:26:29.920
And they use a lot of mutability in my opinion when you do this.
00:26:30.079 --> 00:26:31.839
But yeah, this works.
00:26:33.680 --> 00:26:36.319
I actually I think there are uh what do you say?
00:26:36.480 --> 00:26:43.680
Oh no, it is a couple characters shorter, I was gonna say uh than uh my previous solution.
00:26:44.000 --> 00:26:48.559
That's a neat trick, the rotate uh yeah.
00:26:48.960 --> 00:27:00.319
Seems like this would be uh ideal well, it's hard to tell without actually trying it, but in cap you'd have uh only two trains, so you don't need the parens, and then you also have an outer product glyph.
00:27:00.880 --> 00:27:04.799
Um wait, there's something else I want to try here.
00:27:05.039 --> 00:27:13.279
So we still have to go through the depth, but if we do the depth here, and we can put T on top, right?
00:27:13.599 --> 00:27:15.200
So it's more readable.
00:27:15.759 --> 00:27:20.160
So a one is what we want to get.
00:27:20.319 --> 00:27:23.599
I want to get rid of the ones that are one and open.
00:27:25.119 --> 00:27:26.160
No, I was thinking about that.
00:27:26.240 --> 00:27:29.359
We could look at the at the pattern that we've got.
00:27:29.839 --> 00:27:31.599
This is what we want to eliminate.
00:27:31.839 --> 00:27:32.640
Ah, okay.
00:27:32.799 --> 00:27:34.079
I think I have an idea.
00:27:34.319 --> 00:27:37.359
We can we can look for this pattern of zero, one.
00:27:38.160 --> 00:27:42.799
Those are the ones, the ones that are above a zero, one are the ones we want to eliminate.
00:27:43.359 --> 00:27:46.160
So so let's see, let's say we do it like this.
00:27:46.240 --> 00:27:52.720
I'm going to replace it with a notation inside a uh entire function so we can give a single parameter.
00:27:52.799 --> 00:27:54.799
Let's say we do a one rotate of this.
00:27:56.720 --> 00:27:59.680
Now it's the well, it doesn't really matter.
00:27:59.759 --> 00:28:01.759
Now it's the negative one zero.
00:28:01.839 --> 00:28:06.160
We can also rotate the other way around, and it's going to be the same negative one zero.
00:28:06.799 --> 00:28:13.119
And anywhere we have negative one zero, that's when that's what we want to eliminate.
00:28:13.680 --> 00:28:21.200
So if we look for this pattern, we can also do it after we do the uh do the running sound like this.
00:28:21.359 --> 00:28:35.440
So we can do one here, and now so what happened now when we rotated the first character uh to the end is that that uh we should do that one rotate here as well, otherwise it's hard to understand what's going on.
00:28:35.519 --> 00:28:43.279
So we take the first character move to the end, and that means that we're pairing that one the opening with a closing from here.
00:28:43.440 --> 00:28:47.279
So now what we want to eliminate are the characters that are above the zero one.
00:28:47.519 --> 00:28:52.079
So we've got one here, we've got one here, and we've got one one over here.
00:28:52.640 --> 00:28:59.759
Okay, so um if we we can start by doing it with fine because it's easy to spot what's going on.
00:28:59.920 --> 00:29:03.039
So this gives us a mask where we have we've got zero one.
00:29:03.599 --> 00:29:08.400
And we what we want is the next character after that as well.
00:29:08.880 --> 00:29:11.920
So we can do a a one rotate on that.
00:29:12.559 --> 00:29:14.640
Sorry, did I make a mistake here?
00:29:14.799 --> 00:29:19.200
Oh, yeah.
00:29:19.599 --> 00:29:22.720
That that points at the next character.
00:29:23.839 --> 00:29:25.119
Oh, minus one rotate, sorry.
00:29:25.359 --> 00:29:27.359
Minus one rotate points at the next character.
00:29:27.519 --> 00:29:28.640
So one of those two.
00:29:28.720 --> 00:29:44.960
So if we do if we do combine them again, so we can make this little train, this or the rotate, that those are the characters that we want to eliminate, which means the NOR on that is are the ones we want to keep.
00:29:45.200 --> 00:29:50.799
And it doesn't matter that we rotated the initial character to the end because the initial character will always be eliminated.
00:29:51.039 --> 00:29:52.079
There's no other way.
00:29:52.400 --> 00:30:07.200
So now we can do this whole thing like this, and we have to uh rotate well, it's rotated the step, so we have to rotate, we either rotate the mask or we can rotate the uh the input over here, so like that.
00:30:07.599 --> 00:30:08.400
Is it shorter?
00:30:08.640 --> 00:30:08.880
No.
00:30:09.519 --> 00:30:11.920
Sort of a different way of doing things.
00:30:12.240 --> 00:30:18.720
And this we can we can change this whole thing to use a pairwise um instead.
00:30:19.039 --> 00:30:31.039
So we can say we're looking for looking for looking for that, and then we we rotate it right and left, so we do want to put a zero in front or behind.
00:30:31.759 --> 00:30:36.559
So this is that alright, what I'm doing.
00:30:36.880 --> 00:30:38.799
Oh no, because these are actual numbers.
00:30:38.880 --> 00:30:39.519
Yeah, we can't do that.
00:30:39.680 --> 00:30:41.599
We have to look for the pattern of zero, one.
00:30:42.319 --> 00:30:43.519
It's not a boolean.
00:30:44.960 --> 00:30:46.240
But this works.
00:30:48.960 --> 00:30:52.400
Um I still think that's a better way to do this.
00:30:53.599 --> 00:31:04.559
Well, I posted uh in the chat um uh the cap equivalent of the last solution, which uh is very nice.
00:31:04.720 --> 00:31:06.400
Here I'm I'm blocking your screen now.
00:31:06.480 --> 00:31:08.400
You have to go to the YouTube live stream to see this.
00:31:08.480 --> 00:31:20.480
Uh but uh it's just nice because like I said, it it has the outer product primitive and uh oh and the and the the array with primitive that binds together, yeah.
00:31:20.720 --> 00:31:30.319
Yeah, so but I'm not sure I mean what we're doing here is this thing in cap, I would guess you can write that differently.
00:31:30.640 --> 00:31:31.920
Let me try it.
00:31:32.640 --> 00:31:35.039
I have uh I have it over here.
00:31:35.680 --> 00:31:39.759
I'm not showing my my array box, I don't know exactly what's on the on the stream.
00:31:40.000 --> 00:31:49.119
So because of the way things bind, I would think that we can how is it in cap to write a scalar character, you write like an add sign in front?
00:31:49.279 --> 00:31:50.960
I think yes, yeah, yeah.
00:31:51.279 --> 00:31:58.240
So if we do add open paren equals no, we're not allowed to do that, right?
00:31:58.559 --> 00:32:00.480
I wanted to do something like this.
00:32:01.440 --> 00:32:03.680
But we but it's that's a fork.
00:32:03.920 --> 00:32:10.160
Oh, but you can just do uh like equal to the closing one and then you do like oh and the not, yeah.
00:32:10.400 --> 00:32:13.279
Yeah, not uh before subtract or something like that.
00:32:13.519 --> 00:32:13.839
Right.
00:32:14.000 --> 00:32:23.759
So if we do equal to view this, um and then we do the not subtracted from that.
00:32:24.640 --> 00:32:25.279
Does it work?
00:32:25.440 --> 00:32:27.119
Or it already evaluates, right?
00:32:27.440 --> 00:32:31.039
Uh well no, if you hit enter, that gives the same result, so I guess.
00:32:31.359 --> 00:32:32.000
Yeah, yeah.
00:32:32.880 --> 00:32:36.240
I guess I should put some little confetti every single time you hit enter.
00:32:37.279 --> 00:32:39.440
I see is following what's happening here?
00:32:39.599 --> 00:32:43.440
So we're taking taking the closing paren and comparing with the whole string.
00:32:43.599 --> 00:32:51.680
Then we're taking the negation of that and subtracting the original value, that's what behind does, and then we do the the running sum.
00:32:51.920 --> 00:32:55.200
I think that's nicer than the outer products.
00:32:56.240 --> 00:33:02.160
Uh it is, although I have to say the at is an ISOR.
00:33:02.319 --> 00:33:03.279
Um yeah.
00:33:03.599 --> 00:33:06.960
But other than the VGN's way of writing it like this.
00:33:08.480 --> 00:33:11.119
I mean I do like the I do like the two characters.
00:33:11.200 --> 00:33:16.640
I just like the at is not very uh APL font-ish, you know.
00:33:17.279 --> 00:33:36.319
Or character, no, or symbolically, like it's using the right font, but it doesn't, it doesn't uh although you know you could argue that the a couple of these, like the the fork syntax and cap is a little um um yeah, something oh wait a minute.
00:33:36.640 --> 00:33:46.799
I think I think in BQN uh you don't need to do this at all because or or if if you've got if you one second.
00:33:47.039 --> 00:33:53.759
If you've got uh F and characters, these two are one off from each other, right?
00:33:54.559 --> 00:33:59.680
So you can actually just subtract adjacent characters just and go from there.
00:34:00.079 --> 00:34:05.920
Unfortunately, you don't you don't have uh pairwise uh No, you can't have everything, right?
00:34:06.480 --> 00:34:07.359
Yes, you can.
00:34:07.519 --> 00:34:09.119
You just go straight to Tiny Apple.
00:34:09.360 --> 00:34:11.920
Well, Tiny Apple has has appeared characters as well?
00:34:12.159 --> 00:34:12.639
Yeah, of course.
00:34:13.039 --> 00:34:13.519
Of course.
00:34:14.079 --> 00:34:14.480
Of course.
00:34:14.559 --> 00:34:17.920
And if it's if it's missing something, uh you just switch to it, you know.
00:34:18.079 --> 00:34:19.679
Okay, Matt Medelin, do you want to drive?
00:34:19.760 --> 00:34:21.119
You want to share your screen?
00:34:21.440 --> 00:34:29.840
Um also Marvel Com Coma in the chat says uh they solved this earlier today.
00:34:30.000 --> 00:34:37.440
If you've got uh link and you want to drop it in the chat, uh we can show your Wiwa solutions um if you want.
00:34:37.599 --> 00:34:42.960
You know, it's kind of putting you on the spot, but uh okay.
00:34:43.119 --> 00:34:47.599
So we want this the parabolic subtraction.
00:34:48.480 --> 00:34:48.800
Okay.
00:34:49.519 --> 00:34:53.760
Uh yeah, so this is right.
00:34:54.239 --> 00:34:59.840
Uh you know that it's negative negative one of the ones uh in the area we want to to eliminate.
00:35:00.159 --> 00:35:02.159
Oh, because it's right, so we just do this.
00:35:02.320 --> 00:35:05.920
No, I don't think that's right.
00:35:10.400 --> 00:35:15.199
Yeah, because think about it, the ones we want to eliminate, except at the edges, right?
00:35:15.679 --> 00:35:16.800
We know that we want to drop.
00:35:16.880 --> 00:35:17.840
Oh yeah, we could have done that.
00:35:17.920 --> 00:35:20.639
We could have done like a one drop, negative one drop as well.
00:35:20.800 --> 00:35:23.440
Because you know the person that character must be removed.
00:35:23.599 --> 00:35:30.320
So the ones we want to draw to get rid of are the ones where you got one negative one, right?
00:35:34.320 --> 00:35:34.800
What is this?
00:35:34.960 --> 00:35:43.519
This is it can be that that can exist though, nested in a primitive component, so I don't think that actually works, right?
00:35:43.679 --> 00:35:45.119
I'm pretty sure actually one of the examples.
00:35:45.440 --> 00:35:50.960
Oh yeah, it's no you have to go, yeah, you have to go to the scan, of course.
00:35:51.199 --> 00:35:51.920
Yeah, yeah.
00:35:52.000 --> 00:35:53.599
That's it doesn't help.
00:35:56.000 --> 00:36:02.719
Because we don't really care about the difference between like what do I find characters actually give you?
00:36:02.800 --> 00:36:04.880
Like compare.
00:36:05.360 --> 00:36:05.920
Yeah.
00:36:06.400 --> 00:36:07.920
If you do a scan on that.
00:36:09.920 --> 00:36:11.360
The second one is a sound scan.
00:36:11.920 --> 00:36:12.239
Yeah.
00:36:12.400 --> 00:36:12.639
Yeah.
00:36:14.800 --> 00:36:17.760
No, we still can't tell where what level it's at.
00:36:20.480 --> 00:36:32.239
There might be some way to do this using using the the differences, but well one thing you can certainly do instead of comparisons with the parentheses, you can just subtract 40, right?
00:36:33.360 --> 00:36:38.639
Or subtract the character before and what is 39?
00:36:40.239 --> 00:36:41.039
It's going to be all.
00:36:44.960 --> 00:36:47.440
Yeah, but I don't think it's that much better.
00:36:47.840 --> 00:36:50.239
It's probably clear to just write the comparison.
00:36:50.880 --> 00:36:52.719
No, it's not it's not even shorter.
00:36:57.280 --> 00:37:01.199
I'm sure there's some drag X way to do this with some balance and terrorist thing.
00:37:03.440 --> 00:37:07.920
Probably nothing.
00:37:08.559 --> 00:37:13.840
It seems like there should be a way to do it without the whole depth, but not true.
00:37:14.079 --> 00:37:16.559
Because it gives you a lot of information that you don't need.
00:37:17.920 --> 00:37:18.320
Yeah.
00:37:23.440 --> 00:37:25.760
Should we look at Marblecoma solutions?
00:37:25.840 --> 00:37:31.840
Uh and then see if we're inspired to find a way to avoid the the depth.
00:37:32.079 --> 00:37:33.360
Um I guess.
00:37:35.920 --> 00:37:37.599
What's uh cluster?
00:37:38.239 --> 00:37:40.880
Um they said they created a GitHub discussion.
00:37:40.960 --> 00:37:44.239
I believe that's probably on the Arraycast site.
00:37:44.559 --> 00:37:50.480
I don't know that's where we opened it then, I think I'm gonna Yeah, it does.
00:37:56.239 --> 00:37:56.559
Okay.
00:37:57.360 --> 00:38:01.760
Oh, admittedly, it's not loading on my computer.
00:38:02.000 --> 00:38:08.159
Well, load for you, so yeah, we're on part two.
00:38:12.159 --> 00:38:12.480
Okay.
00:38:14.159 --> 00:38:16.719
Okay, so this is the same thing exactly we had right.
00:38:17.039 --> 00:38:22.320
Yes, they add add open paren and do the do a negation and subtraction.
00:38:22.639 --> 00:38:29.360
It's just choosing which character you do, then doing a what's the plus thing doing the second plus?
00:38:29.760 --> 00:38:30.400
That's a plus scan.
00:38:31.760 --> 00:38:33.840
That's a plus scan, but what's what's the other plus?
00:38:34.239 --> 00:38:36.559
Uh it's adding the original, I think it's Connors.
00:38:36.800 --> 00:38:42.079
It's adding the because this one keeps around the original mask, and then it gets added to the sum scan.
00:38:42.320 --> 00:38:43.599
Yeah, okay.
00:38:44.079 --> 00:38:46.320
And then yeah, you just replicate.
00:38:46.559 --> 00:38:49.679
Yeah, yeah, I think it's like the ones really have some shit.
00:38:50.239 --> 00:38:51.840
I still think that's a better way to do that.
00:38:55.199 --> 00:38:55.679
I don't know.
00:38:56.559 --> 00:38:58.000
Oh, because it's greater than one.
00:38:58.159 --> 00:38:58.719
Why greater?
00:38:59.039 --> 00:38:59.920
Then I've gratitude.
00:39:00.639 --> 00:39:03.440
Oh, oh, because it's yeah, okay, it's the eye mission.
00:39:03.760 --> 00:39:04.239
Right.
00:39:09.840 --> 00:39:20.400
Yeah, Marble Coma in the chat says uh didn't see the start of the uh stream, but uh not surprised that it's the same because it's a pretty natural solution.
00:39:20.639 --> 00:39:39.599
To be honest though, like if if I were not as array-brained as I am now, like the functional way to solve this coming from like Haskelland is to do like a split and then a drop, you know, first, drop last, and then a recombination.
00:39:40.000 --> 00:39:44.079
Um how do you choose what to split on the depth screen?
00:39:44.480 --> 00:39:46.400
Yeah, you'd have to do that as well.
00:39:47.599 --> 00:40:04.880
But like uh Haskell and functional languages, to my knowledge, don't really have uh I mean I I I guess you could do like a filter after a zip with the depth if you wanted to, but like that's not where my functional brain would go to first.
00:40:05.199 --> 00:40:15.199
Like it like especially in Haskell when you have words and unwords, like you're very used to this kind of you know, splitting and recombining pattern.
00:40:15.440 --> 00:40:15.679
I don't know.
00:40:15.760 --> 00:40:20.159
You'd I guess you'd have to ask a I mean actually, Madeline, you're a you're a Haskell programmer.
00:40:20.480 --> 00:40:22.000
I think it would just be a fold.
00:40:22.239 --> 00:40:23.599
You would just do a fold?
00:40:23.840 --> 00:40:24.239
Yeah.
00:40:24.480 --> 00:40:34.320
After zipping with the depth, or I guess you'd just do a just a depth as a state and the result um just add if stuff to you.
00:40:34.719 --> 00:40:35.199
Really?
00:40:35.440 --> 00:40:37.840
That's that's that's and that's your Haskell brain?
00:40:37.920 --> 00:40:39.360
That's not like your array brain.
00:40:40.400 --> 00:40:43.679
Um I have a fun solution then.
00:40:43.920 --> 00:40:46.239
Oh, this is wait, wait, wait, wait.
00:40:46.320 --> 00:40:47.840
Let's let's do this Haskell thing first.
00:40:47.920 --> 00:40:51.519
Uh this is the first time ever for Raycast, episode 129, folks.
00:40:51.760 --> 00:40:56.480
If you're live on YouTube, you know what's happening, but if you're an audio listener, you're confused.
00:40:56.719 --> 00:40:59.119
We are at play.haskell.org.
00:40:59.280 --> 00:41:00.880
Didn't even know it existed, folks.
00:41:01.039 --> 00:41:05.840
Uh back in 2018 slash 19 when I was a Haskell fan.
00:41:06.000 --> 00:41:08.719
Uh I didn't I don't think this existed back then.
00:41:08.880 --> 00:41:10.639
And or if it did, I didn't know about it.
00:41:10.719 --> 00:41:14.159
And so we're watching live coded Haskell.
00:41:14.880 --> 00:41:19.519
We got monads, even though you might not know they're there, they're there, folks.
00:41:20.880 --> 00:41:23.840
And uh monetic functions?
00:41:24.079 --> 00:41:24.480
Nope.
00:41:24.719 --> 00:41:25.440
Well, yeah, yeah.
00:41:25.920 --> 00:41:27.119
Clash of the monads.
00:41:27.199 --> 00:41:29.840
That's what we should do an episode called Clash of the Monads.
00:41:30.079 --> 00:41:36.639
Uh although I guess it's kind of they're very simple on the APL side of things.
00:41:38.960 --> 00:42:03.519
Um thinking is if so we started at that zero, and then so if it's the XLM that is okay, so you have zero and and whatever, um x is and or something, we need to just do the same thing but increment so um like this yeah, so that's great and then zero.
00:42:03.920 --> 00:42:07.360
Um zero is a great, I guess it doesn't really matter.
00:42:07.679 --> 00:43:08.079
Um then if we have um and closing one, then uh one and closing is going to be zero and the same strength, and everything else is uh I think we can hear Adam's one and not come back later with the working association.
00:43:08.400 --> 00:43:09.920
Sure, I can I can share my screen.
00:43:10.000 --> 00:43:17.840
I've come up with a couple of interesting developments over here and experimenting, so we'll be the judge of that.
00:43:20.639 --> 00:43:25.760
Uh maybe not if the screen never shares.
00:43:26.320 --> 00:43:27.360
Uh give it a moment.
00:43:27.519 --> 00:43:28.159
Give it a moment.
00:43:28.320 --> 00:43:31.039
It just um has to hang a little bit here.
00:43:31.280 --> 00:43:34.800
Okay, so a couple of things that I that I started exploring.
00:43:34.960 --> 00:43:37.440
One was let's just yeah, let's look at that first.
00:43:37.599 --> 00:43:41.599
Let's look at the at the depth depth vector that I've been working on.
00:43:41.920 --> 00:43:51.679
Um so we have been doing it, we did it before with like saying like the closing trend and then uh uh not behind minus.
00:43:52.000 --> 00:43:54.079
And uh sorry, get rid of this.
00:43:54.480 --> 00:43:56.880
It's just nice and short.
00:43:57.039 --> 00:44:02.800
Another thing that's nice and symmetrical is if we Like open parent or closed friend doesn't matter.
00:44:02.960 --> 00:44:08.159
So we want so equality that's all the open parents and unequality that's all the closed parameters.
00:44:08.239 --> 00:44:09.760
So we can write that as a nice fork.
00:44:10.000 --> 00:44:12.880
Like that equality minus the unequal unequality.
00:44:12.960 --> 00:44:15.119
I thought that's that's sort of neat.
00:44:15.519 --> 00:44:22.159
Either way, uh once we've we have the depth vector, we can go back to go back to this one.
00:44:22.400 --> 00:44:24.559
Then I did it with uh with petitioning.
00:44:24.639 --> 00:44:26.480
So so here's the depth vector.
00:44:26.800 --> 00:44:42.000
And if we then look at at the pattern here, then we can see if we should we can split every time there's a zero, and then every section and has begins with open and closed band that need to be eliminated.
00:44:42.159 --> 00:44:54.320
We can actually eliminate the closing one by using by exploiting the EPL2 partition function because it starts a new segment whenever uh we increase the value and and it discards anything that has a zero.
00:44:54.400 --> 00:45:02.559
So if we if we switch to um to the magnitude here, then we can see the pieces that we're going to uh to get.
00:45:02.719 --> 00:45:06.320
So now we can use this to partition t.
00:45:06.800 --> 00:45:12.480
So and all we need to do now is drop the first from each one and merge.
00:45:13.519 --> 00:45:15.599
Oh, drop the first from each one.
00:45:15.760 --> 00:45:18.559
Yeah, because that's the opening parameter never got eliminated.
00:45:18.639 --> 00:45:24.639
The closing one got eliminated by the um but the petitioning having hit zero.
00:45:25.360 --> 00:45:33.280
So we can we can write all of this together as a tested function, even if you want, because this is just a behind this whole thing here.
00:45:33.519 --> 00:45:36.559
But there's a lot of monetic functions going on.
00:45:37.039 --> 00:45:39.360
We can write as a DN with here.
00:45:40.079 --> 00:45:42.880
And yeah, so this is a valid function.
00:45:43.199 --> 00:45:47.920
Here's a single monetic function, there's a datic function, an array, and a monetic function.
00:45:48.000 --> 00:45:49.519
So that's uh that that's valid.
00:45:49.679 --> 00:45:50.880
That's the trick.
00:45:51.519 --> 00:45:56.559
Um we can also write this, but there's a lot of lot of monetic function application going on.
00:45:56.639 --> 00:46:07.599
But if we go back to what I did before with the equal minus unequal, that comes out nicely and as a um as a dadic function.
00:46:07.679 --> 00:46:10.239
We still have to do a right check here or bind.
00:46:10.639 --> 00:46:20.639
We can stick the uh plus scan on top of the minus, and the result of the whole thing, we can we can put the sign.
00:46:20.960 --> 00:46:22.400
So this gives us this.
00:46:24.000 --> 00:46:29.280
Now we have a fork in here with a left argument and the right argument.
00:46:29.519 --> 00:46:31.039
So another another fork.
00:46:31.199 --> 00:46:35.840
We can bind the left argument instead, being that that's a derived function.
00:46:36.079 --> 00:46:39.840
This whole thing, a single derived function, not a not a train.
00:46:40.000 --> 00:46:42.239
We don't need parentheses over here either.
00:46:42.480 --> 00:46:51.199
So now we have a fully tested solution that is as short as the hybrid tested explicit one, which I think is the shortest we've got so far in the APR.
00:46:51.440 --> 00:46:52.800
Is it very readable?
00:46:52.960 --> 00:46:56.719
Maybe not, but uh I don't think it works.
00:46:56.880 --> 00:47:14.880
So this is partition diagram by where we have the sign of the equality width open for n minus the unequality open for n, and we've done this some scan of that, then drop the first of each and recombine.
00:47:16.000 --> 00:47:21.599
What are all the different ways now we've spelt the depth vector?
00:47:22.079 --> 00:47:25.360
So it's got outer product, yeah.
00:47:25.519 --> 00:47:28.159
So the outer product one, right?
00:47:28.320 --> 00:47:36.880
So we can say so depth outer is open closeprint jot dot equals the right argument.
00:47:37.360 --> 00:47:52.159
Yeah, we got uh depth separate, we would just say open print minus closeprint, which we can we can make that look nice if we put uh that's nice and palindromic sort of like that.
00:47:52.400 --> 00:47:57.920
Um we have done it with a negation or like a not.
00:47:58.239 --> 00:48:03.199
So we just look at the close print in APL because we only have a one hook operator.
00:48:03.360 --> 00:48:04.719
We use the close printer for that.
00:48:04.960 --> 00:48:08.320
We could actually use the open print and not equal as well, doesn't really matter.
00:48:08.639 --> 00:48:11.360
Not behind minus.
00:48:11.519 --> 00:48:13.519
So this isn't even the whole depth, right?
00:48:13.599 --> 00:48:19.199
This is only getting the um this onto with onto the subtraction.
00:48:19.360 --> 00:48:21.360
So this this is missing, I think.
00:48:21.519 --> 00:48:22.239
There we go.
00:48:22.480 --> 00:48:24.639
Now they're all these are all equivalent here.
00:48:25.920 --> 00:48:26.400
Yeah.
00:48:27.599 --> 00:48:31.920
And um do we have another way to do it?
00:48:32.079 --> 00:48:35.920
Well then you just had your late equal not equal fork.
00:48:36.320 --> 00:48:38.480
Yeah, but it's the same, okay.
00:48:38.639 --> 00:48:39.039
Sure.
00:48:39.119 --> 00:48:45.840
So dfork, if you want, which is open parent equal minus unequal.
00:48:48.079 --> 00:48:49.840
Oh, here's another one we can do.
00:48:50.079 --> 00:48:52.400
Can you do something one minus two times?
00:48:52.559 --> 00:48:53.840
I think that works.
00:48:54.159 --> 00:48:59.920
Uh one minus two times the the right side, you mean?
00:49:00.320 --> 00:49:02.960
One minus two times closing equals.
00:49:04.239 --> 00:49:08.159
Yeah, that's just the mathematical way of expressing the same thing.
00:49:08.320 --> 00:49:09.760
One minus is a knot.
00:49:10.000 --> 00:49:12.239
Oh, right, it's just the same one as the knot, yeah, yeah.
00:49:13.679 --> 00:49:15.840
So but yeah, I mean that's that's valid.
00:49:16.000 --> 00:49:25.199
But I just realized now that everywhere we've been doing open for n, that's sort of not very elegant because we know the first character is an open paren.
00:49:25.519 --> 00:49:29.039
So we can actually write write it in a neater fashion.
00:49:29.119 --> 00:49:35.280
If for example, this one, so let's say we have t, we know that the first character t is open for n.
00:49:35.519 --> 00:49:41.679
So we can write uh first unequal to the whole thing, which is a behind.
00:49:41.920 --> 00:49:44.000
Look at this behind here, right?
00:49:44.320 --> 00:49:47.760
And then we do the not behind minus on that.
00:49:48.239 --> 00:49:49.679
Yeah, that's really nice.
00:49:50.000 --> 00:49:54.000
No constants involved, and it works for all types of brackets now.
00:49:54.960 --> 00:49:58.320
That's nice, and then we do the scan and so on.
00:49:59.039 --> 00:50:00.480
I like that better.
00:50:01.519 --> 00:50:13.599
I really want the last primitive because in this one it would be it'll be nice to do uh first and first equals minus the last equals.
00:50:14.000 --> 00:50:16.800
But of course, we could just write first unequals if you want.
00:50:17.199 --> 00:50:18.800
So this is another way to do it.
00:50:19.920 --> 00:50:23.280
All look sort of symmetrical, but this needs parentheses.
00:50:23.760 --> 00:50:29.199
There are many ways of spelling things because these do too many comparisons.
00:50:29.280 --> 00:50:31.119
This this should be the fastest.
00:50:31.280 --> 00:50:33.199
This or with the constant, it doesn't matter.
00:50:33.360 --> 00:50:37.280
Because a Boolean negation on the mask that's going to be very fast.
00:50:38.800 --> 00:50:40.800
So I think I prefer this.
00:50:41.760 --> 00:50:45.039
So that that's one part of the problem is get to the depth vector.
00:50:45.199 --> 00:50:49.039
So far, we haven't come up with any good solutions that doesn't need the depth vector.
00:50:49.280 --> 00:50:52.000
Um, or any solutions that don't need the depth vector.
00:50:52.320 --> 00:50:53.920
And have the house code when you show it.
00:50:54.239 --> 00:50:55.280
Yeah, you want to show it?
00:50:55.440 --> 00:50:55.840
Yeah.
00:50:56.320 --> 00:51:02.719
I just forgot how types work, but uh okay.
00:51:03.679 --> 00:51:06.159
So yeah, it's just basically a fold.
00:51:06.320 --> 00:51:12.400
You keep around the current depth and the result as a state, and then you just fold over the string.
00:51:12.559 --> 00:51:18.719
And so if it's zero and it's opening, then you want to increase the depth but not add anything to string.
00:51:18.880 --> 00:51:22.960
Um, if it's one and it's closing, you want to decrease it and not do anything.
00:51:23.119 --> 00:51:26.639
Otherwise, you just add and increase and decrease based on what it is.
00:51:26.719 --> 00:51:35.840
Uh then you just pick out the the string and you reverse it because you append it instead of yeah, prepend it instead of appending because it's faster, and then you spread.
00:51:36.079 --> 00:51:38.639
You can probably do with a right folder as well, it's probably better.
00:51:38.800 --> 00:51:41.039
You can just do this, I think.
00:51:41.440 --> 00:51:45.679
Uh you don't need to reverse because you're just bending it up the other way.
00:51:45.920 --> 00:51:47.360
That's better.
00:51:48.480 --> 00:51:52.480
But yeah, it's not a good selection, but I think that is how I would approach it in a screen.
00:51:52.960 --> 00:51:54.320
I think this works as well.
00:51:54.960 --> 00:51:56.320
No, uh, whatever.
00:51:56.400 --> 00:51:59.280
Uh because I have to reverse opening and closing it.
00:52:00.800 --> 00:52:04.880
But uh no, I don't think it would look good in any array language.
00:52:05.199 --> 00:52:07.920
Uh yeah.
00:52:08.559 --> 00:52:12.480
I mean so you could I mean I can try writing some tiny.
00:52:14.159 --> 00:52:22.159
Uh so then I want to make a folding string.
00:52:22.480 --> 00:52:24.239
Let's just make a different thing.
00:52:24.559 --> 00:52:34.000
So I want to check if it's you might not want to do it user fold, you might want to use loop over the order elements instead.
00:52:34.159 --> 00:52:34.960
It's easier.
00:52:35.280 --> 00:52:35.920
What do you mean?
00:52:36.880 --> 00:52:38.639
You're just carrying the state, right?
00:52:38.880 --> 00:52:39.119
Yeah.
00:52:39.519 --> 00:52:41.440
So you can just have a state variable.
00:52:42.079 --> 00:52:42.400
Yeah.
00:52:42.639 --> 00:52:45.599
Well, they don't already have a way to do loop so they don't fold in.
00:52:46.559 --> 00:52:51.519
Um I guess you could use uh an LTL, but that's not gonna look good, I think.
00:52:52.159 --> 00:52:57.039
Uh no, there's no good way to just make a loop.
00:53:03.760 --> 00:53:05.920
Let's bring more lines up on some idea.
00:53:08.400 --> 00:53:24.239
Then if it's one and closing then return zero and if it's um there and so I guess oh I can make it side synchronized.
00:53:24.320 --> 00:53:38.719
I think if just return um the first one plus uh I guess minus one omega's closing.
00:53:39.360 --> 00:53:46.159
Uh and another one is going to be uh omega second one.
00:53:51.440 --> 00:53:59.840
Um I don't know.
00:54:00.000 --> 00:54:02.639
But yeah, and it it's definitely not going to be pretty.
00:54:11.519 --> 00:54:16.159
Yeah, I don't know, but yeah, it's definitely worse than the array once.
00:54:16.559 --> 00:54:19.440
But I think there's a good way to spell the array once in Haskell.
00:54:19.840 --> 00:54:22.960
So I think people usually just make this fold.
00:54:23.440 --> 00:54:27.760
Maybe with a boolean like checking for equality first, maybe I would do that.
00:54:28.000 --> 00:54:29.760
So the function's total.
00:54:30.000 --> 00:54:34.639
But other than that, uh yeah, I don't think there's a better way.
00:54:35.199 --> 00:54:38.480
I'm I'm working on some state machine thing.
00:54:38.960 --> 00:54:48.880
Uh I can show you, but on Disney again, not going to be it's not a APLE, yeah, but it's it's more a general purpose thing you can do.
00:54:49.119 --> 00:54:53.119
Uh see the computer gets around to sharing.
00:54:53.840 --> 00:55:07.360
So so here we set up in an initial state, an initial and a result accumulator, and then we do our just use the fork here when passing in the open paren.
00:55:08.159 --> 00:55:09.920
And this is the the whole array.
00:55:10.000 --> 00:55:12.480
So this each is actually looping over the left argument.
00:55:12.960 --> 00:55:13.199
All right.
00:55:13.840 --> 00:55:16.400
Um and just passing that in.
00:55:16.639 --> 00:55:28.000
So if we so if the equal minus minus unequal, that's the what we what we did before, and and then we're testing the state.
00:55:28.079 --> 00:55:42.719
So if if the state is zero, um again, if the current state and the current character is zero and open paren, then uh we want to eliminate it.
00:55:43.280 --> 00:55:48.000
So which means if they so this is eliminate, we're just gonna write that for now.
00:55:48.239 --> 00:55:54.239
And the other case is if the state, oh, it's not you, it's one here.
00:55:54.639 --> 00:56:02.159
And if the state and the left argument is a zero and a closing paren, that's where we should write this out.
00:56:02.639 --> 00:56:04.880
It's going to be selected like this.
00:56:08.159 --> 00:56:17.840
Okay, so if the state and the um and the current character that is one and open paren, we want to eliminate it.
00:56:18.000 --> 00:56:27.039
If the state is um and the current character is a zero and a closing paren, we want to eliminate it.
00:56:27.199 --> 00:56:34.880
So now we can say if this is a member of one of these two, then we want to eliminate it.
00:56:35.280 --> 00:56:41.360
Which means we can take this and we can especially use it behind there, just for good order.
00:56:41.599 --> 00:56:48.880
Which means if one of those are true, we want to drop from the current character that we're dealing with.
00:56:49.360 --> 00:56:56.000
And I think we don't even need to, we don't even need to update an accumulator there because this just gives the budget.
00:56:56.239 --> 00:56:57.440
There's empty vectors and nuts.
00:56:57.599 --> 00:56:59.519
Now we just enlist that.
00:56:59.599 --> 00:57:00.960
So that works.
00:57:01.199 --> 00:57:12.079
I suppose that's sort of philosophically sticking the same thing that you're doing in NASCAR, even though here I'm carrying it an outer state, so muting this, but yeah.
00:57:12.320 --> 00:57:14.480
So I suppose we could do this.
00:57:15.119 --> 00:57:17.760
Uh yeah, we could do this as a reduction.
00:57:18.079 --> 00:57:22.639
It's going to be the same thing, but it's just going to be more complicated to keep track of things.
00:57:22.880 --> 00:57:24.800
Also, this is completely unreadable.
00:57:24.960 --> 00:57:28.719
But actually, we can we can state some logic, right?
00:57:28.800 --> 00:57:38.800
If it's yeah, if it's a one and open paren, a zero and close paren, that's the same thing as saying that it's equal to the open paren, right?
00:57:39.039 --> 00:57:41.280
No, because it's not a movie.
00:57:42.400 --> 00:57:42.880
Yeah.
00:57:43.280 --> 00:57:50.639
We could we could separate this out and say if uh if d is less than or equal to to one.
00:57:51.280 --> 00:57:57.280
You could probably do the index of d in one zero is equal to the index of omega in open close.
00:57:57.519 --> 00:58:00.400
No, because that no, I think that's good.
00:58:00.639 --> 00:58:02.079
Oh, but we could say this, right?
00:58:02.239 --> 00:58:07.199
It's we can we only want to eliminate it if d is less than or equal to zero.
00:58:07.519 --> 00:58:07.920
Yeah.
00:58:08.159 --> 00:58:11.199
And we also want to eliminate it.
00:58:11.280 --> 00:58:17.599
The other criteria is that yeah, we can that doesn't really work, right?
00:58:18.079 --> 00:58:18.639
Oh, right.
00:58:18.719 --> 00:58:22.559
The other criteria is that b equals this is fun.
00:58:22.800 --> 00:58:24.639
Omega equals open brand.
00:58:26.960 --> 00:58:27.360
That's fun.
00:58:29.119 --> 00:58:36.800
You don't need the less than or equal to one, because then it's definitely going to be false if because these are yeah, if d is true right, then it can't be true, right?
00:58:36.960 --> 00:58:37.440
Yeah, exactly.
00:58:37.599 --> 00:58:38.639
So so it has to be.
00:58:38.719 --> 00:58:39.679
That's the only case.
00:58:39.920 --> 00:58:40.800
So there we go.
00:58:40.960 --> 00:58:41.679
That's nice.
00:58:41.840 --> 00:58:45.280
Which means there's only one there's only one D left.
00:58:45.599 --> 00:58:47.760
Uh yeah, well, we have that.
00:58:47.840 --> 00:58:48.320
Yeah.
00:58:48.639 --> 00:58:49.360
That's nice.
00:58:49.519 --> 00:58:51.360
We could do an something very unusual.
00:58:51.440 --> 00:58:52.960
We could do an equal reduction.
00:58:53.599 --> 00:58:56.079
That doesn't it's not shorter, but it's cute.
00:58:57.119 --> 00:59:01.039
And this one we can go back to what we had before.
00:59:02.559 --> 00:59:03.199
Shorter.
00:59:03.519 --> 00:59:04.880
Oh, did we make a mistake?
00:59:05.119 --> 00:59:06.559
Has to be a closing card, yeah.
00:59:06.960 --> 00:59:08.079
Or unequal.
00:59:08.320 --> 00:59:12.239
Yeah, or you put the negation on the other side, but then you need the self.
00:59:13.119 --> 00:59:14.639
Yeah, self reading dialogue.
00:59:14.800 --> 00:59:15.119
Yeah.
00:59:15.280 --> 00:59:17.440
Yeah, so this is this is a real state machine.
00:59:17.760 --> 00:59:19.039
This is the state, the depth.
00:59:19.119 --> 00:59:25.840
We're updating the depth as we as we go along using our one of our many methods of of doing this.
00:59:26.079 --> 00:59:28.880
Um, and then you know we do it.
00:59:28.960 --> 00:59:32.239
But I mean, this drop thing is a bit of a a bit cheating.
00:59:32.400 --> 00:59:40.079
Like really, what we should do here is we should say um we should collect instead.
00:59:40.320 --> 00:59:47.119
Either we can have an accumulator, so we'll put that in here, and then we say r, comma, gets that.
00:59:47.280 --> 00:59:56.480
Then we don't need to do the the in list, that's a more general solution, or we can uh get the mask out.
00:59:56.719 --> 01:00:05.280
I mean so we just we just want to find out what what the mask is here, so and add to the mask.
01:00:05.599 --> 01:00:07.199
These are the ones we want.
01:00:07.280 --> 01:00:08.400
This is the opposite, right?
01:00:08.559 --> 01:00:10.400
Because of the quality here.
01:00:10.559 --> 01:00:11.760
Um that's fine.
01:00:11.920 --> 01:00:15.519
We could flip the nut, or we can do some clever things here.
01:00:15.599 --> 01:00:17.760
So I think we have to do like this.
01:00:17.920 --> 01:00:18.719
There you go.
01:00:18.960 --> 01:00:20.639
And now we can use the mask.
01:00:21.920 --> 01:00:27.360
That's a state and um accumulator.
01:00:27.920 --> 01:00:35.760
Yeah, I mean you don't really need um we just return the boolean from the eek.
01:00:36.159 --> 01:00:36.800
Oh yeah.
01:00:37.199 --> 01:00:38.480
Of course, we have that here.
01:00:38.719 --> 01:00:39.920
Of course, send me.
01:00:40.320 --> 01:00:43.920
So this gives us the Boolean, and we could just do that.
01:00:44.400 --> 01:00:46.880
We don't need to satisfy them at all.
01:00:47.840 --> 01:00:50.239
Which means we can do it behind.
01:00:55.840 --> 01:00:59.280
Yeah, I mean it's not good, but it's neat, I guess.
01:00:59.519 --> 01:01:02.000
Yeah, yeah, it's going to have horrible performance.
01:01:02.320 --> 01:01:09.920
Now I'm thinking now I'm thinking instead of initializing D like this and having like nested, what if we can we do this?
01:01:10.079 --> 01:01:11.760
Can we store a state?
01:01:12.239 --> 01:01:20.559
We start start with a state of zero and we use a function that lives inside here, and we update D as we go along.
01:01:21.360 --> 01:01:22.159
That works.
01:01:22.400 --> 01:01:23.039
Yeah, sure.
01:01:23.280 --> 01:01:26.719
But you can only use the function once, and you have to reset it.
01:01:27.199 --> 01:01:28.000
Oh right.
01:01:28.559 --> 01:01:30.880
Well, no, it can't be zero at the end, is it not?
01:01:31.039 --> 01:01:32.559
If the string is valid.
01:01:33.039 --> 01:01:36.239
Oh uh yeah, we live yeah, you're right.
01:01:36.400 --> 01:01:37.920
Uh it happens to be that it works.
01:01:38.000 --> 01:01:39.840
Yeah, so we can actually use this.
01:01:40.719 --> 01:01:43.760
Yeah, you can say it resets itself when it's done.
01:01:43.920 --> 01:01:45.519
Very nice of it to do that.
01:01:45.760 --> 01:01:47.519
Carla, you're following what how this works?
01:01:47.599 --> 01:01:50.400
This is using lots of interesting features, you would say.
01:01:51.280 --> 01:01:52.079
Uh not really.
01:01:52.239 --> 01:01:52.719
Go ahead.
01:01:52.800 --> 01:01:55.840
And uh we lost Carlos.
01:01:56.239 --> 01:01:59.679
Okay, so so this is a behind, right?
01:01:59.840 --> 01:02:11.599
Where we uh this is a classic or oft-repeated pattern by me, where we are have a function that is in that computes a mask, and then we're using that to filter.
01:02:11.760 --> 01:02:14.079
So filtered by this function.
01:02:14.320 --> 01:02:22.400
Now, this function, which is here, uh well, actually the whole function is here, but we're going to apply it to each character.
01:02:22.639 --> 01:02:29.280
And the function lives inside a namespace that at definition time had a single member D that is zero.
01:02:29.440 --> 01:02:30.960
So it's an object, right?
01:02:31.199 --> 01:02:31.840
A state.
01:02:32.000 --> 01:02:35.440
But this object, this state is not observable outside of f.
01:02:35.519 --> 01:02:41.840
There's no way to access it whatever, other than like doing a memory dump, something like that, looking at what's in memory of the computer.
01:02:42.079 --> 01:02:45.599
So this function operates inside this namespace.
01:02:45.760 --> 01:02:50.960
So when it refers to D, it's the D that's inside this namespace, and it mutates that.
01:02:51.280 --> 01:02:55.360
So we're using our formula from before to update the state.
01:02:55.440 --> 01:03:05.840
This is the same, this effectively for every character gives us the the running sum of uh the subtraction of the auto product and that we did before.
01:03:06.000 --> 01:03:09.599
But we only entered it for every character in the state at that point.
01:03:09.840 --> 01:03:17.440
So we we update the state for this character, and then we do this little bit of clever thing here.
01:03:17.519 --> 01:03:19.679
Uh we I can expand this again.
01:03:20.079 --> 01:03:23.280
D is different from this equals this.
01:03:23.840 --> 01:03:29.119
Right, then we say this is the current character an open paren.
01:03:30.480 --> 01:03:37.199
Then we want to keep it only if the current state, so that's a one, only if the current state is not a one.
01:03:38.159 --> 01:03:40.800
A one with an open parent, that's what we want to eliminate.
01:03:41.039 --> 01:03:55.199
And if it's this highlighted part here, if the right argument, the current character is a closed parent, like this gives zero, then we only want to keep it uh if the current state is not zero.
01:03:55.280 --> 01:04:02.079
Because if you have a closed parent at state zero, that's zero, then that's what we that's an outer one, and we want to eliminate that.
01:04:02.159 --> 01:04:07.039
So this gives us a Boolean mask for every character, whether or not we want to keep that.
01:04:07.679 --> 01:04:23.119
And as Madeline correctly pointed out, where we know that everything is well balanced in a string, which means that when we reach the very last character, which will be a closing parent, and will be eliminated, and then the state, the depth state is back to zero.
01:04:23.280 --> 01:04:32.159
Because we always increase the depth nesting depth and go back again to zero scheme, which means that the function is ready for the next invocation.
01:04:32.480 --> 01:04:40.800
Now, if you run two of these in parallel, then they might get might get mixed up because they have the same state.
01:04:40.960 --> 01:04:43.920
Uh I'm not sure if we can induce that, but maybe.
01:04:44.639 --> 01:04:45.360
I think so.
01:04:45.599 --> 01:04:48.000
I think we can actually force that to happen.
01:04:48.159 --> 01:04:52.320
So if you do like T and we'll make another one.
01:04:54.639 --> 01:05:03.840
T2, like this, and then we can do if you run F in the background on T, that should print.
01:05:03.920 --> 01:05:06.800
Yeah, and F in the background of T2, that's fine.
01:05:06.880 --> 01:05:13.679
So if you run it on both, oh sorry, I'm gonna call it that still works because it does the whole run.
01:05:13.920 --> 01:05:22.480
But if we redefine this to insert a delay of like a tenth of a second or something, then they could possibly get out of sync.
01:05:22.880 --> 01:05:24.000
I think, yeah.
01:05:24.239 --> 01:05:30.320
Now we get a messed up result because they they stump on each other's state, statefulness is bad.
01:05:31.679 --> 01:05:37.119
This reminds me of the quote just because you can doesn't mean you should.
01:05:37.440 --> 01:05:37.760
No.
01:05:39.360 --> 01:05:39.760
Absolutely.
01:05:40.400 --> 01:05:43.360
This is not how you're supposed to do it in an array language.
01:05:44.159 --> 01:05:51.039
But there are things that are not easily done within just by computing vectors and going on.
01:05:51.119 --> 01:05:53.920
Sometimes you do need to compute a state as you go along.
01:05:54.000 --> 01:05:55.519
And then this is sort of a general method.
01:05:55.840 --> 01:05:59.760
I'm not sure you should do it with a namespace, but what we did before, when we set it up.
01:06:08.480 --> 01:06:10.559
This is a general way to do it in every language.
01:06:13.199 --> 01:06:17.599
It does require mutating things at least in a global variable.
01:06:22.480 --> 01:06:26.719
Alright, last thing while we wind down, you should take a look at the caps.
01:06:26.800 --> 01:06:34.480
I converted your APLs dialog APL solution to a cap solution using the using three different behinds.
01:06:34.639 --> 01:06:38.559
Uh the links in the bottom of the YouTube chat.
01:06:38.960 --> 01:06:41.920
That's uh this one coming up over here.
01:06:42.960 --> 01:06:44.000
Oh look at that.
01:06:44.320 --> 01:06:45.199
Emoji rendering.
01:06:46.719 --> 01:06:47.280
What?
01:06:47.599 --> 01:06:48.639
That's the old one, I think.
01:06:48.800 --> 01:06:49.360
That's the old one.
01:06:50.239 --> 01:06:50.880
There's a new one?
01:06:51.119 --> 01:06:51.920
There's a new one.
01:06:52.239 --> 01:06:55.119
Oh looks the chat did not date for me.
01:06:56.159 --> 01:07:02.239
Maybe I haven't been seeing people's comments and things, because I don't see I don't see anything since you wrote the cap is very beautiful.
01:07:02.480 --> 01:07:08.239
Uh here, let me I can message and mess up our live stream the chat, and then you can click on it there.
01:07:08.559 --> 01:07:09.440
Or you can just share.
01:07:10.000 --> 01:07:15.280
Uh I could, but that would risk it's coming.
01:07:15.360 --> 01:07:15.920
It's on the way.
01:07:16.159 --> 01:07:17.280
It's in cyberspace.
01:07:17.519 --> 01:07:18.639
No messages yet.
01:07:20.719 --> 01:07:21.440
Oh yeah.
01:07:21.679 --> 01:07:26.800
I was gonna say I guess I could've just read to you the four character hash code.
01:07:27.599 --> 01:07:28.239
Yes.
01:07:28.800 --> 01:07:30.159
But so this is the one?
01:07:30.480 --> 01:07:30.719
Yeah.
01:07:30.880 --> 01:07:38.800
Well it hasn't it hasn't updated because there's something about the URLs, because it looks like an ID, uh it tries to jump to that heading.
01:07:38.880 --> 01:07:41.519
So I think I have to put it like a new window for it to work.
01:07:41.679 --> 01:07:44.559
That might be a deficiency in the design of a RainBox.
01:07:45.119 --> 01:07:46.639
Is that really how it works?
01:07:47.039 --> 01:07:54.960
Because you're using a hash there instead of just using a slash or some other character, and you're using it to read, then you can't switch it when you're on already on the page.
01:07:55.119 --> 01:07:58.880
The browser thinks, oh, you just want to jump to a different location in the same document.
01:08:00.079 --> 01:08:04.639
Wow, that emoji rendering is so aggressive compared to my emoji rendering.
01:08:04.880 --> 01:08:07.760
Mine's very I think mine's the iPhone soft.
01:08:07.920 --> 01:08:09.360
Yours is like the Microsoft software.
01:08:09.840 --> 01:08:12.480
Depends on the operating system and the browser and so on.
01:08:12.719 --> 01:08:24.640
Well here actually, I this is the beauty of uh I can I can drag and drop my little thing so people that's that's my emoji, which is m much cuter than uh the Microsoft 3D one.
01:08:24.800 --> 01:08:28.720
Anyways, this is the You just need to add the emojis to 37, I think.
01:08:29.119 --> 01:08:29.520
Sorry?
01:08:30.239 --> 01:08:32.479
We just have to add the mojis to APL37.
01:08:32.800 --> 01:08:33.600
Yeah, yeah.
01:08:33.840 --> 01:08:36.399
Well, we do do we agree on which rendering though?
01:08:36.479 --> 01:08:44.239
It's probably uh No, then the what we just compose them all with little bases.
01:08:45.039 --> 01:08:48.720
If if it was then they should be like line line drawing art.
01:08:50.399 --> 01:09:08.800
Honestly, it's obviously you were joking when you you said that, but there's actually something uh behind using uh APL glyphs to render, like you know, you got a f four different glyphs to render uh the different you know, you can do all of them to be too much work, but you could do a few.
01:09:09.119 --> 01:09:20.720
Uh anyways, this is yes, the dialogue APL converted to cap, which is a little confusing because they switch up some of the symbols on you, so it it makes it a little bit harder to read.
01:09:20.960 --> 01:09:24.000
Yeah, so this is this is the uh the petitioning thing.
01:09:24.239 --> 01:09:27.680
If you hit F1, hit F1, it's beautiful, beautiful.
01:09:27.920 --> 01:09:29.039
Look at that, folks.
01:09:29.359 --> 01:09:29.840
Look at that.
01:09:30.159 --> 01:09:30.720
Petition, right?
01:09:30.800 --> 01:09:34.479
So it uses the AP uh APL2 uh pairing of glyphs.
01:09:35.680 --> 01:09:37.359
So and this is first, right?
01:09:37.439 --> 01:09:39.600
That's for the same reason as an APL2.
01:09:39.920 --> 01:09:42.479
We could make it look the same in dialogue if you wanted.
01:09:42.720 --> 01:09:46.239
So yeah, that's this is exactly the same, right?
01:09:46.479 --> 01:09:46.640
Yeah.
01:09:46.960 --> 01:09:49.039
It's literally just no.
01:09:49.279 --> 01:09:50.880
Oh, this is tail, right?
01:09:51.039 --> 01:09:51.520
Yeah.
01:09:51.920 --> 01:09:52.239
Yeah.
01:09:52.479 --> 01:09:56.960
I thought it was called behead, but I think it's only called behead in J.
01:09:57.520 --> 01:09:59.279
But in in the in the ducks.
01:09:59.760 --> 01:10:06.960
Uh no, I think it's confused because your cursor is to the left of each, but if you just put it to I don't know, that is actually a bug.
01:10:07.039 --> 01:10:08.800
That should be highlighting drop first.
01:10:09.039 --> 01:10:11.279
Um first.
01:10:11.760 --> 01:10:12.640
Although interesting.
01:10:12.720 --> 01:10:14.399
Actually, let's diagnose this bug.
01:10:14.560 --> 01:10:19.279
Put your cursor to the right and then shift left, and maybe that's what it is.
01:10:19.359 --> 01:10:20.560
So it reads the cursor.
01:10:20.960 --> 01:10:22.239
That's oh that's what I did.
01:10:22.640 --> 01:10:23.439
That's really wrong.
01:10:23.600 --> 01:10:26.159
It forgets to look at the direction of the selection or something.
01:10:26.239 --> 01:10:28.560
But in anyway, if something is selected, it should go by the selection.
01:10:28.720 --> 01:10:29.359
Don't care about the code.
01:10:29.600 --> 01:10:30.479
It's supposed to work that way.
01:10:30.560 --> 01:10:31.520
I don't know what it's doing.
01:10:31.760 --> 01:10:33.279
I'll file a bug on my own repo.
01:10:33.920 --> 01:10:35.680
You didn't you didn't write the code, right?
01:10:36.319 --> 01:10:39.279
No one needs to write the code any day any anymore, you know.
01:10:39.439 --> 01:10:46.399
We're we're all just handcrafting uh APL code now, but the rest of it, if it's JavaScript, send it to the AI.
01:10:46.720 --> 01:10:49.119
So having drop first does the trick here.
01:10:50.399 --> 01:10:51.760
Yeah, that's what I was also thinking.
01:10:52.000 --> 01:10:55.760
I wasn't gonna code this one up, but then I was like, oh wait, doesn't uh cap have behead?
01:10:55.920 --> 01:10:58.319
Uh and you have that in tiny apple?
01:10:58.399 --> 01:10:59.119
Yeah, no.
01:10:59.760 --> 01:11:00.319
Ooh.
01:11:01.680 --> 01:11:04.239
A missing primitive, a missing primitive.
01:11:05.039 --> 01:11:08.720
The people demand all the primitives in Tiny Apple.
01:11:10.239 --> 01:11:11.840
Even Jay has behead.
01:11:11.920 --> 01:11:12.159
Yeah.
01:11:12.319 --> 01:11:15.680
Well, I thought that's the other one which is nighter, the minus one drop.
01:11:15.760 --> 01:11:17.279
I use that one more than one drop.
01:11:18.079 --> 01:11:18.560
Kurtel.
01:11:18.800 --> 01:11:19.600
Yeah, Curtel.
01:11:20.000 --> 01:11:20.319
Interesting.
01:11:21.840 --> 01:11:23.279
Here's a last question too.
01:11:23.359 --> 01:11:26.880
Is is oh I think it's a Google, I think it's a Google Share.
01:11:26.960 --> 01:11:37.119
I was gonna say there was like a slight Phantom help uh doc that I could see, but I I think it was uh the screen sharing software and not actually the website.
01:11:37.279 --> 01:11:39.199
Um anyways.
01:11:39.600 --> 01:11:40.000
Alright.
01:11:40.159 --> 01:11:42.319
This is this has been fun.
01:11:42.560 --> 01:11:45.680
Uh thanks to Marble Coma.
01:11:45.840 --> 01:11:48.079
Oh, uh my my chat's gone.
01:11:48.319 --> 01:11:49.039
Oh, there it is.
01:11:49.119 --> 01:11:57.840
Thanks to Marble Coma for sharing their uh Weevost solutions, and thanks to Madeline for coming on and showing us not only Tiny Apple, but also Haskell.
01:11:57.920 --> 01:11:59.279
Like I said, a first folks.
01:11:59.439 --> 01:12:06.159
That's why we need to grow the panel so we can get more functional languages on this array programming podcast.
01:12:06.479 --> 01:12:12.479
Any uh any last things uh to be said, to be to be done?
01:12:12.640 --> 01:12:14.560
If not, going once, going twice.
01:12:14.720 --> 01:12:17.600
With that, we will say happy array programming.