« first day (1335 days earlier)      last day (1312 days later) » 

7:25 AM
@Adám Have you ever seen `(⊢,,¨)\` used before, as in this answer?
(Backslash strikes again)
 
(Try doubling your backticks)
 
(⊢,,¨)\
 
@Bubbler No. (⊢,,¨)\ is very nice, though I'd prefer the order given by ⌽⌽¨¨(⊢,,¨)\⌽
@Bubbler (I typed ``(⊢,,¨)\``)
 
(⊢,,¨)\
Oh, it works ⍨
 
APLcart currently has
(⍳∘≢,/¨⊂)Yv All possible subvectors grouped by length (Yv must be simple)
I should amend that to say "contiguous" and add yours with "(including non-contiguous)".
To get the proper lexicographical order, is there a simpler way than my reversals or sorting?
 
7:38 AM
Like 123 → 1 2 12 3 13 23 123?
 
Yeah, either flat like that (⋄ (⍋⊃¨⊂)⊃,/(⊢,,¨)\'ABCD') or grouped by first element like ⋄ ⌽⌽¨¨(⊢,,¨)\⌽'ABCD'
 
@Adám
A AB  ABC  ABCD  ABD  AC  ACD  AD B BC  BCD  BD C CD D
 A AB  AC  ABC  AD  ABD  ACD  ABCD   B BC  BD  BCD   C CD  D
 
Oh the second one 1) by first letter, 2) shortlex, 3) lexicographical.
 
I don't think it's shortlex (ABC coming before AD)?
It's just an order imposed by the binary digits of 0..2^i-1, grouped by first chars (or last for the original scan).
 
@Bubbler Oh, right.
 
 
6 hours later…
1:35 PM
@Razetime (fwiw this is my 21 byte solution)
 
oh my god what in the world
 
⋄ 'does'
'this'
'work'
@Moonchild moon-child: Any plans to reinstate ^?
 
1:51 PM
The dyalog sharpplot feature is amazing, using it so much, it's better than desmos in some ways!
 
sharpplot is older, right?
 
is there a way to get ]runtime to show more granular numbers for one snippet like ]runtime -compare does? With one snippet it happily says "0ms" instead of 1e¯5 style
Marshall's talk on sub-nanosecond binary searching - how does Dyalog keep track of whether an array is sorted and can be binary searched, vs unknown and must be linear scanned? array←⍳1e8 ⋄ num ∊ array seems to do a linear scan from the runtime
 
@TessellatingHeckler don't know about ]runtime, but with 'cmpx'⎕CY'dfns' you can use 1 cmpx 'expression'
 
2:08 PM
@TessellatingHeckler Monadic cmpx from the dfns ws instead:
      'cmpx'⎕CY'dfns'
      cmpx'⍳10000'
8.0E¯7
 
