« first day (770 days earlier)      last day (1879 days later) » 
10:00 - 18:0018:00 - 22:00

6:00 PM
ok maybe for the time being i'll leave (a ⋄ b) as it is for now and just slap on the :s
 
@dzaima :s?
 
@Adám maps - (a:1 ⋄ b:2)
 
@dzaima I thought you didn't have namespaces/dictionaries/maps.
@dzaima How will you get a value from a map? (abe:1 ⋄ bob:2)[⊂'abe']?
 
@Adám i don't have the parenthesis : notation but have been trying to add it
 
@dzaima Your current (⋄) notation is fine, methinks. But you could certainly add [a⋄b] to mean ↑(a⋄b)
 
6:05 PM
@Adám this is what I've currently got
 
ngn
@Sherlock9 you are much better than me at explanations. i would probably have described this as "get digits" :) you know what and do, right?
 
@ngn I've not had much cause to use them but dzaima said "eval each char of the string representation of the number" so I'm assuming ⍎ is eval and ⍕ is stringify :P
 
@Sherlock9 exactly
 
ngn
@Sherlock9 yep :)
 
Huzzah!
 
6:07 PM
@dzaima So changes M in-place? I didn't realise you had "⎕NS". Btw, I've settled on using monadic ⎕NS to create namespaces, as I need the left argument to (optionally) make them named.
 
ngn
@Sherlock9 i'm sure @Adám must have some mnemonic for remembering which is which...
 
Okay wait but how does 1+⍣ know that it should increment the 0 at the end? And where does the left argument appear?
 
@Adám my maps are mutable, ⎕NS⎕MAP (though idk it it'll stay that way), and it's monadic too
 
I know I'm confused when I'm not sure how to apply this new knowledge in other cases
 
my maps also don't have a concept of "namedness"
 
ngn
6:12 PM
@Sherlock9 it parses like this: 1((+⍣{...})⍣⎕)⊢0. 1 is the left arg to the second , so it gets passed at each iteration to its operand +⍣{...}, which in turn passes it at each of its own iterations to +
 
oh right, of course, M.bob and M.bob←1 2 3 also work
 
ngn
@Sherlock9 note that arrays-functions are grouped in one direction (2×3+4 is 2×(3+4)) but functions-operators in the other (f⍣g⍣h is (f⍣g)⍣h)
 
I should go incorporate that into my explanation
 
ಠ_ಠ why me
 
@ngn Okay so what does 0 have to do with any of this?
If 1+⍣ supplies our left argument, do we need a right argument?
 
ngn
6:23 PM
@Sherlock9 it's the right argument - the initial value for 's iterations
@Sherlock9 1+⍣5⊢0 means 1+1+1+1+1+0
you cannot not have a right argument
1+⍣{...}⊢0 means start with 0 and keep adding 1s until the dfn returns true
 
@ngn Ooh that's going in the explanation. One moment
 
ngn
6:55 PM
@Adám i've got 32 too
 
@ngn is evaluate in base , and is evaluate in namespace (default is ⎕THIS). is represent in base , and is represent with format (default is as-printed).
 
@Adám oh thanks, now i have some way to remember vs :D
 
My old "Hello, World!" challenge when learning a new language is the Josephus problem with three inputs, where you have n people in a circle, you cumulatively kick out the k-th remaining person, and get the q-th person to get kicked out of the circle.
I sort of have a solution in the following "rotate the circle manually" solution:
⎕←1↑2⌽{1↓(3-1)⌽⍵}⍣(12-1)⍳20
 
@Sherlock9
4
 
Where n, k, q is 20 3 12
But I have no idea how to put the arguments in the right way or golf this
 
7:09 PM
@ngn 31
 
@Sherlock9 I've got this for 29
oh got 24
notice that from both 3 and 12 you're subtracting 1
 
@Sherlock9 @dzaima What is the 2? Not 3-1?
 
ngn
@Adám 31 too: \n in regex -> literal newline :)
 
@Adám Sorry yes that's also 3-1
Missed that in the writing
 
still 24
 
7:17 PM
@ngn Uh, yours must be very different. Mine is all-APL, no regex. Reveal?
 
