« first day (321 days earlier)      last day (2319 days later) » 

ngn
12:52 AM
⎕←×.*⍨⍳5 ⍝ milliseconds in a day
 
@ngn
86400000
 
ngn
A meme about 1 day being 5 "hyperfactorial" milliseconds has been going around the Internet.
I thought it would look good in APL :)
 
 
9 hours later…
10:03 AM
⎕←⎕AV
 
@RosLuP



	⌶ɫ%'⍺⍵_abcdefghijklmnopqrstuvwxyz¯.⍬0123456789⊢¥$£¢∆ABCDEFGHIJKLMNOPQRSTUVWXYZý·⍙ÁÂÃÇÈÊËÌÍÎÏÐÒÓÔÕÙÚÛÝþãìðòõ{€}⊣⌷¨ÀÄÅÆ⍨ÉÑÖØÜßàáâäåæçèéêëíîïñ[/⌿\⍀<≤=≥>≠∨∧-+÷×?∊⍴~↑↓⍳○*⌈⌊∇∘(⊂⊃∩∪⊥⊤|;,⍱⍲⍒⍋⍉⌽⊖⍟⌹!⍕⍎⍫⍪≡≢óôöø"#&´┘┐┌└┼─├┤┴┬│@ùúû^ü`∣¶:⍷¿¡⋄←→⍝)] §⎕⍞⍣
 
⍀<≤=≥>≠∨∧-+÷×?∊⍴~↑↓⍳○*⌈⌊∇∘(⊂⊃∩∪⊥⊤|
Why use (not allow) more way for goto? It is enough ->Labelxicondition
 
Ven
10:21 AM
You generally don't need ->, tbh. It's mostly a legacy feature I've been told.
you have if, for, etc in dyalog.
 
10:55 AM
@RosLuP I'm not sure I understand. You can use Label1 Label2 Label3[selector] but I generally prefer :Select var ⋄ :Case
 
11:38 AM
→LABEL×⍳~condition⋄statements`∣⋄
Label: Should be the preferred way to if(condition) statements; endif
 
@Adám how can one use outer product with functions? tio.run/##SyzI0U2pTMzJT///…
 
@Uriel with operators?
 
@Adám yeah, sorry for terminology
 
⎕←0 1∘.(819⌶)'abc'
 
@Adám
abc
ABC
 
11:48 AM
@Uriel This ^ or are you trying to write a cover operator for ∘. ?
 
@Adám I meant something else, but now I realize it was a wrong approach
@Adám but the question stays interesting anyways, can I make a Cartesian product between a set of operators and a set of data and apply the operator on the data in each pair?
 
⎕←1 2 3∘.(+,-,×)10 20 30
 
@Adám
┌────────┬─────────┬─────────┐
│11 ¯9 10│21 ¯19 20│31 ¯29 30│
├────────┼─────────┼─────────┤
│12 ¯8 20│22 ¯18 40│32 ¯28 60│
├────────┼─────────┼─────────┤
│13 ¯7 30│23 ¯17 60│33 ¯27 90│
└────────┴─────────┴─────────┘
 
@Uriel ^ ?
 
@Adám not two sets of data, just one, but that gave me the answer. Apparently using 'each' with a train of the operators is the way to go about it
 
11:57 AM
⎕←1 2 3∘.{(⍎⍺⊃'+-×')⍵}10 20 30 40
 
@Adám
 10  20  30  40
¯10 ¯20 ¯30 ¯40
  1   1   1   1
 
@Uriel ^ ?
 
12:38


→LABEL×⍳~condition⋄statements`∣⋄

Label: Should be the preferred way to if(condition) statements; endif; at last seeing the 2 first"if" I substitute with →LABEL×⍳~condition⋄statements
 
@Adám I just meant something like
⎕←(+,-,×)¨10 20 30
 
@Uriel
┌────────┬────────┬────────┐
│10 ¯10 1│20 ¯20 1│30 ¯30 1│
└────────┴────────┴────────┘
 
12:00 PM
btw @Adám, when (approximately) does the 2018 student comp open up?
 
'train' are good only for codegolf, they add nothing to readability
 
@Uriel Target is April 1st.
 
@RosLuP if you do too much code golf, they start being the natural choice also when you do non code golf stuff
 
@RosLuP I disagree. I find ' '(≠⊆⊢)'here is some text' and +⌿÷1⌈≢ are more readable than ' '{(⍺≠⍵)⊆⍵}'here is some text' and {(+⌿⍵)÷1⌈≢⍵} while very long trains (especially with several parentheses) are indeed hard to read.
 
Ven
I think one or two are fine, but then, I'm bad at APL :).
 
12:05 PM
@Ven One or two what?
 
Ven
reading +/%# is fine
wait, that's J.
 
@Ven That's J, but the equivalent APL is +⌿÷≢
 
Ven
yep :P.
 
12:25 PM
@RosLuP Imagine you wanted to do something like what Uriel just did: (+,-,×)¨10 20 30 Do you really think {(+⍵),(-⍵),×⍵}¨10 20 30 is more readable?
 
@Adám hey, I managed to make a dfn for that thing I was trying yesterday.
 
12:42 PM
Average was not this +⌿÷≢ ?
 
@Adám I was wondering how I could make the equivalent of a :While loop in a Dfn, is that possible? I remember you telling me that ¨ acted like a :For loop a few weeks ago
 
@J.Sallé Two ways: recursive using or using the operator with the condition in a custom right operand function.
 
Okay, I'll try to work that out
If my condition is, say, the function n, I'd need to do something like [doStuff]⍣n?
 
@J.Sallé Yes.
 
Okay, I'll see what I can do
 
Ven
@RosLuP it is, I just said it with a J accent for some reason.
÷≢
hm, chrome still doesn't display ≢ correctly :\.
 
@Ven No, and meanwhile I've switched to Firefox Quantum.
 
@Adám There's something wrong though, z←z 2 f 2 5 should return 2 2 5 2 2 5
 
@J.Sallé I swapped the order on the right.
 
Ven
@Adám I'm seriously considering it...
 
1:21 PM
@Adám I don't get it >.>, how do I fix? hahahah
 
@J.Sallé Your old function's z←z 2 f 2 5 is z←z (2 g 5) 2 in my version. Notice the order of 2 and 5 on the right.
 
@Adám Oooooooh, I see it now.
@Adám the thing is, with ⎕IO←0, my function gives the wrong result. z←⍬ 1 f 2 5 is 2 2 5, but z←z 2 f 2 5 should yield 2 2 5 2 2 5, not 2 2 5 2 2 2 2 2 5
 
1:51 PM
@J.Sallé OK, you can use ⎕IO←1; just add one inside the indexing bracket: [1+⍺≢⍬]
 
@Adám okay, I'll work with that
 
Ven
@Adám APL seriously needs an incrementing monad :P.
 
@Ven Why is 1∘+ bad?
 
Ven
too long :D
 
2:30 PM
@Ven APL is not a golfing language.
 
Ven
Oh, I know ;-).
 
