« first day (638 days earlier)      last day (2016 days later) » 

12:01 AM
(life⍣3001)a
seems to work
 
@nathanrogers doesn't seem to for me (⍣2)
 
hrm
i don't get it really. so is 1 ⍵ the left argument to ∧
why?
and also how
i thought lists to the left had to be in parens
what are the rules for that?
 
1 ⍵∧3 4= is a strange way of writing 1∧3∘= and ⍵∧4∘=, so the whole left side is ((1∧3∘=)∨(⍵∧4∘=)), and 1∧3∘= is obviously is just 3∘=
@nathanrogers no they don't. space separated lists always join together before everything else
 
oh good
 
i.e. 1 2+3 does (1 2)+3, not 1 (2+3)
 
12:05 AM
neat
this expression really looks like it should do 3 4 = ...
get 2 mats
then ⍵∧...
then ∨/1 ...
since you know, its supposed to evaluate right to left or something? but in this case it really doesn't read the way its supposed to evaluate to me
 
@nathanrogers Yeah, I also hate spacing not indicating separation
 
When parsing APL, stranding happens first
 
which is waht?
 
Arrays seperated by spaces are stranded
 
@nathanrogers yeah the whole "everything" part isn't "everything" at all, but just functions.
space separated nilads join together first, then operators join in and then functions connect everything together.
@dzaima *"everything" from the phrase "everything gets evaluated right to left"; didn't realize that wasn't specifically said before anywhere
(okay maybe it's kind of true as in a b c d e f g ..., with the letters being any expression, i.e. parentheses, built-ins, function names or literally anything else you put in APL expressions, get executed right to left to figure out what they even are and what to even do with them, but that's just complicated.)
i.e. (⍎'⍞←1⋄1')(⍎'⍞←2⋄2')(⍎'⍞←3⋄+')(⍎'⍞←4⋄+')(⍎'⍞←5⋄/')(⍎'⍞←6⋄3')(⍎'⍞←7⋄4')(⍎'⍞←8⋄5'‌​) prints 87654321, and then the result of 1 2++/3 4 5, which are the individual results of each parentheses.
@ngn what
 
12:50 AM
if (random(1.1)>.5) throw null; professional debugging
 
1:31 AM
\o/ finished my double-ended priority queue and now the grapher can add ~500k points per second, though with 400k drawn it's at 5fps.. Has exactly 0 practical use, but was good practice for algorithmic efficiency.
 
 
6 hours later…
ngn
7:07 AM
@dzaima can't do that. the error message could have been nicer of course...
 
 
2 hours later…
9:01 AM
@dzaima Almost always. Array. binds stronger than Array Array, so ns1 ns2.x means ns1 (ns2.x) and not (ns1 ns2).x as indicated by the table of binding strengths
 
Ven
The Power of The Dot compels you
 
@H.PWiz ^^
@Ven Long time no see. Good to have you back!
 
Ven
@Adám Something like June or July, yes. It's good to be back, though I missed all the fun :).
 
 
1 hour later…
10:25 AM
Announcement: VS Code support
 
10:41 AM
@ngn no not the error, but this vs this
@Adám yeah I know, but I consider them more as exceptions, not syntax
@Adám oh there's an APL plugin for Atom :D
 
@dzaima Hm, interesting issue though. In my proposal (⍞←1 ⋄ ⍞←2) would print 12 to stdout while (⍞←1)(⍞←2) prints 21.
@dzaima Btw, your output format seems a bit odd to me. rank≥3 prints as a dfn with JSON or something? And that isn't valid code? Also, empty arrays are printed as expressions using '' for character arrays but using ? for numeric ones. 0⍴0 gives ? but 0⍴⍬ gives .
@dzaima Also ⍪⍬ fails to give 0 1⍴0
 
@Adám I found a ½JSON-ish format easier to use than outptting layers separated by spaces of powers of 2 or whatever.. The ? thing just indicates that I haven't defined a prototype for that yet ( does give )
and I haven't dealt with prototypes pretty much anywhere.
 
@dzaima Right, 1⍴⍬ works, but 1↑⍬ doesn't ⍨
 
also dyadic & & , work only with specific rank differences. No idea what exactly I made it do, but I did make something.
there are also these things
 
10:58 AM
@dzaima Neat.
 
I'm pretty sure that JSON-ish output should be mostly reversable, though with some edge-cases for sure
 
@dzaima Why not adopt my oneline notation?
 
@Adám which is?
@Adám right, I have no idea why that's a thing but sure
 