@dzaima neat, thanks :) I knew dfns.cmpx was somewhere, I couldn't remember how to use dfns and didn't want to ask again (and didn't want to go yak shaving and searching). I was using ]runtime -compare 'num ∊ array' 'num ∊ array' turns out with a fresh view ]runtime -compare 'num ∊ array' '1' is good.
 
(i've been annoyed multiple times that ]runtime decides that i shall not use -c with just one expression; while it makes sense, it's still somewhat weird that (afaik) there's nothing besides cmpx to replace the functionality)
@TessellatingHeckler i was about to suggest that workaround too
 
@TessellatingHeckler You can always ask APLcart.
 
@Adám Thanks also; I again didn't think of APLCart :( now I've added dfns import to my notes
 
@TessellatingHeckler If you set Options→Configure→Help/DMX→☑ Use online help for non-Dyalog topics URL: "https://aplcart.info?q=%s" then you can press F1 on a word to quickly search APLcart for it.
 
2:17 PM
@TessellatingHeckler (though i'm in no position to know,) i'm fairly certain it just doesn't and i'd guess either whatever was talked about isn't implemented or wasn't for O(1)ifying big array operations
@dzaima (-101%? ¯4.E¯7? :D)
 
@Adám is there anywhere on dfns.dyalog.com that says how to use them?
 
@TessellatingHeckler I don't think so. Unfortunately, most of our documentation assumes "basic" knowledge, with no pointers to anywhere that'll give you that. Could partially be because there isn't such a place. We are working on alleviating this, though.
 
2:44 PM
@Adám I guess the closest place is "Mastering Dyalog APL", but it's hard to be motivated to read a huge comprehensive book for a golf hobby
 
@TessellatingHeckler Right. We are working on true "Getting Started" guides.
 
@dzaima array←?1e8⍴4 then 1 cmpx '(?1e8)∊array' comes out as 5e¯7 which is way too fast to be a linear scan. 1 cmpx '0∊array' comes out at 10ms which is much more in line with the times I'm expecting for a linear scan
(⎕io←1 so 0 is not in the array for sure) but why there would be a shortcut where "huge number is not in long array of small numbers" that doesn't also work for "zero is not in long array of numbers ≥1"
 
@TessellatingHeckler Your array is a 1-byte sint array, but ?1e8 is very likely to be a 2-byte or 4-byte sint number, so the number cannot be in array.
 
@TessellatingHeckler for (?1e8)∊?1e8⍴4 the fact that ?1e8 is probably over 256 probably plays a role
 
last night started porting some of bqn.js to erlang.
https://github.com/cannadayr/bqn_vm/blob/master/src/lardo.erl
im a n00b @ both so bewares
 
 
2 hours later…
ngn
4:43 PM
@Bubbler clever
 
@ngn Yeah, had I just seen that code, I would have been willing to bet that you wrote it.
 
ngn
@Adám thanks for the compliment :)
@Bubbler ∊⍎¨¨ -> ⍎⍕
 
RGS
4:59 PM
Say I have a vector of a's called As, a b, and a function F that takes an a on the left and a b on the right.
Then F/⌽b,As reduces my list As correctly
producing a b in the end...
but if I want to collect the intermediate results, changing / to \ doesn't work
is there a smart pattern to go around this?
 
@RGS This?
4
A: Tips for golfing in APL

AdámUse ⍨ Avoid parentheses ⍨ (Commute) can save you bytes by avoiding parentheses. Whenever you have a function where the left argument needs to be parenthesised and the right argument does not, you can save a byte, e.g. (A<B)÷C → C÷⍨A<B. Double arrays To append a copy of an array to its end, use ,⍨...

See "Reverse scan" there.
 
RGS
@Adám that's exactly it
it is so ugly, though :(
 
ngn
@RGS +←1. apl's / and \ should have been designed to follow the direction of indices, not the direction of syntax.
 
6:11 PM
Rules question. If I want to change to the j locale for a J golf so I can access the builtin j constants without the _j_ suffix, can I make the locale change in the header so it doesn't count against the byte count?
 
@Bubbler it is specified which way round is the correct way for the snake, and it must be printed the correct way round, but the question doesn't say "and don't also print it the wrong way round as well". Printing it both ways might be shorter code.
In a question like "primes to 100", printing "numbers to 100" and arguing that they include the primes wouldn't work, but splitting the primes out separate and also printing the other numbers, might work. Some questions do say "no extraneous output" or "only this and an optional trailing space" and the snake one doesn't. (In reference to a comment a few days ago)
(I doubt it would actually be allowed though)
 
6:52 PM
@Jonah I doubt we have a consensus on it.
 
@Jonah assuming j's "locales" are like namespaces/closures, i would guess that's not allowed
 
@dzaima It'd be like requiring the code to be run from within ⎕SE.
 
@Adám or dfns
 
7:14 PM
@dzaima No, because these are already present without any explicit import statement necessary.
 
Correct. they're present and can be accessed using name_j_. switching to the locale then allows you to access it using name alone.
 
It would be exactly parallel to )CS ⎕SE if ⎕SE actually contained anything useful.
 
7:54 PM
golfed to 1054 - mostly reusing a single "≢" call instead of 3 separate ones +&- and >&<, but also many other small things (but there are still a couple golfing opportunities, including obvious redundant parentheses which i can't be bothered to manually remove)
https://tio.run/##pVRLasNADN33FF5KoAdRN7lB7xEodBNot71AFoFCe4X2Zr5IKmk@nvE4JSWOiSyN9ObpjezD2xHP74fj68vl8jSfPkkBZSKS@fTFZM9mhcMpl0JJWd0yhAWWBpX4QS215EUpMkhCjpDCnPn87R4AzvhlmdptM5OE5QF1wMBLTmacPGTEoYE/MC1pqaIV0Jpa7IyllQVtbJPT6pqJN1C9DTrMgYFmlyylEJmdP368nKkhs2TCl@Nk4lS6Zphuoi0rTEFDKEfjwNHQ6QXGBrU6GDpoDB1jtytfhRNxeGgdOeoEU6lc2zqp@eAs3oDd
(also -trans=tree is fun)
https://dzaima.github.io/paste#07VxLbtswEN3zFFq2AAlEituitwu66CJoARbICdoDZMOlVjmKT1JJtiyJ5AyHP1GSrSiOnSiSSD7OvPeGdlXteTu//Tq/vYx7O3v@2Le2y/TDz3YN3qq54Vcl76TlzNjXro4Gc3aUIDvD6fnnn2QX@P3vDlCdZG9RsLHdw0wN0JpGuaVGxRLIUAWCy6fz64@nqjlVdd3tdfVUfRufjo8f75fvpnv8fj1oOL7/5eWg/k9fFwc2/cvmc8XN3jegtmuY8SFy9c3uf/J1gKM2Q6@WzVXZKdo0q6eutsCK7SkLHpsISWrrvWNza78czzBYHaPoT1tXAkIdOxBOHuQ8Kf4FDcL9gQTszjGYz6qQ8QF6UqVdYlw2WLIDAF/do0XijML6NU@W4fe6u45Gkv4dwItK0zEjyZs20X@xFLhVWxnWiFEKIc7cagVYromk3YoSMJ0ItFsSDks4vmcYBTUKRUFolGy3EV941MgGA1yNppNTm14RxKPwB7cRNSlsv5ohOZXJy@LRp9@xnconEMdtYgB@ic1OEdi
@dzaima (missing "and merging impls for" between "ones" and "+&-" ._.)
 
 
1 hour later…
9:18 PM
@Will Hi there. Interested in APL?
 
9:30 PM
@cannadayr Pushed the first half of a document on the runtime, describing how the bytecode works. Should have the second half, about how to do the runtime and get the compiler and formatter working, done today.
 
@Marshall just saw it on github and came here to say thx
v nice. wish i had more time to actually sink into these prjs. but this is helpful will read.
 
@cannadayr By the way, I'll probably add a function to set the fill value of an array soon, so stay on your toes.
 
heh nice. ya i work slow. day job ;)
 
 
2 hours later…
11:28 PM
1
Q: Find the result of some assignment statements

Redwolf ProgramsIn this challenge, the goal is to find the values of some variables after a number of assignments are done. An example input: a = 5 b = 4 c = a = b a = 2 b = a This would result in: a = 2 b = 2 c = 4 Each statement will be one of the following: A variable name ([a-z_]+) A numeric value ([0-9]...

APL + eval within namespace = win?
 

« first day (1335 days earlier)      last day (1312 days later) »