« first day (1351 days earlier)      last day (1293 days later) » 

12:06 PM
Is there a name people use for split-transpose-mix ↓⍉↑?
 
@xpqz I informally call it (nested) transpose (of a vector of vectors).
 
RGS
@xpqz I call it remix, but that's just for myself hehe
 
@RGS remix! that's genius.
 
I've now added that synonym to APLcart
@xpqz "Zip"
 
RGS
@Adám ah that's a good one
The zip function in Python kind of does what ↓⍉↑ does
 
12:18 PM
Not quite py-zip -- isn't that more like
{(⊂⍋∊⍳∘≢¨⍺ ⍵)⌷⍺⍪⍵}
 
@xpqz I.e. if lengths don't match, then unmatched elements become trailing.
 
@Adám Yeah, had to remind myself. Py's zip will only line up elemets to the shortest vector:
>>> list(zip([1,2,3,4,5],['a','b','c']))
[(1, 'a'), (2, 'b'), (3, 'c')]
 
CMC: ^
 
RGS
@xpqz I didn't say it was like py-zip, I said it is "kind of", as in "there's some resemblance"
 
There is indeed a striking resemblance.
 
12:31 PM
I've got 16 bytes.
 
RGS
I have 15
but maybe I misunderstood the problem..?
 
      ⎕SE.Dyalog.Utils.repObj 'abc'YourFn⍳5
('a' 1) ('b' 2) ('c' 3)
Well, actually Python's zip() takes an arbitrary number of lists.
 
RGS
18 bytes for an arbitrary number of lists as right argument
but I wouldn't say it is golfed
 
14 for that.
 
RGS
      ⎕Se.Dyalog.Utils.repObj myFn ('abc') (⍳5) (⍳10) ('bananas')
('a' 1 1 'b') ('b' 2 2 'a') ('c' 3 3 'n')
 
12:37 PM
Yup. 14 for both my dfn and my train solutions.
 
Python wins this CMC :) list(zip(*l)) -- 13
 
RGS
I wrote the 18 outright as a train but I'm a monkey, so that train can be golfed 4 sure
@Adám I want to have a look at these
 
@xpqz Yeah, but there isn't much of a difference between the length of APL's code (which says what happens with uneven lengths) and using Python's built-ins. And furthermore, APL's code can be customised to do specify other behaviours than cutting short. Try erroring or filling on unevenlengths in Python!
 
fo sho.
 
@RGS Mine
 
12:43 PM
CMC: same, but for unzip. I have 10
 
RGS
Ah, turns out mine only has 15 bytes, I had extra ∘ and () that I could remove if I were to assign the train to a name instead of using it inline
 
@Adám i have 11
 
@dzaima Ooh? Care to share with APLcart?
@xpqz Uh, isn't that just ↓⍉↑?
 
@dzaima (a train, no )
 
@xpqz I seem to remember it being called "the clothes dryer" or "the washing machine" or something like that, but I can't find a reference.
CMC: ↓⍉↑ but error on length mismatch.
I've got 11 on that.
 
12:57 PM
i've got a stupid 13
down to 11, but still stupid ("stupid" as in it doesn't work in dzaima/APL and possibly other non-conforming APLs)
 
1:17 PM
@dzaima Yeah, mine is definitely a hack.
 
{↓⍉↑(⊢↑¨⍨(⌊/≢¨))⍵}
Hmm how can you get 11
 
@rak1507 1) all train, 2) get rid of one of the s required in ↑∘⍉∘↓ by moving things around (and save another byte in that process)
@rak1507 also that there is pointless
 
true
 