@dzaima 2 3⍴⍳6 gives [1 2 3 ⋄ 4 5 6]
 
@Adám how does it work for rank>2?
 
11:05 AM
@dzaima 2 3 2⍴⍳12 gives [[1 2 ⋄ 3 4 ⋄ 5 6] ⋄ [7 8 ⋄ 9 10 ⋄ 11 12]]
Each statement has minimum rank 1, and brackets increase rank by 1.
So ⍪1 2 3 gives [1 ⋄ 2 ⋄ 3]
 
@Adám what about ↓2 3 2⍴⍳12 then?
 
@dzaima [1 2 ⋄ 3 4 ⋄ 5 6] [7 8 ⋄ 9 10 ⋄ 11 12] (or ([1 2 ⋄ 3 4 ⋄ 5 6] ⋄ [7 8 ⋄ 9 10 ⋄ 11 12]) if you also want to adopt my vector notation)
 
@Adám uh, then 2 2⍴⊂2 2⍴⍳4? :|
 
@dzaima [[1 2 ⋄ 3 4] [1 2 ⋄ 3 4] ⋄ [1 2 ⋄ 3 4] [1 2 ⋄ 3 4]]
 
@Adám isn't that the same as 2 2 2 2⍴⍳4?
@Adám oh that's what that means. I wanted something that's exactly the same for all dimensions though
@Adám oh I added a special case for that, but made the if for it check for rank==0 instead of rank==1 && shape[0]==0
 
11:14 AM
@dzaima No, that would be [[[1 2 ⋄ 3 4] ⋄ [1 2 ⋄ 3 4]] ⋄ [[1 2 ⋄ 3 4] ⋄ [1 2 ⋄ 3 4]]]
 
I just have a hard time understanding the idea of that.. That now looks as 2 1 2 2 2⍴ :|
 
11:36 AM
@dzaima Clearer?
[[[1 2
   3 4]
  [1 2
   3 4]]
 [[1 2
   3 4]
  [1 2
   3 4]]]
 
Ven
In Mac, when in )ed mode, is there a way to persist changes without closing the window?
I'm just editing a defn
 
ah. I've set a shortcut for that in RIDE
FX/"Fix the current function"
 
Ven
That exists in the windows IDE, but I don't see it on Mac.
 
@Ven what is the Mac IDE?
 
Ven
IDE: Version: 4.0.2863 Platform: MacIntel Date: 2017-11-10 14:34:26 +0100 Git commit: ff65ccc4adead86c9d8455e5f51519b59055f4db
 
11:40 AM
@Ven RIDE?
 
@Ven Edit > Preferences > Shortcuts > "FX"
 
Ven
@Adám Perfect, thanks! (it's not in Edit on Mac, it's under the program name)
 
no idea why that's not set to anything by default. I literally can't do anything without it
 
@dzaima GNU APL allows fnname[axis] y tradfn headers and dfns use χ for the axis.
 
11:46 AM
ah, I'll go ahead and implement that then :D
 
@dzaima I think it is a bad idea. They've begun abusing it as an abnormal 3rd argument.
 
@Adám so? :p
 
Ven
APL developers, abusing features in ways they weren't meant for? I can't believe that. :P
 
it'll only allow integers (and only 32-bit ones at that) too
 
@dzaima All the downsides of bracket indexing and axis, with no benefit over making your function a monadaic operator.
 
11:51 AM
@Adám what if I need 5 arguments?
and if there are no benefits, noone really should do it either.
 
@dzaima oh right half-dimensions exist :/
 
Dec 19 '17 at 19:26, by Erik the Outgolfer
GNU APL and Dyalog APL aren't the same thing, the latter makes sense
 
@Ven I tried to explain the :/ to them in the chat after seeing that. That's the same nathan rogers here
 
@Ven What's wrong?
 
Ven
11:59 AM
@Adám ?: vs :⋄
 
@Ven can be used like (my emphasis)
 
@dzaima oh and it changes value based on ⎕IO.. Yeah that's not going to work
should I just be horrible and make the value only accessible with "χ"⊃⎕scope? :p
 
@dzaima Just don't allow bracket except for primitives that have historic reasons.
 
@Adám oh what you suggest in place of brackets for primitives? (and yes I was joking)
 
@dzaima I didn't suggest anything. I said to allow brackets only in traditional places. However, one could have / be a dyadic operator: (+/3)array instead of +/[3]array etc.
 
12:09 PM
ah, "historic reasons" implied "no reasons now" for me
 
