« first day (1808 days earlier)      last day (1143 days later) » 

01:21
@Adám what happens Adám if I stopped using APL
You've asked this (pointless) question before
2 days ago, by Master Quiz
@Fmbalbuena Then You'll notice that APL was just perfect and come back.
@FawnLocke Sorry
> @Adám what happens Adám if I stopped using APL
You mean to ask what would happen to me?
@Adám a challenge for me (I'll solve tomorrow)
@Adám yes
01:26
Well, if that also included stopping questions and requests to me about APL, then what would happen to me is that I'd have more time to do other things.
A challenge?
Generate 1 2 3 1 2 1 2 3 1 2 in 7 bytes.
@Adám Too hard; I will try tomorrow
Yes, you said that.
(1 2 3) 1 2 (1 2 3) 1 2
01:29
Yes, there's a pattern.
Hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ok
 
2 hours later…
03:24
10⍴5⍴⍳3
might wanna delete that so fmbalbuena doesn't get spoiled
I hope he/she would back to here after solved the puzzle.
i do not expect them to solve it if they find an answer here
04:21
what does do?
@Adám i guess that really happens since now i want some APL features built-in into python lol
It's most often used to turn a bit mask into a set of indices
⎕←⍸0 1 1 0 1
@FawnLocke 2 3 5
@PyGamer0 monadic or dyadic?
dyadic is a binary search
xpqz recently added a new section to his book dedicated to it
@Razetime does it presume the input is sorted?
04:24
monadic repeats indices by truthy values
It’s like iota but with multiple indices (dyadic)
@PyGamer0 check the docs for that
i don't use interval index much
05:13
how to get a specific row from a matrix? (i want the second row io is 1)
is that the squished quad?
05:29
ok i finished converting Fmbalbuena's python code to apl
 
3 hours later…
08:42
@LdBeth in 6: ,⍨5⍴⍳3
08:59
or like this
m[2;]
avx
avx
09:21
@Adám thanks.
09:51
@avx So, are you new to APL, or an established user? APL has certainly been using AVX for a while now :-)
@avx Let me know what you think of the book; always looking to improve it. Did you watch my talk from the Dyalog '21 conference?
CMQ: what is the most beautiful/characteristic APL glyph?
I was thinking the same thing
If they gave out shirts with glyphs, I'd go for
10:02
I like all the diaresis ones, e.g.
...apart from under.
Pareidolia (; also US: ) is the tendency for perception to impose a meaningful interpretation on a nebulous stimulus, usually visual, so that one sees an object, pattern, or meaning where there is none. Common examples are perceived images of animals, faces, or objects in cloud formations, seeing faces in inanimate objects, or lunar pareidolia like the Man in the Moon or the Moon rabbit. The concept of pareidolia may extend to include hidden messages in recorded music played in reverse or at higher- or lower-than-normal speeds, and hearing voices (mainly indistinct) or music in random noise, such...
⍤ when used in it's atop form always makes me whince, completely irrational. I sometimes will write (f g) instead of f⍤g to avoid it
What do you have against Ewoks‽
I think it looks like a little piggy face.
'tis a paw print.
10:04
What's weird is that f⍤A looks okay. It's probably because I feel like I use f⍤g too much
/shrug
@KamilaSzewczyk Objectively speaking, is the most beautiful.
but the least characteristic
I also like
⍋ too
i've had people ask me if this is a literal square or their font is missing some chars
Yeah, all the time..
10:06
Block of tofu.
@KamilaSzewczyk i like
Not kidding though. The phenomenon of computers showing ⎕-like shapes for missing chars is called tofu.
Oh, cool
I think is characteristic of APL
More so than any other glyph imo.
But it is used in TMN!
10:08
That's true..
Actually, almost all APL's glyphs are used other places, except the ones that are overstrikes with ¨ or
I learned of from APL before TMN, when I saw them I was certain mathematicians were using APL unicode for convenience
heh
@KamilaSzewczyk
is a nice figurehead for APL's function composition. That's almost a pun :)
How so?
10:13
`⍛` looks like the head of a figure