@dzaima (been sitting looking at the language bar trying to think of more primitives that error "helpfully" for a while, but that's only resulted in a 12-byter)
 
1:33 PM
Oops I just rearranged my language bar, how do I reset it
{↓⍉↑(⊃1⍨¨¨⍵)∘/¨⍵}
Here's one that errors
lots of ¨s
 
@Adám got a 10 by trying to make an erroring one :D (definitely way more obscure)
@dzaima it's 6 in BQN
 
ngn
@Adám i've heard "washing machine". but to me it looks more like a screw with instructions for how to unscrew it - something ikea would draw.
 
<phantomics> Are those ¨¨s in sequence valid? There's no function between the ⍵ and ⍨
 
@dzaima on and it also discloses the items, so doesn't work on e.g. 'abc' (,¨1 2 3 4) :/
phantomics: yeah, Dyalog extended A⍨ for array A to be equivalent-ish to {A}
 
<phantomics> Makes sense
<phantomics> Also had a question about your APL, is it usable within Java the way April is usable within Common Lisp? Can you evaluate an APL string on an array or scalar value within a Java program?
 
1:50 PM
phantomics: there'd have to be an interface for doing that well, as I have custom types around all types as native Java arrays can't hold shape/rank information. But with some intermediate conversion, it's definitely feasible
@dzaima (luckily, i (can't remember if publicly) already hated the idiom i've used there that makes it do that)
@dzaima (and yes, the 6-byter in BQN also gives a wrong result for ⟨1‿2‿3‿4‿5,⥊¨"abc"⟩)
(if i haven't criticized the idiom, i definitely have the thing that makes it do the funky disclosing)
(/rant over)
 
@rak1507 On Windows: Right click it and select "Revert to defaults"
@dzaima Are you going to reveal your solutions?
 
@Adám it's probably been long enough
my 11-byter for zip
 
@dzaima I have 9 as full program.
 
<phantomics> I see, Lisp has native n-dimensional arrays so it's a lot easier to pass them back and forth
 
@dzaima That's really good. I'll APLcart that.
 
1:59 PM
@Adám so that's another solution
@dzaima (and i still hate that 1,2 silently works very very much)
 
@dzaima Ugh, that's horribly wonderful.
 
RGS
2:18 PM
When localising variables in tradfn headers is it bad practice to write spaces after the semi-colons? smth like
∇ r ← Tradfn arg; var1; var2; var3...
I often see everything mushed together, as in ∇ r ← Tradfn arg;var1;var2;var3...
 
ngn
@RGS writing tradfns is bad enough practice
 
RGS
@ngn Let us assume I have to write tradfns :P
 
ngn
@RGS spaces don't matter. functions are stored in tokenized form.
so next time you open the function, the interpreter will format the list of locals according to its own taste
 
RGS
I don't think that is what happens if I have the tradfn in a text file, or is it?
 
ngn
if you're writing source code in files (as you should), i think personally i'd prefer no spaces
 
2:25 PM
@ngn you'd prefer no spaces anywhere though :p
 
RGS
Well, I didn't have to ask here to know you would prefer no spaces
 
(personally i'd prefer with spaces, but i've used it like, once?)
 
ngn
@dzaima why insert meaningless bytes everywhere :)
 
@ngn because they might or might not [citation needed] improve readability to the weird mess that is a human brain
 
ngn
"readability"..
 
2:29 PM
@RGS No.
 
RGS
@Adám ok, thanks. and is it good practice?
 
No. :-) Can't really be due to it traditionally being auto-removed.
 
RGS
makes sense
 
CMC: Cut an array into n equal parts.
 
@Razetime Anywhere?
 
RGS
2:31 PM
@Razetime n is known to be smaller than or equal to the length of the array?
 
yep
but n may not be divisible by the length
 
@Razetime ⊂⍨∘,
 
RGS
@Razetime hence Adám's question
 
@Razetime so error if impossible?
 
⋄ 'Hello world'⊂⍨∘,4
 
2:32 PM
@Adám Hello world
 
ngn
@RGS be careful who you choose as your judge of "good". apl culture is generally tolerant to bloat.
 
RGS
⋄ 3 {⍵⊂⍨⌽0=⍺|⍳≢⍵} '123456789' @Razetime smth like this..?
 
@RGS 123 456 789
 
@ngn unless you're forcefully filling up every line to the width of your screen, spaces will only "bloat" source code size (who cares about that?), and, at worst, probably [citation needed] won't affect "readability", and, at best, improve it significantly
 
2:35 PM
I made a really really long answer to that
like, really long
so I was wondering if there was something shorter
 
RGS
@Adám this was a "joke", right? because the 4 parts don't have equal lengths..?
 
@Adám but this is insane
{0~⍨¨(x⍴1,0/⍨⌊⍺÷⍨⍴⍵)⊂⍵↑⍨x←(⍴⍵)+⍺|⍴⍵}
 
RGS
@Razetime look closer, I think that was the answer before you specified the parts had to have equal sizes
 
More accurately, this question
@RGS bad wording
@Marshall should try using BQN sometime
maybe we should put up an entry for it on LoTM
or is it already there
 
@RGS Yeah, the challenge was underspecified.
 
2:38 PM
@Razetime Don't think I know that acronym?
 
Language of the month
 
@Razetime so what is the correct wording - as the challenge?
 
RGS
@Razetime if you don't mind I'll post my dfn
 
yes, just read the challenge, pretty much
@RGS Oh sure go on
 
16
Q: Nominations for Language of the Month, 2020 edition

DLoscWe've decided to revive the Language of the Month event. We've also decided to start a new post for nominations. (You can see the old nominations post here.) So let's get to nominating! Procedure A language can be nominated for Language of the Month by posting an answer to this thread. We all vot...

 
2:39 PM
but Adám's is the correct one
shortest, sorry
 
@Razetime Wasn't this a competition phase I question?
 
RGS
@Razetime Adám's doesn't solve the challenge :)
 
@RGS lol it just splits empty space
didn't realize
 
