« first day (317 days earlier)      last day (39 days later) » 

12:22 AM
@Adám how can I make stencil output matrices on a column rather than a row? (each under the other, and not side by side)
Also, are stencil stuff on topic here?
@Uriel You mean the language?
@Adám yup
@Uriel The option will output matrices with empty lines in between.
12:45 AM
@Adám thanks!
@Adám hmm but it can't coexist with the exist option
@Uriel you shouldn't need both. The only difference (other than the display) is that goes forever if needed, while stops when it detects a cycle.
@Adám does it mean I can't use column view with the exist option?
It turns messy if the result gets over a few matrices
1:03 AM
@Uriel You can insert 0⌿⎕←' '⍪ before the first code line.
@Uriel I know, but if you zoom out it may look ok, and technically, it does return the right result. I've been thinking of making 's output just like 's. Should I do that?
2 hours later…
2:43 AM

Rebuilding user command cache... done
Was OFF -trains=box -fns=off

Real time: 1.546 s
User time: 1.441 s
Sys. time: 0.040 s
CPU share: 95.77 %
Exit code: 0
2:47 AM
It doesn't like input.
2:49 AM

Rebuilding user command cache... done
Was OFF -trains=box -fns=off
 __field_initialize_result_←(⎕NS ⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''box on -fns=on -trains=tree''⊣enableSALT' ⋄ ⎕←(⊢×*)⍣¯1⊢¯1

Real time: 1.029 s
User time: 0.955 s
Sys. time: 0.038 s
CPU share: 96.52 %
Exit code: 0
2:52 AM
2:53 AM
Was OFF -trains=box -fns=off
You know TIO is a thing that exists
I know, but there's no error messages on that for some reason ...
Do y○u have any idea why?
Wrong room
5 hours later…
8:15 AM
@Zacharý Uh, yes, they just go in the Debug pane at the bottom. Also, you can prevent the huge error message here by using ⍞← instead of ⎕←.
9:09 AM
Why a÷b is "a div b" and a|b is "b mod a"?
@RosLuP Because usually what's being done is on the left. A∘f should be meaningful. However, - and ÷ have this reversed (you subtract something, and divide by something) and have been preserved in APL in order to not conflict with traditional mathematics (which APL originally was intended to replace). | (mod), which was a new thing, could have its arguments in sensible order.
@RosLuP In other words, usually you want the mod-constant of something, not the mod-something of a constant. mod-2 is way more common than 2-mod.
4 hours later…
1:05 PM
Hey @Adám, if I have a boolean vector (say 1 0 1) and want to apply a function f to the truthy indices of another vector 1 2 3(so, in this case, apply f to 1 and 3), could you give me a clue here?
@J.Sallé @
Using a guard doesn't seem to work because it requires a singleton value
Oh, I'll try that
⎕←10×@1 0 1⊢1 2 3

Rebuilding user command cache... done
Was OFF -trains=box -fns=off
 __field_initialize_result_←(⎕NS ⍬).⍎'⎕CY''salt''⋄⎕SE.UCMD''box on -fns=on -trains=tree''⊣enableSALT' ⋄ ⎕←10×@1 0 1⊢1 2 3

Real time: 1.120 s
User time: 1.020 s
Sys. time: 0.044 s
CPU share: 94.94 %
Exit code: 0
⎕←10×@{1 0 1}1 2 3
1:06 PM
10 2 30
⎕←10×@(⍸1 0 1)⊢1 2 3
⍞←10×@(⍸1 0 1)⊢1 2 3
@Adám 10 2 30
@Adám that's exactly what I needed, thanks!
I've never used @ before, I think
@J.Sallé Have a look at Lesson 4.
Hmm, I've got {2×@(2|⍳≢⍵)⍵}1 2 3 4 but it gives me a syntax error
oh nevermind
I needed {} instead of ()
1:15 PM
@J.Sallé If you use a function right operand, you don't need the additional brace-wrapping:
⍞←2×@{2|⍳≢⍵}1 2 3 4
@Adám 2 2 6 4
@Adám oh great, free golfs!
Oh I hadn't noticed Uriel had already posted an APL solution to your challenge, but I outgolfed him :o
1:40 PM
@J.Sallé and ninja me (you can't see deleted answers)
btw it's not a very hard solution
Yeah I know, I was just surprised. Uriel usually has really short answers
@Uriel Why deleted? It is an interesting different approach.
@J.Sallé You can shorten the right operand by one byte using a rather obscure function.
@Adám really? Pray tell
@J.Sallé ⌽¨@(≠\≡¨⍨) (do you understand?)
1:55 PM
@Adám not quite.
@Adám uh, can't that function be ≠\∘≡¨⍨?
@Adám what I don't get is the at the end there
that commutes
i.e. if called monadically, it uses the same argument for both sides
I'm used to using it to swap arguments
also ≡¨⍨ makes a vector of 1s the same length as the number of lines in the input
2:06 PM
Yeah because each depth is 1
then ≠\ makes the list alternate between 0 and 1
@EriktheOutgolfer I don't understand why it does that, though.
\ is scan, i.e. reduce for each prefix
Shouldn't it just return a vector of 0s the same length as the vector of 1s?
is not equals, i.e. checks for inequality
2:08 PM
yeah, and all the elements in the vector are equal
in a vector of 1s, such as 1 1 1 1 1 1 it would work like this:
or am I missing something?
it uses the result as an argument
1 1 1 1 1 1
        \ /
1 1 1 1  0
      \  /
1 1 1  1
    \  /
1 1  0
  \  /
1  1
\  /
this is for even length
it’s a reduce on prefixes
2:12 PM
1 1 1 1 1
      \ /
1 1 1  0
    \  /
1 1  1
  \  /
1  0
\  /
@J.Sallé this is for odd length
@EriktheOutgolfer shouldn't the before last line be 1 1?
@dzaima yes
Oh, I get it now. I think I was getting confused with /
now, this is scanned, i.e. it does this for every prefix
Thanks people :D
2:13 PM
and prefix lengths have alternate parity
In J it would be ~:/\, ~: is inequality
@J.Sallé you may want to review lesson 3 btw
so there are both /\, while in APL it’s confusing
@EriktheOutgolfer yeah probably hahahah
@FrownyFrog ``~:/\``
2:15 PM
I've been coding way too much java lately, my brain is not working properly >.>
thank you
@J.Sallé especially / and \
@Adám undeleted
2:35 PM
Can’t you do the boustrophedon with fold?
I can think of a way to do it, but it would be really long
you mean reduce, right?
Yeah: (,|.&.>)/
It works
on boxed strings
@FrownyFrog Yes:
there’s one string on the left, and a list of strings on the right, reverse every string in the list and leave the single string as is
⎕←⊃{(⊆⍺),⌽¨⊆⍵}/'Here are some lines' 'of text for you' 'to make a' 'boustrophedon'
2:46 PM
│Here are some lines│uoy rof txet fo│to make a│nodehportsuob│
and they have to be boxed in APL?
⍞←⊃{(⊆⍺),⌽¨⊆⍵}/'Here are some lines' 'of text for you' 'to make a' 'boustrophedon' ⍝ I don't think so?
@J.Sallé  Here are some lines  uoy rof txet fo  to make a  nodehportsuob
@FrownyFrog ^
So it’s not shorter than 10
2:50 PM
I was trying to figure out why zlib wasn't working. Turns out I had set 219⌶ to LZ4 not zlib :|
having number parameters for non-number things is a thing I really don't like with APL
3:15 PM
See, it’s 4 bytes
A: Boustrophedonise

ngnAPL (Dyalog Classic), 4 bytes ⊢∘⌽\ Try it online!

@dzaima Those are only temporary until we finalise specs.
Now it‘s official: @dyalogapl is awesome! (We sponsored @FontAwesome‘s Kickstarter for V5) https://fontawesome.com/icons/dyalog?style=brands
@dzaima as Adám said, the ⌶ operator is for temporary stuff until they're fully implemented
also 219 kinda looks like ZIG, although I'd argue 2118 would've been a better number in this case (ZLIB)
what's zig?
3:54 PM
but maybe it's intended to look like ZIP
915 looks like zip mirrored
Some more videos now available from Dyalog '17 at https://dyalog.tv/Dyalog17/?v=KO1HbUSblY8 This week – D06: Py 'n' APL | U11: Polyominoes in APL | U12: Evolutionary Programming
4:14 PM
is there a way to make an if in a dfn that keeps running the following lines?
4:32 PM
_←⍺{condition:action}⍵ seems to work, but its ugly & hacky
@FrownyFrog yeah but that's because ngn is an apl machine >.>
2 hours later…
6:27 PM
@J.Sallé or he probably saw the discussion we were having about this, noticed that this effect could be useful, and made a 4-byte submission with the length of a golfing language's solution
@EriktheOutgolfer maybe, but to get from here to his answer is not trivial at all.
@J.Sallé well, maybe he studied the effect of \ with involution-like functions or something
or just thought of it independently
I mean, it's not like it's obvious that ⊢∘⌽\ will invert every other argument
is an involution
⊢∘ is then used to convert from "reduce" to "return the result of executing the function to the rightmost element of an array"
and \ is used instead of / to do it for every prefix
7:07 PM
@Adám when I do |⍵*÷2 , am I getting the square root of the absolute value of , or am I taking the absolute value of the square root of ?
I don't even know if that makes a difference, tbqh
@J.Sallé absolute of the square root
So I should probably use (|⍵)*÷2
⎕←{|⍵*÷2} 3 4
1.732050808 2
7:57 PM
using APL for non-golfing purposes is fun :D

« first day (317 days earlier)      last day (39 days later) »