@dzaima Right. In the old days, nobody realised that an operator could take an array as operand.
 
ngn
12:56 PM
@dzaima ngn/apl knows in advance what is what in the ast (array / function / monadic operator / dyadic operator), so it doesn't need to evaluate strands right-to-left like dyalog
 
1:33 PM
@ngn ah. How does this work though?
 
ngn
@dzaima well, it knows in advance that A is an array and f is a function. what is so special about this expression?
 
@ngn ah, it figures that out not on the fly? o.O
 
ngn
@dzaima it figures it out before evaluating anything
so things like a←0 ⋄ a←+ are not allowed
a←+ ⋄ a←¨ and a←¨ ⋄ a←⍣ aren't allowed either
 
I'm struggling to understand how this works
{⊃∨/1 ⍵∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵} a
(where a is 10 10 ⍴ of a glider)
the part I'm struggling with is everything to the left of 3 4
1 ∧ 3 =... out makes sense
but ⍵∧4=... doesn't make any sense
its a 10x10 of 10x10s
so how is it that when I write 1 ⍵∧3 4=... its magically a 2x 10?
 
@nathanrogers (2 2⍴⍳4)∧(2 2⍴⍳4) is just a 2x2 matrix
 
1:48 PM
shouldn't it be a 2x(1x10),(10x10)
my question is to do with the difference between ⍵∧4= and 1 ⍵∧3 4 =
 
ngn
ignore the above, i read it wrong
 
@nathanrogers the argument to 3 4= is enclosed, so the result of it is a vector of 2 matrices. Then, element-by-element, it's and-ed with 1 ⍵
 
ngn
hm... actually it's right - it is enclosed
 
what's happening there is just like what's happening in 10 20+1 2, returning 11 22
 
1:52 PM
why and how is it enclosed? I didn't enclose it, I thought that's what the enclosing operator is for
 
ngn
the reduction (+/) is on a vector of matrices, so the result is an enclosed matrix
 
@nathanrogers / on a vector results in an enclosed array.
 
ngn
@nathanrogers you know, when you sum a vector (rank 1) of numbers, you get a scalar (rank 0), right?
so this is the same, except that the vector and the scalar have matrices inside instead of numbers
an enclosed matrix is like a scalar containing a matrix
 
10 (20 30 40)+(1 2 3)(4 5 6) I guess would be a better example of what's happening there
 
a∧(⊂4)=+/,¯1 0 1∘.⌽¯1 0 1∘.⊖⊂a
this doesn't answer any questions for me
 
ngn
1:57 PM
@nathanrogers ⊂4 is the same as 4
but ⊂matrix is not the same as matrix
 
@nathanrogers the result of (⊂4)= is enclosed. You don't want that if you're only doing one operation
 
⊂,4 then?
still doesn't work
i get a 10x10x10
 
ngn
@nathanrogers could you post all of your code? including how you created a
 
@nathanrogers if you're only doing one operation, you want a∧4= ⊃+/
@nathanrogers do you understand why 10 20 + ⊂1 2 3 does what it does?
 
a←¯3⌽¯3⊖ 10 10↑5 5↑ 3 3⍴0 0 1, 1 0 1, 0 1 1
 
ngn
2:00 PM
⎕←{⊃∨/1 ⍵∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵} ¯3⌽¯3⊖ 10 10↑5 5↑ 3 3⍴0 0 1, 1 0 1, 0 1 1
 
@ngn
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 1 1 0 0 0
0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
 
ngn
@nathanrogers ^ so isn't the above correct?
 
yes
but I am attempting to understand to the left of 3 and 4
my question is 1 ⍵∧ 3 4... gives me a nice 2x10x10
2 item list of boards
1 ∧ 3 is a nice 1 x 10x10
things are making sense
 
@nathanrogers 2 because there are 2 items in 3 4 and 1 ⍵
 
but ⍵∧4... gives me a 10x10x10
 
2:03 PM
@nathanrogers because that's not doing it correctly
 
ngn
so +/ gives you an enclosed matrix, 3 4= gives you a vector of 2 matrices, 1 ⍵∧ the same, then ⊃∨/ boolean-or-s them together
 
oh I guess ⍵ is boxed too
 
⊂⍵∧4 works. no i guess I don't understand why it does that
I would have assumed that operations like that needed an ¨ operator
 
@nathanrogers do you understand why 10 20 + ⊂1 2 3 works? And 10 (20 30 40)+(1 2 3)(4 5 6)?
Those are the 2 essential building blocks of the expression
 
2:06 PM
^^^no I don't.
 