By the way, Partition representations is the guide to always knowing how to split up data. BQN's group () uses target indices like Dyalog's , but it actually uses the numbers as indices instead of just looking at where they change, and you can rearrange them to group distant cells together.
 
@Razetime ⋄ 5{⍵⊆⍨⌈⍺÷l÷⍳l←≢⍵}'Hello world'
 
2:42 PM
@Adám He ll o wo rld
 
⋄4{⍵⊂⍨⌽0=⍺|⍳≢⍵}'Hello World'
 
@Razetime llo Wo rld
 
RGS
@Razetime lol mine split things in sublists of length , not into sublists
also it is sensible to ⎕IO
 
loool
@Marshall Thanks for the link
 
@Razetime Try it with 4.
 
2:44 PM
⋄4{⍵⊂⍨⌽0=⍺|⍳≢⍵}'Hello World'
 
@Razetime lo W orld
 
RGS
4 {⍵⊂⍨⎕IO=⍺|⍳≢⍵} 'Hello world' tries to split in pieces with size 4, not in 4 pieces :P
 
⋄5{⍵⊆⍨⌈⍺÷l÷⍳l←≢⍵}'Goodbye, cruel world!'
 
@Razetime Good bye, cru el w orld!
 
RGS
⋄ 4 {⍵⊂⍨⎕IO=⍺|⍳≢⍵} 'Hello world'
 
2:46 PM
@RGS Hell o wo rld
 
owo
 
@Adám kewl, what exactly is it using from extended?
 
@Razetime monadic for sort ascending
 
It works almost prefectly
question states that the last element must be the longest
Well, now I know that cutting builtins are cheating
 
2:54 PM
@Razetime Oh, I missed the link to the full spec.
 
@Razetime Yeah, seems to be kind of a contest of which language's partition method happens to do what the spec wants out of a large number of reasonable options.
 
12
Q: N-chotomize a list

FatalizeGiven a list of integers L, and an integer N, output L splitted in N sublists of equal lenghts. Non-divisible lengths If N does not divide the length of L, then it is not possible that all sublists have equal length. In any case, the last sublist of the output is the one that adapts its length...

 
Following the partition representations page, division endpoints is the representation that fits the task, and others have to convert.
 
oh nice
@RGS still posting?
codegolf.stackexchange.com/questions/76355/… This is a more interesting challenge.
 
RGS
3:12 PM
@Razetime I was solving the wrong challenge
and I've got a lot on my plate so I didn't bother fixing it :P
go ahead
 
3:24 PM
Not too awful BQN solution to N-chotomize. The parens and ˜ aren't needed to define the function, so it's 19.
Basically the Pyth solution using Interval Index () to convert from division endpoints to target indices.
 
3:40 PM
Also reasonable at 20. Get division endpoints from beginnings by shifting in the total length at the end, lengths by subtracting beginning from end, and indices with Indices/Where (/).
Just for completeness the third way through the diagram is 22.
 
 
3 hours later…
6:43 PM
@ngn becarefulwhoyouchooseasyourjudgeof"good".aplcultureisgenerallytoleranttobloat. But why don't you write like this?
 
ngn
@TessellatingHeckler because space acts as a separator
but in local name lists there already is a different separator: ;
 
I went looking for how to outer-product in J ( aplwiki.com/wiki/Outer_Product ) but instead found how to run J Server via COM; turns out it's also easy to use from PowerShell after running the jreg.cmd to register it, $j = New-Object -ComObject "jexeserver"
Then you can $j.Do("q=.i.9"); $x=$null; $j.Get("q", [ref]$x)
 
@TessellatingHeckler Adverb / in case you're still wondering.
I've been thinking about that wiki page. Writing it will take forever though.
 
@Marshall Thanks; I found it in "J for the APL Programmer" article in the end
@ngn that's a good point
 
I guess a nested APL outer product is a little more like &.>/, since J's table works on cells and not elements.
 
6:58 PM
@ngn Do you put a space after "." and "," in English?
 
ngn
@Adám usually yes
 
@ngn but there already is a separator…
 
ngn
english is usually written in a variable-width font, so . and , are too narrow
 
@ngn so that's.. too little spacing?
 
ngn
and english has a lot of history.. programming languages are supposed to be driven by practical considerations
@dzaima yes, unlike in a mono font where ";" and " " are the same width
 
7:02 PM
@ngn that's the more understandable answer. (one could also say the space can be a disambiguator)
@dzaima but in most cases it's not disambiguating, like in APL, but just as it's pretty helpful for the sentences to be very visibly separated (when not looking directly at the separator), it can be beneficial in code
 
ngn
@Adám a better example is bash - usually i put a space after ; there
because bash requires spaces in most other places, so "a;b" would look like a single token
 
 
1 hour later…
8:08 PM
@RGS I've lately begun to put the locals on a separate line, especially if there are a few of them. And on multiple lines by name class or by usage if there are a lot of them.
 
