« first day (162 days earlier)      last day (2493 days later) » 

8:53 AM
@Uriel @KritixiLithos Advanced Stencil usage.
Can you grok it?
 
9:06 AM
@Adám Quick question (not related with the stencil): what does + mean in DISPLAY?
 
@KritixiLithos It means that the simple array has multiple data types. E.g. 1 2 3,'abc' is a simple vector, but with both numeric and character data.
 
I was asking because I was trying to golf my submission for wheat wizard's parenthesis challenge
 
@KritixiLithos And?
 
I got 1∘⌽⍣{2::0⋄⍴⍎⊃,/'1',¨⍺}⊢')('['()'⍳⎕], but it is a bit too verbose
and I tried removing the quotes around the '1', but it errors out
 
@KritixiLithos Yes, because can only take character data.
 
9:16 AM
{2::0⋄⍴⍎⊃,/'1',¨⍺} checks if the parentheses are balanced or not
 
@KritixiLithos how about ⍎⍕1,¨⍺ ?
 
Ah thanks, that works
 
@KritixiLithos In most cases, is equivalent to ⊃,/ but doesn't care about extra spaces, so you can just flatten-stringify with .
@KritixiLithos So ]display was telling you with the + that you had mixed numbers and characters.
@KritixiLithos Since the right operand to is a function, you don't need the
@KritixiLithos Also, since this is clearly a tradfn body, you can remove the
 
@Adám what does ⍺⍺ mean?
 
@Uriel left operand. E.g. if you wanted to define a cover for ¨ it would be each←{⍺⍺¨⍵}
 
9:29 AM
@Adám why wouldn't a single work?
 
@Uriel Because the dfn in ⌽{⍺¨⍵} doesn't have a left argument. the will only apply to the result of the dfn. In other words, the curly braces cannot "catch" a function other than as operand. Functions take data as arguments while operators can take both data and functions as operands.
 
@Adám :thumbs up: I'm halfway across the 4july question, but my solution doesn't even resemble yours
 
@Uriel That's fine. Go ahead and post it (when you're done) anyway. So much better to have multiple APL approaches.
 
9:52 AM
@Uriel This must be my most complicated explanation ever. Does it make any sense?
 
10:14 AM
@Adám yea, it's detailed even more than my monolith answer
you practically explained about half of APL symbols
@Adám I think I might give it a bounty to give it more attention
 
@Uriel Cool.
 
11:11 AM
If you think that explanation is detailed, take a look at this answer
3
A: Classify Quadrilaterals | Help me with my math exam!

TwiNightAPL (Dyalog), 104 89 80 82 81 79 78 bytes ⍙←{⍵⍺⍺1⌽⍵} ⎕←(|x){⍵≡2⌽⍵:≡⍙¨0⍺⍵⋄2 4=+/1=2|+⍙↑⍵(=⍙⍺)}2|1+-⍙(12○x←-⍙⎕+.×1 0J1)÷○1 Try it online! Input/Output Takes a 4×2 matrix of coordinates as input Outputs 1 1 1 for Square 1 1 0 for Rhombus 1 0 1 for Rectangle 1 0 0 for Parallelogram 1 0 fo...

 
11:26 AM
@Adám So the tradfn knows that the 1⌽ is by itself one function, or does it interpret it any differently?
And btw, thanks for the tips
@TwiNight can't you change the answer to a tradfn and drop the ⎕←?
 
@KritixiLithos That's just how a function derived from ⍣ apply dyadically
X (f⍣g) Y sort of "binds" the X
So it does X f Y, then X f X f Y, etc.
From the language reference:

If a left argument X is present, it is bound as left argument to left operand function f:
`X (f ⍣ g) Y → (X∘f ⍣ g) Y`
 
@TwiNight amazing answer.
 
11:43 AM
@KritixiLithos As I've explained here, I think tradfn body is a snippet rather than function
 
@KritixiLithos No, as TN said, f⍣g is a new ambivalent function, while A∘f⍣g is a new monadic function.
 
@Uriel You mean the algorithm or the explanation?
 
@KritixiLithos But as I responded, a snippet would not even prompt for input, but assume the variables already to have values, as stated by the author of the comment that TN linked to, in a post that that author linked to.
 
@TwiNight Mostly the fact that you wrote these. And mostly the algo.
 
11:58 AM
@TwiNight So what exactly is your code? It sure looks like a tradfn body to me!
@TwiNight You can remove +.×1 0J1 and take input as 4-element vectors of xJy Complex numbers in Dyalog APL are the closest thing to tuples (which OP allowed). They are actually implemented as pairs of floats.
 
 
1 hour later…
1:29 PM
Hmm.. I thought those scripts can be interpreted directly
However, if function main(){} have to be counted in C, I don't see APL getting around ∇f∇
Or we can meta-post that
 
it's actually int main(){}, but yeah
Can you run Dyalog APL scripts from the command-line?
I know you can do dyalog workspace.the_extension_for_workspaces_I_forgot_what_it_was for workspaces, but that only enters the interactive session in the workspace
 
1:48 PM
@TwiNight why not?
 
2:15 PM
@TwiNight You can pipe into the session, but then you don't need ⎕← either: Try it online!
@KritixiLithos ^
@KritixiLithos .dws and if ⎕LX (Latent Expression) has a value in that workspace, the interpreter will do ⍎⎕LX automatically. You could also pipe in an expression to bootstrap.
 
 
2 hours later…
4:34 PM
@Adám That's how tio does it under the hood, right?
I suppose tio's wrapper can be an "interpreter" of a dialect of Dyalog where scripts like this can be run
 
@TwiNight No, TIO's Header-Code-Footer constitute the body of a :Namespace:EndNamespacethat gets all its content copied to #.
@TwiNight However, the Input does get piped in like that.
@TwiNight Yes, and in the Input, you don't need ⎕← to output.
 
 
3 hours later…
7:29 PM
@Adám regarding codegolf.stackexchange.com/a/130123/65326, why is the +/ inside the parenthesis? shouldnt it come only after the !*! is applied?
 
@Uriel Because then it is an atop of an atop. Otherwise it becomes a left tine with the parens as the middle tine. Also, ⎕IO←1.
 
@Adám sorry, forgot to edit. atop? tine?
 
7:51 PM
@Uriel atop: 2-train, f g; tine: one of the three parts of a fork, f g h
 
8:06 PM
@Adám ogreat, thanks
 

« first day (162 days earlier)      last day (2493 days later) »