@dzaima Ooh what do you have for 24?
 
ngn
@Adám i thought yours might be pure apl, but i felt ⎕ucs is too expensive. sure: '.'@80⊢'[HQTW]'⎕r'\n&'∊,∘', '¨⎕a
 
@Sherlock9 this
 
⎕←↑'AHQTW'(∊⍨⊂⊢)'.',⍨2↓∊', '∘,¨⎕A
 
@Adám
A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.
 
ngn
7:19 PM
⎕←'.'@80⊢'[HQTW]'⎕r'\n&'∊,∘', '¨⎕a
 
@ngn
A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, .,
 
@dzaima Before I read that, I'd guess some kind of golf on the rotate drop ¯1+⊃⍵ part
 
ngn
@DyalogAPL erm... ⎕io
 
Ooooooh That is very pretty
 
@ngn Yeah, what about it?
 
ngn
7:25 PM
@DyalogAPL lol, it speaks :) i forgot to do ⎕io←0, but you get the idea
can we combine both solutions to make a smaller one?
 
@ngn
A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.
 
ngn
⎕←↑'AHQTW'(∊⍨⊂⊢)'.'@76∊,∘', '¨⎕a ⊣ ⎕io←0
 
@ngn
A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.
 
ngn
@Adám ^
 
@ngn Hm. I can't think of anything.
@ngn But you can, of course.
@ngn That was a true collaborative solution. If you post it, I'll explain it.
 
ngn
7:35 PM
@Adám with an ok/fail test? :)
 
@ngn Uh, no, definitely not for KCs
 
ngn
ok :)
 
@ngn Also, Unicode+SBCS, please. I can edit the "bytes".
 
ngn
@Adám i've just posted - unicode but no sbcs
do you have that boilerplate markdown at hand?
 
@ngn Yup.
 
ngn
7:42 PM
well, if you're gonna edit anyway, you can paste it in
if not, please paste it here and i'll paste it there :)
 
Ven
I really like the ; proposal. Not sure about the syntax, but I love Haskell's where
Everytime I watch John talk I'm convinced.
 
@Ven what'd be a better syntax in your opinion?
 
Ven
@dzaima no idea. But controling scopes by repeating a char seems like a slippery slope :)
 
@Ven my thinking too, which is why i proposed using parenthesis
 
@ngn Looks OK?
@Ven Did you see the fall-out of my namespace notation?
 
Ven
7:51 PM
@Adám no, sorry, I don't think so.
 
ngn
@Adám the right argument (", A, B…") - it's "A, B..."
 
@ngn 29!
 
ngn
@Adám ok, let me guess that...
 
@ngn In my proposal (which is basically on track for 18.0) you can create an inline anonymous namespace with (name:value ⋄ name2:value2). You can "dot" into this namespace and thus use that as an inline context: (sum:+/ ⋄ num←≢).(sum÷num)
 
Ven
@Adám You probably meant to reply to me :-).
 
7:57 PM
@Ven indeed
 
Ven
 
ngn
@Adám i can't guess it
 
Ven
The display is seriously messed up on Chrome.
I didn't even realize there was a ) there
 
@Ven Yes :-( and they won't fix. It's a "feature".
@ngn Yes, you can. My wrong explanation is the hint.
@Ven Two alternative solutions: Override monospace with APL385 Unicode. Use Firefox.
 
ngn
⎕←↑'AHQTW'(∊⍨⊂⊢)'.',⍨∊', '∘,¨⎕a
 
8:01 PM
@ngn
A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.
 
@ngn Exactly. Beautiful, no?
 
Ven
Funnily when copy-pasted to the chatbox, it's differently broken
 
@Ven different font, different looks
 
ngn
@Adám yeah :) so no ideas from my solution are left now
 
@Ven It is how Blink renders characters missing from the font. Gecko first looks if another font has the char, and only if not, it will resort to decomposition into a base char and a combining overlay. Blink will decompose as soon as a char is missing, and only if even the decomposed parts are missing will it fall back to a different font. Firefox ends up more readable, and Chrome ends up with a more consistent look.
 