I have wondered if there are any English words with a space in them. It doesn't seem like it, but then English has so many broken "rules" that it would be surprising if "space separates words" is an unbroken rule.
 
@TessellatingHeckler i'm pretty certain a word by definition doesn't have spaces
 
@TessellatingHeckler Well, kind-of. There are compound nouns that in related languages would be written without space. E.g. full moon which in Danish is fuldmåne.
 
@Adám that's still very much two separate words in english
 
@dzaima Is it now? It is read as a single word with no pause.
 
8:16 PM
@Adám i don't think i'd read it with a smaller pause than other words, but i'm not native english so what do i know
 
@dzaima Compare: "Tilt the board and the egg rolls down." with "Let's eat egg rolls today."
 
RGS
@Adám how does one do that..?
 
@dzaima (fwiw "full moon" is a single word in latvian too - "pilnmēness")
@Adám still very much two words. Single concept, maybe, but definitely two words
 
@dzaima sure, generally, but where does that definition come from? There are current or ancient writing systems with no spaces between words. English has no "Académie Française" to officially make rules about the language. English words have "foreign" letters and accents sometimes, hyphens, apostrophes, compounding, many loan words ... it wouldn't surprise me if there was some argument of a single word with a space in it.
@Adám hmm, those are good suggestions
 
8:21 PM
@TessellatingHeckler i mean, sure, you could define "single word" to be a single word, but that wouldn't be very helpful. hyphens, apostrophes, etc are a more confusing topic, but i'm pretty sure a space can't be a part of a word
 
@dzaima is "to be" a single word?
 
(also fwiw wikipedia mentions "ice cream, … get up each are generally considered to consist of more than one word")
 
See you in the new year, after new year.
 
@TessellatingHeckler no, at least as far as i'm considered
 
@dzaima that page includes a mention of German "Similarly, some have separable affixes; in the German sentence "Ich komme gut zu Hause an", the verb ankommen is separated."
 
8:34 PM
@TessellatingHeckler i'm mainly talking about english here, but even there space isn't part of the "word" (wouldn't " gut zu Hause " then count as "part of the word"?)
but, as with most of linguistics, agreement is definitely unattainable :)
 
@dzaima I was also talking of English originally, just noticed that. I'm not trying to argue it one way or another; it occurred to me that I would be surprised if there is a word with a space in it, and surprised if there was an unbroken rule in English, and presumably both cannot be true, so I wondered which way it resolved. It probably is not attainable agreement. :)
 
@dzaima No, they serve distinct purposes, where as komme and an are inseparable. Similarly in French "Je ne peux pas."
@TessellatingHeckler You'd be surprised… ;-)
 
@TessellatingHeckler i mean, the nature of the question is very dependent on the exact definition of what a "word" is, and that's an extremely complicated question no linguist knows the answer to
@Adám assuming that's a response of the parenthesized part, that was an intentionally stupid question
 
@dzaima True, and "word" may not even have the same definition in a spoken language and its written counterpart. Look how spaces are used in IPA…
 
RGS
8:55 PM
@Adám xD
 
ngn
9:06 PM
@TessellatingHeckler the word "workspaces" has a space in it :P
"no one", by analogy with "nobody", etc, should have been (or is?) a single word, but it's written with a space to prevent the two "o"-s from merging into a single vowel
 
@ngn seems i don't care :)
 
ngn
@dzaima what does the line over "e" mean?
 
@ngn no-one or noöne
 
@ngn just another letter - it's a "long" form of it
 
@ngn It took me way too long to read that.
 
RGS
10:38 PM
@ngn spacesAreSuperfluousIfYouUseCamelCase,IAgree
 
ngn
@RGS the romans didn't even use lowercase :)
 
RGS
I don't trust the capitalisation conventions of a culture that didn't know 0 :P
 
ngn
but arabic and the indian scripts (afaik) don't have case distinction either
 
<moon-child> no, but they have specialized letters for the beginnings and ends of words, so you can still distinguish
 
ngn
specialized letters - but only some of them?
 
10:47 PM
<moon-child> most of them afaik. It's not like hebrew where there are only 4 or 5 letters with a final form
 
The five "Hebrew" final forms are actually Aramaic and of newer origin. Original Hebrew has no final forms, and was apparently always written with spaces or inter-puncts.
@RGS IsGIFWithAGOrAJ?
:55761771 My point exactly.
 
RGS
@Adám still better than "isgifwithagoraj"
 
@RGS Yes, but isn't "Is GIF with a G or a J" best?
 
RGS
@Adám much better tbh
I overlooked these problems yeah
 
ngn
11:04 PM
@DyalogAPL right, nicely laid out in a table here
 

« first day (1351 days earlier)      last day (1293 days later) »