« first day (601 days earlier)      last day (2037 days later) » 

4:38 AM
⎕←(1-⍨.5∘+÷2*∘⌊2⍟⊢)⍳20
 
@Bubbler
0.5 0.25 0.75 0.125 0.375 0.625 0.875 0.0625 0.1875 0.3125 0.4375 0.5625 0.6875 0.8125 0.9375 0.03125 0.09375 0.15625 0.21875 0.28125
 
⎕←(1-⍨(.5+⊢)÷2*∘⌊2⍟⊢)⍳20
 
@Bubbler
0.5 0.25 0.75 0.125 0.375 0.625 0.875 0.0625 0.1875 0.3125 0.4375 0.5625 0.6875 0.8125 0.9375 0.03125 0.09375 0.15625 0.21875 0.28125
 
@J.Sallé Both versions work just fine
 
 
4 hours later…
8:39 AM
Live webinar on Thursday 20 September at 15:00 UTC (San Francisco 8am/New York 11am/London 4pm/Copenhagen 5pm/Bangalore 8:30pm). JUPYTER NOTEBOOK SUPPORT FOR DYALOG APL Adám will demonstrate how Jupyter Notebooks technology can be used to teach APL. https://dyalog.tv/Webinar.
 
 
3 hours later…
12:03 PM
I will never for the life of me understand the compose operator
 
f∘g A ←→ f g A
A f∘g B ←→ A f g B
A∘f B ←→ A f B
(f∘A) B ←→ A f B
There is only one case (outside of trains and operators) where it doesn't act exactly the same as a space
 
@Quintec I didn't think I would either, but over time I understood that what I didn't understand were trains, not :p
@Quintec what to understand about is that it's what H.PWiz said and nothing more. An almost perfect dfn in place of is {⍺←⊢ ⋄ ⍺ ⍺⍺ ⍵⍵ ⍵}, only not working in place of (f∘A) B. (⍺← sets only if there wasn't a left argument, effectively combining the 2 dfns {⍺ ⍺⍺ ⍵⍵ ⍵} and {⍺⍺ ⍵⍵ ⍵})
 
12:19 PM
@dzaima Well, I don't understand those either ;p
I guess I don't understand why you would ever need them, and when you do, it just looks different
 
@Quintec they're useful in trains, and for simple dfns, e.g. an add 1 function (just 1∘+)
also, 1 2 3∘+ ¨ 4 7 for "add '1 2 3' to each of 4 & 7", though that could just be 1 2 3 ∘.+ 4 7 plus a bit of array manipulation
 
or (⊂1 2 3)+4 7
 
@H.PWiz you'd need to do (⊂A)f¨B to be universal though beyond +, and I just find that uglier as it doesn't show the intent that much
 
Yes
 
ngn
@H.PWiz you mean (f∘A) B ←→ B f A (not A f B)
 
12:29 PM
Oh... can't edit now
 
1:01 PM
@dzaima But why can't that just be 1+
 
⋄f←1+ ⋄ ⎕←f 5
 
@dzaima
SYNTAX ERROR
 
@Quintec ^
though I made that work in my APL :p
 
⋄f←1∘+ ⋄ ⎕←f 5
 
@Quintec
6
 
1:04 PM
So basically a mini lambda in a language defined by lambdas. lol
 
@dzaima oooooooooor maaybe I didn't. f ← (1+) works so ¯\_(ツ)_/¯
 
@Bubbler the goddamned parenthesizing. I get so mad at that, sometimes.
Thanks, btw
 
 
1 hour later…
2:32 PM
I'm probably missing something obvious, but I can't find a short way to do digital sum in APL
 
@Quintec what do you want to do exactly?
 
digital sum, sum digits of a number
 
@Quintec for converting a number to a char vector and each of those. I have a 6 byte train
 
@Quintec ^ what he said
 
or if you want a more versatile solution, +/10⊥⍣¯1 ⊢ 124
 
2:35 PM
+/⍎¨⍕ then?
 
That'll work
 
@Quintec yeah, that's a partial function. With , you can make that a 6 byte train which can be set to a variable
 
@dzaima How exactly do you do that
 
⎕←f←+/⍎¨⍕∘⋄f 12345
 
@J.Sallé
SYNTAX ERROR
 
2:38 PM
meh I can't use the bot right
 
⎕←⋄f←+/⍎¨⍕∘⋄f 12345
 
@Quintec
SYNTAX ERROR
 
i thought it was something like that but i don't remember
 
⋄←f←+/⍎¨⍕∘⋄ ⎕←f 12345
 
@J.Sallé
SYNTAX ERROR
 
2:38 PM
nope
we need @Adám!
 
@J.Sallé Hi!
 
⎕←⋄f←+/⍎¨⍕⋄f 12345
 
@Quintec
SYNTAX ERROR
 
@Quintec you need to know 2 things: (f g) A is f g A and that takes precedence over trains, and the (f∘g) Af g A rule, (as (f g h) is (A f B) g (A g B))
@J.Sallé what are you trying to do there
 
⎕←⋄f←+/⍎¨⍕∘⋄f 12345
 
2:39 PM
@Quintec
SYNTAX ERROR
 
aaaa
⎕←⋄f←∘+/⍎¨⍕⋄f 12345
 
@Quintec
SYNTAX ERROR
 
@dzaima there's a way to set the train as a variable using the bot I just don't remember what it is
 
⋄ f←+/⍎¨∘⍕ ⋄ ⎕←f 12345
 
@Adám
15
 
2:40 PM
@Quintec ^
 
ah i see
 
Yes, that.
 
So basically ∘ forces that expression to evaluate first?
 
@Quintec another use for trains, though this one's mostly for golfing
 