`⍛
/ | \
Split your message in two.
This works, will do in the future
@Adám APLcart suggestion: an intersperse/insert between function?
I suppose they all sort of do, ⍤ even has eyes
⎕←' '(≢↓∘∊,¨)'hello'
10:15
@KamilaSzewczyk h e l l o
I have searched for such a function on multiple occasions
Another suggestion:
⋄ {(1,⍨2⍲/⍵)/⍵}1 1 1 1 0 0 0 1 1 1 1
@FawnLocke 1 0 0 0 1
Collapsing sequences of 1's
Ah, that's nice.
⋄ 1 0 0 1 0 1 0 0 ((+⍀1⍪2≢⌿⊣)⊆⊢) 'Sequence' ⍝ This is a function I've found useful during my Markdown project
10:20
@FawnLocke
┌─┬──┬─┬─┬─┬──┐
│S│eq│u│e│n│ce│
└─┴──┴─┴─┴─┴──┘
is there a public dyalog roadmap?
Every year.
@KamilaSzewczyk So something like ⎕← 'XYZ' {⍺{⍺⍴⍨≢⍵}@{(|m)/(m<0)}⍵⍀⍨m←1(-≢⍺)⍴⍨¯1+2×≢⍵} 'hello'
@Adám hXYZeXYZlXYZlXYZo
Can be cleaned up a little.
Arrg, I always forget the silliness of @
The point is that it works for nested and high-rank arrays:
⋄ '_¯' {⍺{⍺⍴⍨≢⍵}@(⍸(|m)/m<0)⊢⍵⍀⍨m←(¯1+2×≢⍵)⍴1,-≢⍺} ⍥⍪ 'Boo'
@Adám
B
_
¯
o
_
¯
o
10:27
Nice :)
@FawnLocke So "cut on every change"? Wouldn't it make more sense to have a general "indicate the beginning of every run or identical elements"?
Yeah, I suppose it would
@Adám looks great
but if we made it work just on 1d arrays as an alternative, it could be much smaller.
How so?
⎕←0{↑,/(1↑⍵),⍺∘,¨1↓⍵}⍳5
10:38
@KamilaSzewczyk 1 0 2 0 3 0 4 0 5
alternatively with ↑,/ becoming .
⋄ 'XYZ' {⊃(⊣,⍺,⊢)/,¨⍵} 'hello'
@FawnLocke hXYZeXYZlXYZlXYZo
oh, that's smart too.
      cmpx 's1 {∊(1↑⍵),⍺∘,¨1↓⍵} s2' 's1 {⊃(⊣,⍺,⊢)/,¨⍵} s2'
  s1 {∊(1↑⍵),⍺∘,¨1↓⍵} s2 → 6.9E¯6 |    0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  s1 {⊃(⊣,⍺,⊢)/,¨⍵} s2   → 1.9E¯5 | +180% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕


      ⎕⎕⎕
my solution seems faster though
This function is already in the APLCart btw, the point here is definitely the multi-dimensional aspect
⋄ (⊂'XYZ') (,/1↓∘,,⍤0) 'hello'
10:42
oh?
i couldn't find it
@FawnLocke
┌─────────────────┐
│hXYZeXYZlXYZlXYZo│
└─────────────────┘
Well, except the ,/
"insert between" and "intersperse" don't yield anything
it's join with separator I believe
@KamilaSzewczyk You were saying?
      cmpx 's1 {⍺{⍺⍴⍨≢⍵}@(⍸(|m)/m<0)⊢⍵⍀⍨m←(¯1+2×≢⍵)⍴1,-≢⍺} s2' 's1 {∊(1↑⍵),⍺∘,¨1↓⍵} s2' 's1 {⊃(⊣,⍺,⊢)/,¨⍵} s2'
  s1 {⍺{⍺⍴⍨≢⍵}@(⍸(|m)/m<0)⊢⍵⍀⍨m←(¯1+2×≢⍵)⍴1,-≢⍺} s2 → 4.8E¯5 |     0% ⎕⎕⎕
  s1 {∊(1↑⍵),⍺∘,¨1↓⍵} s2                            → 1.2E¯4 |  +150% ⎕⎕⎕⎕⎕⎕⎕
  s1 {⊃(⊣,⍺,⊢)/,¨⍵} s2                              → 6.7E¯4 | +1296% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
10:43
Those could be good keywords
Heh.
@Adám lol
nice
Stay flat.
This should be the APLers' greeting: "Keep it flat!"
might be the most under-appreciated APL function.
@FawnLocke Adding those.
Awesome :)
Definitely under-appreciated for it's utility
@xpqz I was not aware of this book (I'm new to APL). I started reading a few paragraphs. Very nice, so far. Thank you!
@FawnLocke That high count it probably due to scan, not expand.
10:53
I will update these results sometime this week with checks such as those, it's been on my mind
How can you check if a slash is being used as fn or op?
Well, I can check if the next glyph is a primitive function with a it's not perfect but it'll help separate the cases
I could possibly also try to find the definitions of names but that feels out of scope for this
Might be fun to try!
@FawnLocke ⊢⊂⍨1,2∨/⊣ works too I think
avx
avx
11:26
@KamilaSzewczyk I found this really interesting dl.acm.org/doi/pdf/10.1145/3315454.3329960
 
2 hours later…
12:57
The "Melt nested array" challenge from codegolf.meta.stackexchange.com/questions/2140/… was fun as an APL task.
      melt data
┌→──────────────────────────────┐
↓[1,                       ,2,3]│
│   [1,                   ]     │
│      [8,2,     ,5,4,   ]      │
│           [1,2]     [9]       │
└───────────────────────────────┘
@xpqz Wrong link?
0
A: Sandbox for Proposed Challenges

pxegerMelt a nested array code-golf array ascii-art string ragged-list When I look at a ragged-list like [1,[1,[8,2,[1,2],5,4,[9]]],2,3], I sometimes mentally imagine the list melting into goo and dropping like from the edge of a table, going further down in the deeper-nested parts of the list. [1, ...

Too late for edit, sorry
Seems almost trivial with input as JSON.
I have a 33 just with the string
{⍉↑⍵↑¨⍨-(']'=⍵)++\1 ¯1 0['[]'⍳⍵]}'[1,[123,[8,2,[1,2],5,4,[9]]],2,3]'
13:02
@rak1507 Did you forget to add backticks around your code (`⋄ code`)? You can edit your message and I will edit my reply.
⋄ {⍉↑⍵↑¨⍨-(']'=⍵)++\1 ¯1 0['[]'⍳⍵]}'[1,[123,[8,2,[1,2],5,4,[9]]],2,3]'
@rak1507
[1,                         ,2,3]
   [123,                   ]
        [8,2,     ,5,4,   ]
             [1,2]     [9]
Nice!
seemed like ⎕JSON⍠'M' would be ideal for it but having to have the commas + closing brackets makes it more annoying
Mine was considerably longer, and not nearly as clever.
melt←{
  d[1+⍸2>/d←+\-⌿'[]'∘.=⍵]+←1
  ⍵@(↓⍉↑(¯1+d)(⍳≢⍵))⊢(⌈/d)(≢⍵)⍴' '
}
13:07
Here's mine: ⋄ {⍉↑⍵↑⍨¨+\-⌿↑(0,']'=¯1↓⍵)('['=⍵)}'[1,[1,[8,2,[1,2],5,4,[9]]],2,3]'
@Adám
[1,                       ,2,3]
   [1,                   ]
      [8,2,     ,5,4,   ]
           [1,2]     [9]
I think it can be shortened a little.
Did you have a JSON-based idea?
That's the one. Input as JSON, but don't use ⎕JSON
Oh I see what you mean.
13:13
This really needs BQN's »
what does that do?
Monadic just pushes one fill element in from the left, dropping off the rightmost element.
A little shorter: ⎕← {⍉↑⍵↑⍨¨+\('['≠⍵)-']'≠'[',¯1↓⍵}'[1,[1,[8,2,[1,2],5,4,[9]]],2,3]'
@Adám
[1,                       ,2,3]
   [1,                   ]
      [8,2,     ,5,4,   ]
           [1,2]     [9]
@PyGamer0 Dyadic lets you specify which elements to push in (even more than one). So '[',¯1↓⍵ would be '['»⍵
@Adám Hey
10⍴5⍴⍳3
Very nice.
(I exactly found a solution of this message)
i told you @LdBeth
11 hours ago, by LdBeth
10⍴5⍴⍳3
14:02
lol
@Razetime No, I found a solution, Then i joined, Finding Adám message. But i found this.
@Adám ? link?
Is there a simple way for a function to make a parent function return early?
is this about dfns
14:04
@FawnLocke Can you give an example?
I know you could just return 0 and then wrap a guard around that, curious if there's another way. Sure, one second
It doesn't sound very functional, as supposedly functions shouldn't have sideeffects.
@Fmbalbuena ,⍨5⍴⍳3
TopLayer ← {
    v ← {⍺:ReturnEarly⋄SomeResult}
    LaterExpression v
}
@Fmbalbuena Can you generate 1 2 3 4 1 in 4?
14:06
Preferably ReturnEarly would stop LaterExpression from being reached
v needs an argument.
So, I'd just make ⍺:0 and then wrap a guard around that?
Ah, so you want v to either cause TopLayer to quit, or feed a value to LaterExpression?
I think it can be hacked together, but it won't be pretty.
However, what should TopLayer return if we return early?
14:09
⍵, also It's okay, I realized my code had repeating concepts so I tried to create operators to abstract them, guards have got in the way :)
14:30
@avx thanks for sharing. I will read it during the weekend.
14:43
@Adám ⋄5⍴⍳4
@Fmbalbuena 1 2 3 4 1
Well done.
@Adám a challenge: 99998 99994 99976 99880 99280 94960 59680 ¯262880 in 12 bytes. (Hard)
@Adám How to clear the workspace in TryAPL?
@Fmbalbuena )clear ws?
@PyGamer0 This prints clear ws
Not sure
      ⎕←'bla bla'
bla bla
      )clear
clear ws
      )clear ws
clear ws
      clear ws
VALUE ERROR: Undefined name: ws
      clear ws
            ∧
14:53
@Fmbalbuena bla bla
@Fmbalbuena then it works, it removes all defined variables from the workspace
@Fmbalbuena Do you want to remove all definitions or clear the screen?
clear the screen
F5
I mean code to clear the screen
14:56
You can't. The APL code cannot break out of the sandbox. You can, however, push everything away with 0/⍪100⍴⍬
@Adám execute cls in Bash?
⎕SH'cls' won't work.
ok
@Adám How to use :Repeat without ?
@Fmbalbuena (999999-(+\⊢×!))⍳10
Not quite 12
@FawnLocke You need 1⍨-10*n, right?
15:03
I just hardcoded it, but that'd be shorter, yeah
@Adám Is allowed to press "del" until everything is empty?
@Fmbalbuena you can't
label related stuff is tradfn only
@Razetime If statements?
check aplcart
@Razetime ?
Raze meant "check aplcart [for repeat]", I suspect.
You can learn about the "power" operator , maybe.
⋄1 2⍣+3
15:13
@Fmbalbuena
LENGTH ERROR
      1 2⍣+3
           ∧
⎕←{⍵+1}⍣5⊢1
@xpqz 6
@Fmbalbuena you can read about it here: xpqz.github.io/learnapl/iteration.html#power
⎕←(1∘+⍣3) 5
@xpqz 8
@Fmbalbuena hmm
fun
15:32
@KamilaSzewczyk This is hard
15:44
@xpqz ⋄{⍵×2}⍣100⊢2 correct?
@Fmbalbuena 2.5353012E30
@Adám when you join this room, I have a question: Can you define a function that checks if the left argument exists, return 1 else 0.
@Fmbalbuena It multiplies by 2, 100 times. You can see the intermediate steps by ⋄{⎕←⍵×2}⍣10⊢2
@xpqz
NOT PERMITTED: Illegal token
      {⎕←⍵×2}⍣10⊢2
     ^
TryAPL don't allow
15:50
    {⎕←⍵×2}⍣10⊢2
4
8
16
32
64
128
256
512
1024
2048
@xpqz Sometimes i want 2 f 2 f 2 f 2.
Is this possible with ⍣?
Can you show an example function f?
@xpqz f←{⍺+⍵×2}
      2∘f⍣3⊢2

30
⋄2∘{⍺+⍵×2}⍣3⊢2
15:56
@Fmbalbuena 30
Yup.
and a function with a operator?
f←{⍺ ⍵⍵ ⍵ + ⍺}⋄g←{⍺+⍵×2}
@xpqz
Your dop needs to be f←{⍺ ⍺⍺ ⍵ + ⍺}
      2∘(g f)⍣3⊢2

58
16:00
@xpqz 2 g f 2 g f 2?
One more: 2 g f 2 g f 2 g f 2
(that's the 3 bit)
@xpqz is ⍣ your favorite operator?
If I have to pick just one, I'd pick Rank () ahead of Power.
@xpqz ⋄5⍳⍤5
@Fmbalbuena
SYNTAX ERROR: Missing right argument
      5⍳⍤5
       ∧
16:07
You'll need to read up a bit on Rank; there's a whole chapter complete with some drills in the book: xpqz.github.io/learnapl/rank.html
@xpqz OK, not now.
16:31
@Fmbalbuena {2=⎕nc'⍺'}
@KamilaSzewczyk explain
⎕nc yields you what is the thing that you passed as the right argument.
it happens to return 2 if it's a thing, and 0 if it's not
@KamilaSzewczyk why 2 and 0, not 1 and 0?
ask Dyalog.
maybe this documentation explains.
I forgot ternary if statement
16:37
in APL?
i don't think there's a ternary operator equivalent in APL unless you make it with guards.
{5:1=⍵?3}
There is
@FawnLocke 3 is There
16:38
As per the aplcart: X⊣⍣Bs⊢ Ternary: if Bs then return X else return Y
{⎕nc'⍺'=2
:⍺+⍵
⋄⍳⍵}
@KamilaSzewczyk ^
17:39
@Adám run APL in vs code?
18:17
Do you know of any good reads for someone who wants to write his own APL interpreter? Conformance to the standard or other APL implementations is not a strict requirement
Thanks
@Adám what algorithm does Dyalog use for factorials?
19:22
Why is this giving a rank error?
{⍵+/⍨¨⍳⍴⍵}¯2 1 ¯3 4 ¯1 2 1 ¯5 4
And this one not
{⍵+/⍨4} ¯2 1 ¯3 4 ¯1 2 1 ¯5 4
I'm trying to do this operation for each 1 .. n where n is the size of ⍵
20:17
@Richard You have to enclose the right argument to do an iteration on the left argument (at least this is what I do) ⋄{(⍳⍴⍵)+/¨⊂⍵}¯2 1 ¯3 4 ¯1 2 1 ¯5 4
@MasterQuiz
┌─────────────────────┬───────────────────┬───────────────┬────────────┬──────────┬────────┬──────┬────┬─┐
│¯2 1 ¯3 4 ¯1 2 1 ¯5 4│¯1 ¯2 1 3 1 3 ¯4 ¯1│¯4 2 0 5 2 ¯2 0│0 1 2 6 ¯3 2│¯1 3 3 1 1│1 4 ¯2 5│2 ¯1 2│¯3 3│1│
└─────────────────────┴───────────────────┴───────────────┴────────────┴──────────┴────────┴──────┴────┴─┘
Does someone know how to use APL on VS Code? The extension APL Language is working, but APL Language Server Client isn't; may be this condition The language server requires a copy of Dyalog v17.0, but I don't think so...
21:09
@MasterQuiz thanks, seems I still miss some basic knowledge...
21:26
Ah, I think I got it.
Is it because +/ is a scalar operator which splits up ⍵? Wether is on the left or the right argument?
And/or ¨ can also work on the other side of the function, like
1 2 3 ,¨ 99
 
1 hour later…
22:31
An example with Reverse:
If you want to reverse a vector by one, two, and three, you would like to do an each on the left argument, but you can't. So you do something like this, to iterate on the left argument `1 2 3⌽¨⊂⍳4`

« first day (1808 days earlier)      last day (1143 days later) »