« first day (1229 days earlier)      last day (1412 days later) » 

RGS
8:26 AM
@Adám that is some really unconventional hours to be merging PRs! Don't you sleep?
 
@RGS Sure, I just woke up early.
 
RGS
@Adám ⍥
 
8:57 AM
@RGS that PR is indeed what made me think about it again, i was just providing my thoughts
 
RGS
9:19 AM
@dzaima of course, you are welcome to share them :) in my opinion your suggestion is as good as the description that is currently in use, so I don't think it is worth it to change it
 
9:41 AM
@cannadayr Dyalog APL′.
 
 
1 hour later…
RGS
10:48 AM
@Adám "The goal is to make APL more more appealing"
 
@RGS Thanks, fixed. Actual code feedback is most welcome too.
 
RGS
11:06 AM
@Adám I'll take a look to learn for sure but I couldn't help but notice the duplicated "more" when I opened the repo on my mobile :)
@Adám what type of code feedback would you expect from me?
 
11:29 AM
@RGS Anything is fine, but especially if there are warts in the core APL language that I've not addressed.
 
RGS
11:44 AM
@Adám before that, a quick question. You have your source code split into .aplf and .aplo and .apln files and whatnot. I know there is an APL Cultivation lesson on code management (and other things)
I really should go over it to learn how to work with projects split into separate files and to know how to separate my projects in several files, no?
 
@RGS Or simply items in separate files in targetDir, and then use ]link.create targetNs /path/targetDir
 
@Adám Wait, did you switch to team ⎕IO←0? But I'd still recommend ⎕IO←1 for Interval Index.
 
@Marshall I didn't switch team, but I ⎕IO must go, and without a choice, ⎕IO←0 is probably the better one. I'll fix
 
RGS
@Adám +← 1
 
12:05 PM
@Adám If you're going to ignore empty results in Each, you should do that for Outer Product too. I think the Each code fails in a lot of cases though. Would be easier to do r←⍺⊢¨⍵⋄0∊⍴r:r . Or you might want to just trap the errors if the result will be empty so you still have a chance of computing the prototype.
@Adám In BQN I had monadic Transpose go in the opposite direction so that ⍴⍉⍣n⊢a ←→ n⌽⍴a. Don't know if your version shifting shape to the right is intentional. The "backwards" dyadic transpose is counterintuitive, but I kept it because you can recover the other version (J style) with ⍉⁼, and it allows you to merge axes which J doesn't.
 
@Marshall Excellent idea. Like this?
 _Diaeresis←{ ⍝ ¨ handling empty arrays with failing prototype
     ⍺←⊢
     r←⍺⊢¨⍵
     0⍴⍨0∊⍴r::r
     ⍺ ⍺⍺¨⍵
 }
 _BackSlash←{ ⍝ \ scan first and outer product
     0=⎕NC'⍺':⍺⍺⍀⍵
     r←⍺∘.⊢⍵
     0⍴⍨0∊⍴r::r
     ⍺∘.⍺⍺ ⍵
 }
 
12:20 PM
@Adám Yeah, seems all right.
 
@Adám that makes it still not usable for a mutating ⍺⍺
 
@dzaima In what way?
@Marshall I'm just remembering that Scan needs fixing. It should be ⍺⍺¨ prefixes of .
 
@Adám it'll still execute on the prototype, which is something i personally have never ever wanted, and most of the time doesn't error
 
@Adám Should be good as well. For Outer Product the result shape computation is much simpler, so it's about as easy compute it with 0∊⍺,⍥⍴⍵ as to get a dummy result.
 
@dzaima I don't understand "and most of the time doesn't error".
@Marshall Ah, good point. Waste of resources if unneeded.
 