Also I put the compose in the wrong spot and didn't notice it
 
2:42 PM
@Quintec it ups the precedence of it
 
@Adám ⍨ mfw one syntax is ⎕← and the other is just (not ⋄←)
 
in that example, it's 2 completely different rules working together to have a function of 3 monadic functions in a row
 
Still rather confused, but it kinda makes sense
 
@J.Sallé It is just fake syntax of the bot. The idea is that is just separating one (empty) statement from the next, to forgo output. ⎕← is usual APL outputting`.
@J.Sallé You know you can change train display form on the fly, right?
 
@Adám yeah I knew it was a fake syntax for the bot, I was just remembering it wrong. I thought it was ⋄←
@Adám and nope >.>
Well I knew there was a way to change from box to tree view, I just find the boxes easier to understand
 
2:46 PM
]box -???
 
@Adám
───────────────────────────────────────────────────────────────────────────────

]OUTPUT.Box

Diagram display of output.

Argument may be any of:
    (none)  query on/off state only
    on      activates boxing
    off     disables boxing
    reset   restores factory settings: -style=min -trains=box -fns=off
    ?       queries the current state including modifiers

-style={min|mid|max} specifies boxing level
    ┌───┬──────┐    ┌→──┬──────┐    ┌→───────────────┐
    │min│boxing│    │mid│boxing│    │ ┌→──┐ ┌→─────┐ │
 
@J.Sallé As you can see, ]box -trains=tree will make it like the bot. Btw, trains can be shortened.
 
@Adám ooooh I like that. Also parens ftw
 
@Quintec To have more than two monadic (composite) functions applied one after another, you can't just put them next to each other (in a so called train), but you can compose them together with . So (+/)∘(⍎¨)∘⍕ will work. But you can remove leftmost because up to two works fine, giving you +/ (⍎¨)∘⍕ (the superfluous space separates the two (composite) functions for clarity. Further, you can remove the remaining parens as they don't separate anything anymore, giving you +/⍎¨∘⍕.
 
 
2 hours later…
4:32 PM
CMC: dop equivalent of (doesn't have to handle errors right, but must handle f∘g and f∘B and A∘g)
I have a 37 solution.
 
4:49 PM
@Adám dops are made in Dfn style (using ⍺ ⍺⍺ ⍵⍵ ⍵ inside curly braces, I mean), right?
 
I think I have 28 bytes, but it could be wrong
it's abuse of everything at the finest, but I think it works :D
 
Test cases:
⋄ op←∘ ⋄ ⎕←2×op-3 ⋄ ⎕←2 op-3 ⋄ ⎕←(× op 2)3
 
@Adám
SYNTAX ERROR
 
⋄ op←{⍺←⊢ ⋄ ⍺ ⍺⍺∘⍵⍵ ⍵} ⋄ ⎕←2×op-3 ⋄ ⎕←2 op-3 ⋄ ⎕←(× op 2)3
 
@Adám
¯6
¯1
SYNTAX ERROR
 
5:00 PM
⋄ op←{⍺←⊢ ⋄ ⍺ (⍺⍺∘⍵⍵) ⍵} ⋄ ⎕←2×op-3 ⋄ ⎕←2 op-3 ⋄ ⎕←(× op 2)3
 
@Adám
¯6
¯1
6
 
Yeah, it isn't trivial.
 
My 22 byte op works for all of those three
 
@H.PWiz Cool, what have you got?
@dzaima Test cases work?
 
{⍺←⊢⋄0::⍺ ⍺⍺⍵⍵⍵⋄⍵⍺⍺⍵⍵}
 
5:02 PM
@Adám mhm
 
@H.PWiz Ah, that is clever. I didn't think of using an error guard.
 
@H.PWiz oh I just assumed nothing pretty would work so went with {0::⍵⍺⍺⍵⍵⋄⍺←⊢⋄_←⍵⍵/⋄⍺ ⍺⍺⍵⍵⍵} :|
 
You guys are too clever for me. I had {⍺←⊢⋄f←⍺⍺⋄g←⍵⍵⋄>/⎕NC⍪'fg':⍵f g⋄⍺f g⍵}
 
@Adám yeah my first thought was using ⎕NC but at the moment I couldn't remember the name nor did I think it'd he the golfiest thing out there :p
 
It's a shame that you can't do ⎕nc'⍺⍺'
 
5:07 PM
@H.PWiz Yes, super annoying. There is some kind of reason for it, I just can't remember what it is.
 
@Adám #BlameIverson ⍨
 
@J.Sallé Actually, I wonder if that worked in Iverson's APL, SAX.
 
6:04 PM
holy what {0::⎕SIGNAL ⎕EN ⋄ ⍺←⊢ ⋄ ⍺⍕⍵}
 
6:43 PM
@Quintec tryapl is scared of because (for some reason) ⍕⍣¯1 is , and tryapl is scared of
 
7:28 PM
@H.PWiz well, since ⍣¯1 is the inverse operation, it makes sense that ⍕⍣¯1 → ⍎
 
(⍕⍣¯1)'a' does not need to error imo
 
Yes, I agree. I just commented because you said (for some reason) and (I think) I know why :p
 
 
4 hours later…
11:53 PM
does APL have a split function for strings or no
 
Like:
⎕←' '(≠⊆⊢)'one two three'
 
@H.PWiz
┌───┬───┬─────┐
│one│two│three│
└───┴───┴─────┘
 
Yep, more parts of APL I haven't looked at yet :) Thanks
 
That is the same as ' '{(⍺≠⍵)⊆⍵}, if you hadn't seen the train. So the main function is
 

« first day (601 days earlier)      last day (2037 days later) »