« first day (1426 days earlier)      last day (1525 days later) » 

ngn
ngn
18:03
@xpqz btw, i read your day19 but i think i'd better try to solve it without regex
@ngn yeah, regexing bypass a lot of difficulty, I think. Although the problem seemed tailor-made for it.
ngn
ngn
@xpqz do the loops in part2 imply a context-free grammar, or is it still a regular grammar? i forget what we studied at uni, it was too long ago..
What do # and ## mean in Dyalog? Something to do with the current namespace?
@ngn Thanks
@user Do you know you can type things like these, then hit the F1 key?
Cool, I didn't know that
Alternatively, you can enter ]help thing
Nice! That's going to make life a lot easier.
18:22
Even APLcart could give a hint here (and link to documentation) even if that isn't its main purpose.
Thanks, that's really useful.
By the way, is there some sort of builtin to show an array as a string so I can execute it and get it back again?
ngn
ngn
@user excellent question! :D
@user ⎕SE.Dyalog.Utils.repObj
ngn
ngn
@user i've been arguing for a long time that that should be the default output format
Hm, maybe I should various bundled utils to APLcart…
18:25
@Adám Thanks! This just saved me a ton of work!
Looks like SE has a ton of other useful stuff too.
i wrote my first program with a custom APL dialect
⎕(+-|⍨)¨2⍫4
What does do?
range, this one generates 2 3 4
Why not ?
one byte shorter than 1+i3
… would be much better here, yeah
18:28
That's what Extended and dzaima use.
ngn
ngn
range end should be exclusive
@ngn I like my range ends inclusive
ngn
ngn
i can't argue against that
@ngn Does TMN's {a, a+1, a+2, … , n} include n?
ngn
ngn
18:34
@Adám is that an argument for end-inclusiveness?
Yes.
ngn
ngn
@Adám then does {a, a+1, a+2, ..., n-1} include n?
No. So in APL should a…n-1 include n? How about a…n?
ngn
ngn
does ⍳n include n (⎕io←0 assumed)? in a triganle rendered for computer graphics, why do the rightmost pixels not get rendered?
is not . Not sure what the triangle has to do with anything.
ngn
ngn
18:37
think of dyadic ⍸. do the ranges ⍸ splits the integers into have their rightmost ends?
The rightmost (possibly only) one does. Since there's only one range here too, it should too.
ngn
ngn
the point i'm trying to get across is that a sequence of ranges: range(a[i], a[i+1]), range(a[i+1], a[i+2]), etc shouldn't overlap, otherwise there's a lot of +1 / -1 like with ⎕io←1
In Extended, they don't: 3…7…1 has no duplicates.
@Adám that's a completely separate thing
ngn
ngn
@Adám idk what that means
18:40
(fwiw i do remember needing to do an ugly 2…∘(-∘1)/ a couple times)
ngn
ngn
@Adám but
Now that monadic is gone, who's for monadic < and > as decrement and increment?
@ngn Surely. It returns the answer most people would expect, methinks.
ngn
ngn
@Adám and 10 is a dupe
@ngn The two ranges are unrelated.
ngn
ngn
18:43
ok, i've made my point
@Adám but if they are, the dupe is annoying
@Adám again, the question is about separate ranges. also that example is entirely pointless afaict
With < as decrement, …∘< wouldn't be so bad. Neither would …∘> of course, but I think is more intuitive as-is.
ngn
ngn
@Adám dyalog is getting fat. you add something - you should remove something, i think.
18:49
I refuse to have this discussion again. Waste of time.
However, I very much agree that a new clean implementation (see starboard) should have a rationalised vocabulary.
ngn
ngn
@Adám yes, i *-ed that too :)
github.com/rak1507/Advent-Of-Code-2020-APL/blob/main/… I did day 21, do you have an APL solution @ngn (or anyone else)
ngn
ngn
@rak1507 only k but with comments. i'm lagging behind with the translations to apl, and i'll probably never catch up as the problems are getting harder.
yeah they really are, had a look at 19 and 20 and they look pretty tough, will tackle them just now
x^x^y the only bit of k code I can understand!
ngn
ngn
i still haven't solved 19 in a satisfactory way
18:53
your code looks a lot simpler than my APL
ngn
ngn
@rak1507 i'll have to read yours carefully before i can judge
there was another problem where I used a similar thing, 16
random results of searching for … in my files:
https://dzaima.github.io/paste/#0VVJNb9NAEL3nVwy9dBe79a7bSMmhiIa0aZw2/IFenOCkRold2a4AtZUQIJSaGPWCUgkhobZATnDol1SpQkp@CftLeOuAEJZlz7zdmffm7Qbq7XGR1Ls31O4jDFbU0elkvDdDWgRILwx/tnKEqWFqmWo4sPi@YR0wFhiST29UNkZZu8UXDGsyZkK9/BrwlV/HVzptt9TgG2KVXR3qrFAoqPcf6o/RWuRNO4gYuzcdqcGJyi6kwVV2rtIzUsM71BEzLRCnr@6p7FKlp1j9aHKuseGdxlX2Ha/gpgTv5Afq87ZSCAGincTve3MdKs@BmO0zBjVLZXX0mSPIE1sdnf9NpF16wMFwa0CuSs/l8qZKv@imaLUKdfOVrXVnw3Ga9U2nuqE/NWdtzWk2nEaj6VTrjUa1UnOcWq3yqFJtNquNdTyrzfr8IayAj3oAZmuHigKkJ4tmSSdSCu1L9ome7sUJRW7wJOxTECYeJSHFXq9TgIi8Dl8dz8pKukwfnK1ljjFLdjnjG
Looking back, I actually used exactly the same code, apart from the variable name
ngn
ngn
ugh.. ⎕io=1 :( i wasted a few minutes wondering what's wrong :)
19:02
haha
would be independent of ⎕IO if I used ⊃∘⌽¨ instead of 2⊃¨ or something
In a rationalised APL, ⎕IO would definitely need to go… Cue discussion on what it should be.
ngn
ngn
i'd recommend just using 0 but @Adám would probably attack that :)
split the difference and make it 0.5
Yeah.
ngn
ngn
19:04
what i call the "solomonian solution"
What's that a reference to
@ngn That's a misrepresentation of the Bible.
The Judgement of Solomon is a story from the Hebrew Bible in which King Solomon of Israel ruled between two women both claiming to be the mother of a child. Solomon revealed their true feelings and relationship to the child by suggesting the baby be cut in two, each woman to receive half. With this strategy, he was able to discern the non-mother as the woman who entirely approved of this proposal, while the actual mother begged that the sword might be sheathed and the child committed to the care of her rival. Some consider this approach to justice an archetypal example of an impartial judge...
ngn
ngn
@Adám why misrepresentation? the article does say he was "suggesting the baby be cut in two"
afaicr the bible says that too
@ngn Yes, but that was only to get the true mother to react with "better a suboptimal outcome rather than something that is bad for everyone".
Having 0.5 or variable ⎕IO is bad for everyone.
He never actually intended to cut the baby.
ngn
ngn
19:08
@Adám well, exactly. i don't think anybody's seriously suggesting ⎕io←.5
no but ⎕IO←2 on the other hand...
@ngn No, but clearly some thought a variable ⎕IO was a good idea. Acording to Solomon, the true APLer (?) should have been content with a suboptimal fixed origin.
ngn
ngn
i want 0. only 0. i'm not a true apler, i guess
What if there was no way of directly indexing and ⎕IO became unnecessary anyway
Hm, an APL without indexing. So you'd only use ⊃⍤⌽ etc?
And things that now return indices would return bit masks?
19:12
Ah yeah I forgot about things like ⍒, oh well
is there a smart way of summing in a diagonal line in a matrix? for example, for 3 3⍴⍳9 it should return 15
+/1 1⍉m
why? it works
ngn
ngn
+/0 0⍉m
hehe
@KamilaSzewczyk Did you try APLcart?
19:13
^ I accidentally had ⎕IO←0 and thought it didn't work
ngn
ngn
:P :D
hm I may have missed that one
Whoever added )ORIGIN really did APL a disservice. Better fixed ⎕IO←1 than this mess.
+/m⍉⍨2⍴⎕IO
or how about ordinals are a separate numerical tower (just as characters are in BQN)? :p
19:14
+/m⍉⍨⊃⍳1 1
@Adám what does )ORIGIN do
it spews out Incorrect command for me
ngn
ngn
@rak1507 in your solution: ⍵/⍨1-⍨2×.. could be ⍵×[2].. or something equivalent with rank (⍤)
@KamilaSzewczyk It was the way to set the index origin before the invention of quad-names. It isn't included in modern implementations.
Notice that almost all )commands have quad-name equivalents. The )commands are mostly kept for backwards compatibility, and a little bit of convenience.
the fact that ⎕IO doesn't accept rationals is kind of disappointing
I always wanted to index from 3.14
@dzaima Didn't dzaima accept all numbers for ⎕IO at some point?
19:16
@ngn hmm yeah
@KamilaSzewczyk Try it online!
@Adám it did (but some builtins would assume it was just 0 or 1 (or an integer))
@Adám i kind of knew that, because I've seen 'a'...'z' working
but I was thinking more of vanilla APL and having the rational index origin affect everything like the normal index origin does
I wish there was a more straightforward way to map 0 1 to ¯1 1, I find it to be very useful a lot of the time
at least I can do ⎕IO←2 :)
19:18
One problem would be what value to use where we currently use fractional indices. Integers?
ngn
ngn
@rak1507 -¯1*
oh that's clever, thank you
simplifies a bunch of my desmos graphs as well!
ngn
ngn
@rak1507 common golfing trick
Common in production code too.
I used that in code I just wrote last week, for the 2021 competition.
@rak1507 I'll add it to APLcart.
2021 competition 👀
I'm going to try and get some of my friends to sign up to it but I'm not sure how enthusiastic they will be
19:22
This rounds features sanity test of phase II submissions.
Like online submission? Cool
How does that work with multi line dfns?
What's the problem?
@rak1507 back when the 2020 competition started I didn't know APL pretty much at all, but I plan on trying it out next year
ngn
ngn
@rak1507 you know how many people i've managed to interest in apl? 0.
I interested two people in J
19:23
I was thinking if you used the same thing for phase 1 there might not be enough space to fit it in, but I suppose other text boxes exist
@ngn :( lets hope I can have some better luck
maybe the 'you can win money!!!' thing might appeal to them
No more generation of a giant namespace script to upload. There'll be a multi-line text input area which you can paste into, drag-and drop a file onto, or click a button to upload a file which will then populate the input area.
That sounds way better
ngn
ngn
@KamilaSzewczyk that's great
@ngn I think maybe 5 or so people have tried APL to the extent of doing a tiny amount of stuff in tryapl or whatever, with something more solid to work towards I think 2/3 people doing the competition would be optimistic but achievable
ngn
ngn
@rak1507 oh, from the competition, right
19:27
While we won't run the submissions against test cases, we will analyse what you submit to see if the required functions are present and support the required calling syntax.
So users are still expected to test stuff themselves? Fair enough
For phase II, yes, as it is intended to be a bit more like "work" or a project IRL.
Only downside is that your top level functions must be explicit, but you can always wrap a derived function.
What does that mean, the final functions can't be composed?
@rak1507 Btw, you may benefit from phrasing it as ¯1*~
Ah yeah nice then I can use ≠ instead of =
Although ngn suggested doing it differently anyway
19:31
@rak1507 ?
16 mins ago, by ngn
@rak1507 in your solution: ⍵/⍨1-⍨2×.. could be ⍵×[2].. or something equivalent with rank (⍤)
ngn
ngn
@rak1507 another suggestion in part2: ⊃{⍺,',',⍵}/ -> 1↓∊',',¨
@dzaima Am I drunk?
@Adám :D
ngn
ngn
lol
19:35
@ngn ah yeah that's clever but I prefer being able to visually tell that it's being joined
ngn
ngn
@rak1507 ok. btw, k has "separator"\ and "separator"/ for split and join. i miss them in apl.
that's nice
20:05
Any feedback?
good, except for too many pixels
I like the color
do you have a vector version?
Yeah.
@Wezl The ones spelling "APL"? Can I lower the count?
no, it was a joke
Oh.
but actually yeah, you can remove the second row from the top
20:17
Closing the gaps in A and P?
 #  ### #
### ### #
# # #   ###
That's pretty unreadable.
## ## #
## #  ## :)
I could offset the horizontal middle part of A and P half a pixel down, but that breaks the parallel a Boolean array.
(unless that implies double resolution)
don't bother
20:22
But APL handles non-square matrices just fine.
how come (,'a')∊,¨'ab' is false?
@rak1507 you probably want (⊂,'a')∊,¨'ab'
Yep, thanks
@rak1507 Because treats its arguments as collections, so it looks at elements of each, and the elements of ,'a' are just 'a' which doesn't occur in the right argument.
ngn
ngn
21:25
my favourite for now:
Nice! here's my modified version:
ngn
ngn
gliders :)
it kind of spoils the simplicity
ngn
ngn
@Wezl if it makes it more likable for more people, it's fine
we should make a poll or something to measure popularity
the backround squares could represent some value in binary, right now they mean nothing
22:31
hey @Adám can we continue tommorow?
I finish my semester tommorow with a physics exam and I'll have one month of holidays, seems like a good amount of time to learn more APL
can anyone think of a nice way of generating all ways of choosing n from k
so given 2 5 it'd return (1 2)(1 3)(1 4)(1 5)(2 3)(2 4)(2 5)(3 4)(3 5)(4 5)
3 5 would be (1 2 3)(1 2 4)...(3 4 5)
@rak1507 dfns.cmat
Ah, shows up in APLcart for 'combination' but not for 'combinations' (@Adám)
thanks
22:52
is "shriek" a known term in apl? it's used throughout the src code of apl\360 for "!"
@ktye APLCart and Dyalog help know about it but I definitely didn't
23:20
@rak1507 Fixed.
@ktye Yes, fairly common name among old-timers. Works with RIDE's `` input too.
@Konrad'Unrooted'Klawikowski Sure.

« first day (1426 days earlier)      last day (1525 days later) »