12:26 PM
@Adám {a,←⍵}¨⍬ still successfully appends a 0 to a (maybe you're not trying to fix that though, just guessing because this is definitely something would call a bad thing about other APLs)
 
@dzaima You don't want the side effects from executing on the prototype, but you probably do want it to compute the prototype if possible. This is easy not to notice. For example dyadic ≡¨ should always return a simple array even if the arguments have nested prototypes.
 
@dzaima That is a good point. I'd need a side-effect checker though. Something Marshall would have implemented…
 
@Marshall I haven't used prototypes much (or really at all) either. Though i am biased as dzaima/APL practically doesn't have prototypes
 
@Marshall What about Rank on empties?
 
@Adám That would have the same issue. If you redefine the Rank operator as enclose-with-rank, function each, mix then it would inherit the Each solution.
 
12:33 PM
@Adám if it can't create a proper prototype, i would choose to return an array with an no prototype (±(⍴r)⍴⎕NS⍬)
 
@dzaima Ooh, that's an interesting (ab)use of that fact. But then it becomes impossible to replace the prototype later.
E.g. {1}¨0⍴⎕NS⍬ will fail.
 
@dzaima That's probably better than my version.
Getting breakfast. I'll be back.
 
@Adám it's what i do anyway
@Adám that's really the correct answer here, because it could access invalid data (unless you also implemented checking for no-arg dfns). You could special-case-allow A⍨¨ if you really wanted to
 
@dzaima Hm, I'm not sure. Let's say you had CreateDir¨'/root/'∘,¨listOfDirs
Ah, you're right, that'll still work. Only if we can't get a prototype, then don't. Good, will do.
 
@Adám (my comment about no-prototypes was made unrelated to my thoughts on mutating; i still would personally prefer that all 0-¨es would make invalid prototype arrays allowing for proper mutating)
 
1:31 PM
@Adám Some malformed markup in the README (swapped | and `): github.com/abrudz/dyalog-apl-prime/commit/…
 
@Marshall Thanks. Fixed. (Auto-generated markdown FTW.)
 
2:22 PM
@Marshall I didn't put much thought to it, but I've always thought went the wrong way too.
 
ngn
2:40 PM
@Adám isn't ⊃i⌽a←→i⊃a a nice identity?
(scalar i, vector a)
 
@ngn It is, and I've thought about that too, but I'm not sure that justifies it.
 
@Adám May be more convincing to say i↓a is a prefix of i⌽a. In general I think there's a principle that you'd rather do arithmetic to obtain argument indices than result indices, and in that view it's obvious that result element j being argument element n|r+i is the most natural formulation.
 
Right, so, without an inverse primitive that's so simple that it appears like notation, I think needs to do the obvious thing.
 
This principle shows up with BQN's Window (↕, like APL dyadic ,/) where you have i‿j⊑w↕v ←→ (i+j)⊑v. The right side must have the arithmetic and there's no way to move it to the left.
@Adám Is there an obvious thing?
 
2:55 PM
⍵⍉⍨1⌽⍳≢⍴⍵, no?
 
@Adám That's the obvious implementation. To the programmer the choice is between "move the last axis to the front" (your code) and "move the first axis to the end" (the other direction) and I don't think it's clear which one to take.
Thinking in terms of any kind of dyadic transpose is a mistake in my opinion.
 
ngn
@Marshall first to the end. this way it's easier to go through the axes in order.
 
Yeah, that does make sense.
 
ngn
(assuming your language encourages working with leading axes)
 
That's the whole point of Prime.
done.
 
3:01 PM
@ngn Okay, I was about to dispute the axis ordering but if you have operations that allow you to leave out trailing axes then that definitely makes sense.
And everyone has those.
 
 
4 hours later…
7:09 PM
@user324537 If you want to participate here, email me: adam@ with the domain of www.dyalog.com, but be aware that the subject here is the APL programming language, not Apple Computers.
 
7:54 PM
Is there any sensible way to handle equilateral-triangular grids in APL? I have a task that starts with an equilateral triangle with numeric values at each corner, and progressively divides the triangle into smaller triangles by computing the midpoint of the triangle's side as the average of the numbers at the corners plus a small random increment.
I can more-or-less handle the average-and-add part; it's the "picking the corners" that I'm hitting a conceptual block on.
 
Is that to all sides from the triangle, so the grid grows and grows?
 
Sorta.
The original corners stay the corners of the final triangle; it's just more densely filled in.
 
I think the way it is usually done is by regarding every other row of a matrix as indented half a unit.
@JeffZeitlin So do you know in advance how many divisions you'll make?
 
In this particular case, I do; ideally, it should be parameterizable.
The zeroth iteration is just the corners. The 1th iteration is the corners and the respective midpoints, total six values.
 
Right, so if you begin with a large enough grid, you can work your way inwards. Alternatively, you can go with a "sparse" representation, and simply store coordinates and values.
 
7:59 PM
The 2th iteration is fifteen numbers.
The 3th iteration is 45 numbers
Et cetera
 
I'm not sure I am even visualising it right. A drawing might help
 
0th iteration:
-1-
1-1
1th iteration:

--1--
-1-1-
1-1-1-
2th iteration:

-----1-----
----1-1----
---1-1-1---
--1-1-1-1--
-1-1-1-1-1-
And so on
The 1s are where I need to end up with values;
The 1s at the corners of each iteration are the same corners. I'm just increasing the "resolution" of the triangle each pass.
I could in theory accept starting with a triangle of size k, and progressively fill it in.
 
Yeah, that's what I was thinking, for ease of visualisation. Although you might want to keep it a square matrix, and simply not use the part NE of the diagonal.
 
If that can work, I'd have no problem with handling it that way.
 
Write a little cover function to compute the indices for the Nth gen.
 
8:09 PM
Part of the problem, I think, is that if I use the square matrix, I'm not quite sure I see how to expand the number of rows interleaving.
 
You could store it in the upper-left half of the matrix. Then the first two barycentric coordinates are the matrix indices and the last one is the side length minus their sum.
In geometry, the barycentric coordinate system is a coordinate system in which the location of a point of a simplex (a triangle, tetrahedron, etc.) is specified as the center of mass, or barycenter, of usually unequal masses placed at its vertices. Coordinates also extend outside the simplex, where one or more coordinates become negative. The system was introduced in 1827 by August Ferdinand Möbius. == Definition == Let x 1 , … , x...
Interleaving should just be inserting an extra space between every index in both dimensions.
 
@Marshall - THAT just mananged to confuse the heck out of me; I'm not a mathemagician. :)
 
So a clean way to define an equilateral simplex is to add an extra dimension. For a triangle, you define it as part of 3-d space.
Specifically, you say it's part of the plane where the sum of all coordinates is 1. If you require all coordinates to be positive, you get an equilateral triangle. Like a cobweb in the corner of a room.
Easier to see for a 1-simplex (line segment) in 2 dimensions. Look at the line x+y=1, or y=1-x where x and y are 0 or more, that is, the upper right quadrant.
If you add a z dimension, that segment becomes one side of the triangle.
 
OK, that visualization helps.
 
All right. If that makes sense then the idea is just that we need to drop a dimension to fit the triangle in a matrix. The obvious way is to look at it head-on, facing the corner, but that turns out to be mathematically messy. Instead you want to look down one axis, so the perspective turns it into a right triangle.
And we may as well line up the other axes with the matrix axes by increasing index. That's how you end up in the upper right half-matrix.
Barycentric coordinates usually make working with triangles a lot easier, but I'm not finding a good tutorial. There's some stuff here. redblobgames.com/x/1730-terrain-shader-experiments
 
 
3 hours later…
11:20 PM
@Adám Yet another question for wiki titles:
- X[Y] Bracket indexing vs. Bracket Indexing
- X⌷Y Squad indexing vs. Squad Indexing vs. Index (function)
(Btw, I'm planning to write a separate page called "Indexing" to summarize various ways of indexing into arrays, including brackets, squad, pick, and select)
 

« first day (1229 days earlier)      last day (1412 days later) »