Ven
3:26 PM
.oO( I should write a golfing language called AAAGL, "APL Ain't A Golfing Language" )
 
 
2 hours later…
5:12 PM
⎕←1 1 1 1∘.×10 20 30 40
 
@RosLuP
10 20 30 40
10 20 30 40
10 20 30 40
10 20 30 40
 
 
1 hour later…
6:32 PM
@Adám do you think this is a valid solution for this?
(the first test case anyways)
 
 
2 hours later…
8:41 PM
Can someone else test if this works? It errors out for me.
 
@cairdcoinheringaahing Click this and then try again.
 
@Adám That works! Thanks!
 
8:58 PM
@cairdcoinheringaahing (We might remove this in the next version, but as it stands) APL tries to protect you against accidentally losing your work by overwriting a function with data or vice versa.
@cairdcoinheringaahing … so you have to )erase name before re-assigning. )clear erases everything.
 
@Adám What was I overwriting?
 
@cairdcoinheringaahing You probably had a variable with one of the names mod sqf isprime.
 
9:10 PM
What is the relation between Dyalog, GNU, and ngn APL? Would they be considered dialects, different implementations, or something else?
 
@Zacharý They are all ISO APL dialects. ngn/apl is basically modelled after Dyalog APL and so is more or less a (very restricted) subset, only adding a few special operators and some JavaScript specific functionality. Dyalog APL is almost fully aligned with ISO APL, but adding lots of features (both primitives, system functions, OO, and syntax). GNU APL is pretty much an ISO APL implementation, but with some influence from Dyalog (limited dfns) and a few added features.
 
Any specific examples of incompatibilities between ISO APL and Dyalog?
 
@Zacharý f⍤1 2 3 4 in ISO APL is (f⍤1 2 3)4 in Dyalog APL.
@Zacharý I think a b c←d in Dyalog APL must be written as (a b c)←d in ISO APL, but I'm not certain (paywall…).
 
9:26 PM
... so Dyalog tends to favor results rather than functions (First example)?
And what do you mean by "paywall"? Is the ISO standard behind a paywall?!
 
@Zacharý Yes, I think all ISO standards are.
@Zacharý No, Dyalog just dosn't have a special rule which caps ⍵⍵ at three elements.
 
Oh, I got the order switched, whoops.
 
@Zacharý (1 2)(3 4)[2] gives ⊂3 4 in Dyalog APL, but I think it gives (1 2)4 in ISO APL. Again, I'm not sure.
 
If I was on my old computer (broken now :( ), I would test that on GNU APL. But the changes seem pretty reasonable (except maybe the , that doesn't make sense to me)
 
@Zacharý Dyalog has f// meaning (f/)/ while it is undefined in ISO APL, i.e. it could mean that it is f(//). Remember that ISO APL is a spec, not an implementation.
@Zacharý Everybody agrees that ((1 2)(3 4))[2] is ⊂3 4.
@Zacharý Whenever you square-bracket index, the result must have the same shape as the indexing array. Since 2 is a scalar, the result must be a scalar.
 
9:32 PM
@Adám Yeah, I think I've learned that with Fortress. Specs ≠ Implementation.
 
@Zacharý But Fortress has an implementation, no? ISO APL is only intended as a spec. There is no, nor will there ever be, an executable "ISO APL".
@Zacharý I've tested it in APL2 (which was the model for ISO, AFAIK).
 
I know, I was saying that if something is in a specification, that doesn't mean it will be in an implementation of that language. And how on earth does one obtain NARS APL?
 
@Zacharý Uh, just download it from nars2000.org
 
Windows only, right?
 
@Zacharý I think it runs fine under Wine.
 
9:41 PM
Eh, I'll pass for now. I'm going to install RIDE ride now.
 
@Zacharý Which version?
 
RIDE 4: and which .deb file should I install? The top one or the bottom one?
 
@Zacharý amd64, except if you're using a Pi, then it is armhf.
 
Okay, thanks! THanks to your sidebar and RIDE, I won't really need to have GNU's keyboard installed :)
 

« first day (321 days earlier)      last day (2319 days later) »