Ven
8:06 PM
Yes, consistently wrong :-)
 
@ngn If not for you, it would have been 3 bytes longer!
@Ven Sure, but the text will look more harmonic, not e.g. with a sudden ñ in serif in the middle of a sans serif text.
 
hmm is it worth adding the "dotting" into namespaces? it'd take heavy reworking for a map to be usable as a scope (only the reverse is somewhat emulatable sadly)
 
@ngn Does your K support "lang" "expr"?
 
ngn
@Adám no, because there's only one lang there
 
@ngn Right, so today, Jay and I wrote a function that executes APL on TIO. It can easily be worked into a tool to execute any language. Get the idea?
 
Ven
8:16 PM
calling foreign languages from your language?
 
Besides for all its other benefits, TIO provides a consistent interface to every language.
@Ven That's what "lang" "expr" does in real K.
 
Ven
@Adám reminds me of my experiment which allowed to pipe Jelly into Pyth into Retina into Perl into...
 
ngn
@Adám aren't the only langs there "q" and "k"?
 
@ngn Sure, for now. but the two Kxers that participated in Dyalog '18 we fiddling with adding APL.
@ngn How do you call the shell in K? Why not "sh" "command"?
 
ngn
i can't imagine this being extended to languages of more than 1 letter, it would conflict with indexing
 
8:20 PM
@ngn How so?
 
ngn
@Adám "sh" "command" is "sh"[0+"command"]
 
@ngn Doesn't 0+"abc" give numbers?
 
ngn
@Adám i added 0+ to indicate that they are converted to numbers. indices are integers, of course
 
@ngn Ah, I get it. it distinguished between indexing into a charvec and into a charscalar.
 
ngn
and of course it's possible to override that with special syntax, but why would one do it
 
8:22 PM
K heavy overloading FTW.
 
ngn
there is already (i hope i get the markdown right) \command args to execute shell commands (not supported in ngn/k, but eventually i'll get to it)
or . "\\",x if you want to do it from within a lambda
 
Anyway, it should be easy to run a local TIO, and then all of a sudden APL gains the ability to call all other (installed) languages.
 
ngn
@Adám k overloading may be heavy, but from what i've seen it's done for good reasons and it's mostly consistent
 
Ven
wouldn't the length of such a call outweigh the benefit in most cases?
 
@Ven Length time-wise or byte-wise?
 
Ven
8:26 PM
Byte wise
 
@Ven I didn't think of it for golfing.
 
Ven
ah :-)
 
ngn
@Adám indexing into a scalar doesn't make much sense normally, so it's used for other things
123@ is write to file descriptor 123; "q"@ is (or used to be) execute q code; `p@ in k7 is parse
 
Whoo:
      'apl-dyalog'Tio'⎕←⍳10'
1 2 3 4 5 6 7 8 9 10

      'j'Tio'echo i.10'
0 1 2 3 4 5 6 7 8 9

      'k-ngn'Tio'1@!10;'
0 1 2 3 4 5 6 7 8 9
 
 
1 hour later…
9:52 PM
oh yeah, one thing. trains become so much easier to understand when you realize you're just replacing variables with functions
 
@ASCII-only Yeah, but you still have to get the parity idea.
 
like... a b c d e f g h i j k is basically the same as (α a ω) b (α c ω) d (α e ω) f (α g ω) h (α i ω) j (α k ω)
parity?
 
@ASCII-only Well, yes, notice how the way a, c, e, g, i, and k are called in a fundamentally different fashion from b, d, f, h, and j?
Though for a great many algorithms, this is exactly what's needed.
 
yes, what about it
 
@ASCII-only So whether a function is called on the argument(s) or on the results of one or two functions applied to the argument(s) depends on the parity of its position counting from the right.
 
9:57 PM
yeah
because trains are built from the right, like functions having long right scope (?)
 
@ASCII-only Yes, and yes. This isn't the only way that trains could work (indeed, they work differently in J and K), but it does come out very neat most of the time.
 
10:00 - 18:0018:00 - 22:00

« first day (770 days earlier)      last day (1879 days later) »