@nathanrogers The first is just like 10 20 + 5 - except instead of the scalar 5 the right argument of + is the scalar 1 2 3, and so + gets done as (10+1 2 3)(20+1 2 3), just as it does with (10+5)(20+5)
the second example is just a more advanced version of that - just like 1 2+10 20 is (1+10)(2+20), 10 (20 30 40) + (1 2 3)(4 5 6) is (10+(1 2 3)) ((20 30 40)+(4 5 6))
 
i guess I don't understand why its enclosing anything. 1 ⍵ isn't enclosed and 3 4 isn't enclosed, but then in the expression 1 ⍵∧3 4 ... it IS enclosed. why?
 
replace 10 20+ with 3 4=, and 10 (20 30 40) + with 1 ⍵ ∧, and you get that expression
@nathanrogers the result of +/ is the only thing enclosed.
(oh, and also ∨/, since that's another reduce of a vector)
 
⎕←1 (¯3⌽¯3⊖ 10 10↑5 5↑ 3 3⍴0 0 1, 1 0 1, 0 1 1)
 
A cell is alive in the next generation if it was (1) dead with three alive neighbours, (2) alive with two alive neighbours, (3) alive with three alive neighbours. This can be simplified slightly to "a cell is alive in the next generation if it had three alive neighbours (including itself), or it had four alive neighbours (including itself) and was alive". This is (3=S)∨⍵∧4=S, where S is a matrix of neighbour counts. This then re-written as (1∧3=S)∨⍵∧4=S then 1 ⍵∨.∧3 4=S.
 
2:13 PM
@nathanrogers
┌─┬───────────────────┐
│1│0 0 0 0 0 0 0 0 0 0│
│ │0 0 0 0 0 0 0 0 0 0│
│ │0 0 0 0 0 0 0 0 0 0│
│ │0 0 0 0 0 1 0 0 0 0│
│ │0 0 0 1 0 1 0 0 0 0│
│ │0 0 0 0 1 1 0 0 0 0│
│ │0 0 0 0 0 0 0 0 0 0│
│ │0 0 0 0 0 0 0 0 0 0│
│ │0 0 0 0 0 0 0 0 0 0│
│ │0 0 0 0 0 0 0 0 0 0│
└─┴───────────────────┘
 
well I guess that is enclosed
 
I post this in case part of the misunderstanding lies outside of what is being discussed
 
@nathanrogers no?
 
After 3 4= it's not enclosed (enclosed = being a scalar), just as the result of 3 4+1 isn't a scalar
 
2:14 PM
⍵∧4=.... returns a 10x10x10
(⊂⍵)∧4= returns a 1x10x10
so it would have to be
 
@nathanrogers just 4= results in enclosed (aka a scalar), just as 4+5 results in a scalar
 
but type 1 ⍵
they're both boxed
1 and ⍵ respectively
 
@nathanrogers boxed ≠ scalar
 
I said enclosed. enclosed ≠ boxed??
I never said scalar
what are we talking about. I'm really confused :*( every time I begin to think I understand something, there's 10,000 things I don't understand
 
@nathanrogers enclosed = scalar (or am I stupid?)
 
2:17 PM
no, I'm not suggesting anyone is stupid. I don't know anything
 
Enclosed means that it is a nested scalar
 
@H.PWiz nested scalar?
 
i.e that its rank is 0
 
I was looking for a simple answer to why ⍵∧4=... was returning some crazy unexpected result, but the answer is that ⍵ needs to be boxed for it to return a result like in the expression
 
@dzaima As opposed to simple scalar
 
2:18 PM
(⊂⍵)∧4=... gives the expected result, and ⍵ is boxed because of the early list binding of 1 ⍵
then 1 is 1 because we need to keep everything in the 3 matrix, but then we only want to keep ones that are both 1 in ⍵ and in the 4 matrix
 
@nathanrogers it's just like 1 2 3 + 2=⊂1 2 3 vs 1 2 3 + 2=1 2 3 vs (⊂1 2 3) + 2=⊂1 2 3
 
@nathanrogers You are using (a scalar function) on something of shape 10 10 and on something of shape . In this case the array of shape is (scalar) extended to an array of shape 10 10 (where all the elements are identical). then each element of (a single number) is 'd with each element of the scalar extended right argument (each an enclosed matrix)
 
no its not. it's like 1 2 3 + 1 2 3 vs (⊂1 2 3) + 1 2 3
 
@nathanrogers The result of +/ is enclosed
 
that's fine
 
2:21 PM
@nathanrogers no.
 
but running ⍵∧4... gives a 10x10x10
that's
the question
why
because
⍵ isn't boxed
 
@nathanrogers that happens because +/ returns a scalar
 
⎕←{⍴⍵∧4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}¯3⌽¯3⊖10 10↑5 5↑3 3⍴0 0 1,1 0 1,0 1 1
 
@H.PWiz
10 10
 
@nathanrogers No it doesn't ^
 
2:23 PM
@H.PWiz well, it also has depth
 
So what
 
yes it does! you can try it!
{⍵ ∧ 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}a
{⊂⍵ ∧ 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}a
or wait. what are we talking about?
look the answer is that ⍵ is boxed because of the list 1 ⍵ which gives the result in the original expression
 
@nathanrogers it gives a 10x10 matrix where each element is 10x10 is what @H.PWiz is saying
 
It's important to note that the depth and shape are different. The shape is what you expect 10 10. It's just that the elements of the left and right argument are paired up in a different way than you were expecting
 
yes. that's wha tthe question was about
 
2:25 PM
So, did you understand:
⎕←1 2 3+⊂4 5 6 7
 
⍵ needs to be boxed
 
@H.PWiz
┌───────┬───────┬────────┐
│5 6 7 8│6 7 8 9│7 8 9 10│
└───────┴───────┴────────┘
 
not in context no
do I UNDERSTAND the difference between (⊂⍵)∧4... and ⍵∧4... ? absolutely not. Do I see the difference? absolutely
I don't understand the restult of ⍵∧4... at all
 
@nathanrogers do you understand how (1 2 3) + 5 is equal (1+5)(2+5)(3+5)?
 
2:28 PM
@nathanrogers Now replace that 5 with any other scalar, here the result of +/, and it's exactly the same.
 
It is important to have a very good understanding of how scalar functions work. How the arguments are paired up. The explanation for the result of 1 2 3+⊂4 5 6 is identical to an explanation for the result of {⍵∧4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}¯3⌽¯3⊖10 10↑5 5↑3 3⍴0 0 1,1 0 1,0 1 1
 
(in ^ we replace that 5 with the scalar ⊂4 5 6)
The result of 1 2+⊂3 4 5 is (1+3 4 5)(2+3 4 5). See how the element count gets multiplied - 2 × 3 = 6 items in the result. We can safely ignore the 4= since all it does is modify the numbers and we only care about shapes. Then you're doing (10 10⍴a) ∧ ⊂10 10⍴a, and again, the item amount multiplies - 100 × 100 = 10000
 
@dzaima Btw, for reductions, you can always use instead of bracket: +/[k] ←→ +⌿⍤¯k assuming ⎕IO←0.
 
ngn
2:44 PM
@Adám except for k=0
 
@ngn Yes, but that's just +⌿
 
 
5 hours later…
7:20 PM
Whoa, vector product can be expressed as (1 ¯1)(¯1 1)-.(×.⌽)⊂ (takes a two element vector of vectors). That's some serious inner product usage.
 
ngn
@Adám that's the innest product i've seen :)
 
