« first day (1130 days earlier)      last day (1525 days later) » 

5:32 PM
Why doesn't @ take negative indices?
⍞←-@¯1⊢⍳10
 
@voidhawk INDEX ERROR
 
6:32 PM
@voidhawk what would that do (both in ⎕IO←0 and ⎕IO←1)?
 
@dzaima Expecting it to negate the last element, so 1 2 3 4 5 6 7 8 9 ¯10 (or 0..¯9 for ⎕IO←0)
Don't think negative indexing for, say, or change for different settings of ⎕IO
 
@voidhawk the indexing required for & is different from the one required for - "length" depends on ⎕IO, "position" doesn't. There's so harm in handling negatives for "length", which is what & do
@voidhawk so negating an index only reverses access in ⎕IO←1. and negative indexes, as a result, are extremely weird in ⎕IO←0
so negative indexes in ⎕IO←0 have the cool property that they're cyclic if you just add/subtract from an index. So, wouldn't it make sense to make ⎕IO←0 ⋄ 3⊃'abc' give 'a'? But what would that look like in ⎕IO←1?
 
Yeah, that makes sense
 
aka, adding negative indexing adds a huge discrepancy between how ⎕IO←0 and ⎕IO←1 work, as if there wasn't enough differences already
with under, -@1⍢⌽ is nice and clear (and makes sense for ⎕IO←0 too)
 
 
2 hours later…
9:03 PM
@dzaima With there's no need for @ in that case (or ever, really): -⍢(⊃⌽) Try it online!
 
@Adám right, structural under. Is there any case when both structural undo and inversing under work and would give different results?
 
@dzaima Yes, but they are rare, and in all such cases what the computational under would do either makes no sense, or there's a much more obvious way to get that result. So should prefer being structural if at all possible (as does my model).
 
@Adám any examples? (i don't think there are any in dzaima/APL, so it should probably be possible to add)
 
9:20 PM
@dzaima ⊢⍢(¯3∘↓) is a no-op with structural under (apply to all but the last 3 major cells) while computational under would replace the last three major cells with their prototype because it drops the last three, then re-places three trailing. However, ⍷⍢(¯3∘↑) would be a much more obvious coding of that (assuming monadic being "type", {⎕ML←0 ⋄ ∊⍵} or ⊃0⍴⊂.
 
@Adám oh, 3∘↓ is invertible in Dyalog..
imma attempt to implement structural under, what can go wrong ¯\_(ツ)_/¯
 
@dzaima You're using Java, so I guess it won't segfault. How will you treat ⍵⍵s that have a side effect?
 
@Adám those can't exist, due to there being no syntax (yet) to define structural inversion and the things that do implement it won't have side-effects
 
@dzaima I don't understand what you just wrote, at all. What can't exist? What syntax? What things? Sorry, maybe I'm just being dumb.
 
@Adám A structurally invertable function that has side-effects can't exist. There's no syntax. , , etc will implement structural invertability, but nothing user-definable (yet)
 
9:31 PM
@dzaima Will you allow derived functions and trains as ⍵⍵? If so, then how will you know if the given ⍵⍵ consists entirely of "allowed" functions?
 
@Adám I'll ask it. :p
 
For instance, Dyalog doesn't check, and some side effects can crash it:
⎕←⍕⍣¯1⊢'⎕←1'
 
@Adám
1
DOMAIN ERROR
      ⎕←⍕⍣¯1⊢'⎕←1'
        ∧
 
a function object can be "used" by calling any of call(⍵), call(⍺,⍵), callInv(⍵), callInvW(⍺,⍵), callInvA(⍺,⍵). This would require adding callInv(⍵, originalW), probably returning null if it can't be inverted (or something like that idk)
 
That's interesting. The above crashes APL if ⎕← is omitted: Try it online!
@dzaima We have quite a lot of internal material written in preparation for implementing Under (scheduled for 18.0+1). Shall I ask if I'm allowed to email it to you?
 
9:44 PM
@Adám i wouldn't object
 
:-D
 
yay. now to spam structural inversion definitions everywhere :|
@dzaima oh, in order to implement, say, -⍢(2⊃) i'd also need to add callInvW(⍺, ⍵, originalW) (probably not worth adding callInvA(⍺, ⍵, originalA) though :P)
 
@dzaima How about -⍢⊃⍢⊃ (1 2)(3 4) and -⍢(⊃⊃) (1 2)(3 4) ?
@dzaima Not sure what that means. Also, what do you do in the dyadic case? Like @ (i.e. X∘f) or like (i.e. (g X)f(g Y))?
 
@Adám output. i literally just added an inversion definition to and nothing else :p
@Adám e.g. ⊃.callInvW(⍺, ⍵, originalW) would act (±) the same as ⍵@⍺ ⊢ originalW
for operators it'd require a bit more work due to the boundary between the operator and derived function, but the idea would be that jot should define that (using horrible pseudo-code) A∘f.callInv(⍵, originalW) would act as f.callInv(A, ⍵, originalW)
(using metadot instead of just . would make the expression more APLy :D)
 
@dzaima Like John Daintree's bit ToE dot…
 
9:59 PM
@Adám exactly
got this to work, struggling to wrap my mind around how -⍢(⊃⊃) would work..
 
@dzaima Exactly the same as -⍢⊃⍢⊃
 
@Adám hm.
 
10:17 PM
so for (g h)ꞏstrInv (⍵ ⋄ origW) (switching to APL notation!; also realized i've been confusingly calling structural inverse and computational inverse the same..) i'd need to do gꞏstrInv (hꞏstrInv (⍵ ⋄ g origW) ⋄ origW), but that (potentially unsafe & unneeded) g call needs to happen before I know if it's structurally invertible. hmm
(i think that's wrong actually)
^ yeah. (g h)ꞏstrInv (⍵ ⋄ origW)hꞏstrInv (gꞏstrInv (⍵ ⋄ h origW) ⋄ origW) should be correct, but the problem's the same - i'm not storing (nor can I) the intermediate originals so i need to regenerate them
problem with checking beforehand is that can quickly explode to O(2^N) checks with nested functions. gotta go though ¯\_(ツ)_/¯
(actually if i check before doing anything else, once, it should be fine? but that does mean implementing some structural inversion logic twice)
 

« first day (1130 days earlier)      last day (1525 days later) »