3 ms·
What makes you say it was cribbed from there? The APLCart explanation is "Are all major cells of Y identical?" and the ChatGPT explanation I got from the prompt
by jodrellblank 4y ago
What makes you say it was cribbed from there? The APLCart explanation is "Are all major cells of Y identical?" and the ChatGPT explanation I got from the prompt "can you explain this APL program to me" is:
----
----
Certainly! Let's break down the APL program (1=≢∘∪)Y step by step.
First, let's focus on the function ≢∘∪. The symbol ∘ is called the "composition" operator, which means it takes two functions and returns a new function that applies the second function to the result of the first function. In this case, ≢ and ∪ are the two functions being composed.
≢ is the "tally" or "count" function, which returns the number of items in an array. For example, ≢ 'Hello' would return 5.
∪ is the "unique" function, which removes duplicates from an array. For example, ∪ 1 2 3 3 4 would return 1 2 3 4.
So, ≢∘∪ means "count the number of unique items in the array". For example, if Y is 1 2 3 3 4, then ≢∘∪ Y would return 4, because there are 4 unique items in the array.
Now, let's look at the entire program: (1=≢∘∪)Y
The parentheses are used to group the functions together, so that they are treated as a single function.
1= compares the result of ≢∘∪ Y to 1. If the result is equal to 1, then 1= returns 1 (true). Otherwise, it returns 0 (false).
So the entire program (1=≢∘∪)Y means "return true if there is only one unique item in the array Y, and false otherwise".
----
----
That doesn't seem like a crib from the APLCart sentence at all. And this explanation is correct as far as it goes - it just doesn't go far enough to mention "major cells" (i.e. it would deduplicate the rows of a 2D matrix, not the individual elements). And it doesn't mention parentheses around the pattern (constant function function) is significant and makes a 'train' but then neither does the APLCart one.