CMC: Can ^ be expressed using flat arrays to avoid enclosing the result? Can the two rotation vectors be combined somehow?
@ngn innermost
 
 
1 hour later…
ngn
8:40 PM
@Adám no no, the innest, the most inn :)
 
 
3 hours later…
11:17 PM
Wondering - is there a way to get every other element in an array in APL? Or every 3rd, etc?
 
@Quintec I'd probably do something like {(0=3|⍳≢⍵)/⍵}
 
Yeah, I feared as much
@dzaima Is there a documentation for your APL? Like what is unique about it :)
 
Literally just found that doc xD
 
@Quintec that in my APL, but the array size has to be divisible by the 2/3/whatever
 
11:23 PM
@dzaima How does that work
 
there's not much really unique about it, I just wanted an APL with these things & other stuff I've wanted and it was a very good learning experience
@Quintec a in the dimensions for makes it guess the number that's supposed to be there for all items to be used. Beyond that, it's regular APL
 
huh nice
 
^^ an example of one of the things I've wanted in an APL
 
I'll definitely play around with ti
@dzaima Is -s a necessary command line argument?
 
@Quintec it starts a silent REPL after running code
 
11:30 PM
Got it
 
(silent as in no > s)
 
@Quintec uhh yeah I still have to make a codepage ._.
 
Well then, shh
 
11:40 PM
@Quintec also hmm should I make var←\n value work
 

« first day (638 days earlier)      last day (2016 days later) »