« first day (1497 days earlier)      last day (1150 days later) » 

12:08 AM
Does the name "triangle product" mean anything to anyone? If so, what is it? No it isn't referring to pascals triangle, has something to do with cartesian products {{(0>-/¨⍵)/⍵} , ⍳ ⍵ ⍵}
What I understand a "triangle product" to be is somehow equivalent to this kind of expression, selecting values of a cartesian product above the diagonal, but without using selection
But I'm not familiar
 
"Triangle product" is not on Mathworld, so I guess it's not an established mathematical term
 
12:27 AM
ok, I'll link the video and the timestamp where it appears
at the timestamp linked, he talks about triangle_product, but I don't really know what it is
he kind of explains what it is, but not how its implemented
subsequently, in the following refactor iteration, he discusses ordered_triangle_product, using weights, but I don't know what that means either
⋄⎕←{{(2=/⍵)/1↓⍵} {⍵[⍋⍵]} +/¨ 3*⍨ {(0>-/¨⍵)/⍵} , ⍳ ⍵ ⍵} 33
 
@nathan rogers
┌→──────────────────────────┐
│1729 4104 13832 20683 32832│
└~──────────────────────────┘
 
@nathanrogers Why don't you just ask in a comment? Include your APL code.
You could also ask him to come into the room here to discuss it. He tends to stop by now and then.
 
Oh, cool. I noticed he mentioned APL a lot during his talk
@Adám do you mean in his live stream?
 
@nathanrogers Ah, sorry, he didn't publish the video. If you comment on that video, I can email him to draw his attention to your comment.
 
Oh, cool. Will do that right now
 
12:50 AM
comment made
 
@nathanrogers Huh, I don't see it. Link?
 
how do I link to a youtube comment :.
Idk, maybe it takes a minute...
 
I thought clicking the time stamp would do it, but it just seems to reload the page :-(
 
well there aren't many comments
so if I'm not shadow banned or something it should show up... eventually?
 
OK, I'll get a little sleep and check in the morning.
 
12:59 AM
I count 8 comments including my own, and mine is certainly the only one with APL code in the body :P
Follow on question, does APL have any way to "lazify" functions?
are any of the core functions lazy already?
 
@nathanrogers Depends what you mean by that. Maybe it'll interest you to read the conversation beginning with
17 hours ago, by Elias Mårtenson
But then there is the function "defer", so perhaps I'll pick a pair of completely new symbols, because collapse and defer are opposites.
@MichaelChatiskatzi Hi there. Interested in APL?
 
The way I understand lazy evaluation is different from deferring. For example, in the example from the video, it is my impression that he could provide a higher input n, and with take(5) at the end, it would still run the same computation because it only evaluates until there are 5 results, even if there are more.
Things like iterators, cycle in haskell for instance
 
Iterators are deferred computation nodes.
 
@nathanrogers Did you read the linked blog post?
 
1:15 AM
Great! Thanks for that resource, I'll look at it now
Well I don't see any links to documentation
 
> All in all, an exciting look at what possibilities for parallelism the future will bring.
 
are these secret glyphs?
 
What do you mean?
 
from... 2015?
my question is are these glyphs supported? just not in the language bar?
 
No, you can get ¤ and "polyfills" with ⎕CY'isolate' in the form of ø and II (and also for ∥¨), but isn't supported yet.
 
1:22 AM
how do I type those?
 
They are just Latin characters with diacritics, but you could copy them after listing them with ⎕NL-3 4
 
looking in the workspace, there are a few functions
are there docs for these or just the comments provided
 
@nathanrogers There are.
 
" isn't supported yet" is enough to say "you can't achieve the thing you want (laziness) in Dyalog APL for now" I think
 
@Bubbler Depends on what exactly @nathanrogers means by "laziness". "Defer any evaluation until necessary" or "don't wait for evaluation to finish before continuing".
 
1:30 AM
@Adám My guess is the former, given the reference to iterators, Haskell, take(5), etc.
 
is it merely the glyph isn't supported, or the functionality isn't supported
 
The functionality, to defer indefinitely, isn't supported, afaik.
 
Just did some live coding in APL in front of someone and wow the stress I don't know how you do it @Adám!
 
@rak1507 Do you get stressed live-speaking English in front of someone?
 
yeah
 
1:41 AM
OK, then your stress now doing APL probably has nothing to do with APL or coding in particular.
 
Maybe
Knowing that they view it as an esolang and that this is your only chance to convince them 'real things' are possible to do definitely adds to that though
 
I myself got snagged early on thinking APL was only good for numerical applications
not that I'm some kind of wizard, but I think that its a common pitfall of newcomers to the language
 
I wrote some really shockingly bad code just now hahah
it has 9 ¨s in it
 
I experience this hang up when trying to do my own convincing
@rak1507 can I flag that for being offensive ;)
 
lol
It also has 3 layers of nested dfns
 
1:54 AM
@Bubbler @Adám I'd love your take on the solution I evaluated after this comment
Ramanujan numbers, numbers that can be expressed as a sum of cubes in 2 different ways
 
how do I round an entire matrix? the usual (⍎⍕) is not working
 
@rak1507 Maybe ⍎⍤⍕¨?
 
yeah that works was just wondering if there was an 'idiom' for it
 
The non-golf way of rounding is to multiply, (add,) floor, divide.
@rak1507 There are many ways to round. Did you search APLcart?
 
yeah I did
:57209545 did you mean to remove this?
 
2:16 AM
remove which?
 
the message after 'I'd love your take...' and before 'Ramanujan numbers...'
 
Yes I meant to remove a single comment earlier. The previous comment is a link to an earlier comment
 
oh oops
 
      {⍵[⍋⍵]}∪{(~≠⍵)/⍵}⍣2,∘.+⍨3*⍨⍳33
1729 4104 13832 20683 32832
 
@Bubbler SYNTAX ERROR: The function requires a left argument at (~≠⍵)
 
2:23 AM
It uses a 18.0 feature (monadic )
 
I see
 
It searches for numbers that appear at least 3 times in the +-table of cubes
 
∊{⊂⍺/⍨2<≢⍵}⌸,∘.+⍨3*⍨⍳33 doesn't use any 18.0 features (I think)
 
Yeah, I guess Key is better here, except for necessary enclosure
(or removing zeros, depending on how to use it)
 
0~⍨∊{⍺/⍨2<≢⍵}⌸,∘.+⍨3*⍨⍳15 also works
yeah
0~⍨∊ looks like someone holding a trident
 
2:27 AM
why do you remove 0?
 
⌸ automatically pads with 0s
 
BQN's Occurrence Count is probably the best fit: 18.
 
Key mixes the results, but what we're evaluating in the {} may have zero or one element(s), so empty arrays become a single zero
 
But translating Bubbler's original gives 19, so not much of a difference.
 
@rak1507 there can be ,
 
2:30 AM
true
 
I'm not sure what's happened to my dyalog instance, but it fails to load the session profile, and also ca'nt seem to find anything in the ucmds or ⎕SE
]runtime
* Command Execution Failed: cannot find the file "c:\src\18.0\SALT\spice\Monitor.dyalog"
and I manually added the directory of the SALT folder in the config menu, and I've also saved the session profile several times
no I guess ⎕SE is working now, but I can't use any ucmds
 
3:07 AM
@nathanrogers If ⎕SE is working, you can try ⎕CY'salt' ⋄ enableSALT
 
⎕CY'salt'
enableSALT
SALT already reacts to Editor events
]Performance.runtime
* Command Execution Failed: cannot find the file "c:\src\18.0\SALT\spice\Monitor.dyalog"
 
That's weird :/
@Adám ^
 
 
2 hours later…
5:19 AM
@nathanrogers I'd rebuild the session: )load buildse then BUILD_SESSION 'US'
 
that works, but when I reload it doesn't persist
)save
Can't save - file could not be created.
Running as admin allows me to save, but again, restarting dyalog there is no session
 
@nathanrogers What does ⎕SE⎕WG'File' give you upon restart?
 
nothing
 
@nathanrogers What does it say under Options > Configure… > Session > Session file?
 
@Bubbler nice, totally different from my solution, which was ⍸2⌊/⊢∨⍳
i've started the bounty, which will go to you unless someone comes up with a shorter solution in a few days from now
 
5:31 AM
C:\Users\nathan\Documents\Dyalog APL-64 17.1 Unicode Files\def_us.dse
 
@nathanrogers OK so after the BUILD_SESSION 'US' try Session > Save As… > that name.
Then restart APL.
@nathanrogers Did that help?
 
@nathanrogers After a restart, do you have a normal GUI (status bar, tool bar, etc.)?
 
What is ⊢2 ⎕NQ # 'GetEnvironment' 'SESSION_FILE' ?
 
5:38 AM
C:\Users\nathan\Documents\Dyalog APL-64 17.1 Unicode Files
\def_us.dse
what's wierd
is when I navigate to that folder to save, there is no such subfolder in Documents
 
Hold on, did you run the installers as administrator?
 
I don't recall, they've been installed for a good while
ok
creating the directory and saving it there worked
odd
 
Somehow the directory got deleted, I guess.
 
there seems to be some kind of nonsense going on with onedrive
no the directory still exists, but it takes me to one drive
when I go there manually
 
Ah, you may (unintentionally) have mapped things funny. Anyway, it all works well now?
 
5:42 AM
not sure exactly how that happened, but my all my user directories are not local, they're all in one drive
yes its fixed, thanks for the help
 
np, sleep well!
 
@user41805 So... it works because ax-by=1 always has a solution with 0<x<b and 0<y<a if gcd(a,b)=1, right?
 
worked for both versions
 
6:10 AM
@Bubbler that's a better/more direct proof. i thought of using the chinese remainder theorem, and (0 mod p1, 1 mod p2) so will map to a unique r mod input
 
@user41805 Yeah, that would work too. That's one creative application of number theory
 
i love these short mathy golfs. i tried messing with lcm instead of gcd, but didn't think of using outer product
 
 
2 hours later…
8:11 AM
@RGS @rak1507 Roger Hui has been looking at the performance of * vs ⍟. This has uncovered many interesting things that he will take a closer look at and probably write a blog post about. There are many things that can probably be speeded up by using vector instructions and being a bit smarter. For example:
      cmpx '0.1*b' '*b×⍟0.1'
  0.1*b   → 8.2E¯3 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
* *b×⍟0.1 → 3.4E¯3 | -60% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
8:46 AM
@MortenKromberg Oh cool that sounds interesting
 
It appears that * and ⍟ do divisions and multiplications in loops between library calls to to exp/log, and are thus unable to take advantage of vector instructions for this.
 
What about for FR 1287?
 
Vector instructions are generally not used for DECF computations, we call the Intel DECF library.
 
That explains the huge speed difference then
 
There are no AVX/SSE instructions to deal with DECFs.
... and Intel have stated quite clearly that they don't expect ever to add them.
 
8:53 AM
Shame :(
 
No market for it. If anything, the customers (gamers and AI folks) want smaller floats, not bigger.
 
Yeah, that's understandable
 
@MortenKromberg Do we know how DECFs compare to rats performance-wise for numbers with approximately the same amount of precision?
 
I don't think we do. But RATS which cut off at some pre-defined precision would be very strange beasts. Without that, ⍟ or * on RATS would be impossible.
 
I can imagine rats with denominator limit, where limiting precision is implemented as best approximation under continued fractions
which can be pretty accurate almost everywhere but unusually inaccurate near integers
I wonder if any kind of research has been done in this system
 
9:07 AM
... or we can wait for the POWER chip to take over the world ...
 
:)
 
@C.Quilley Hi. Interested in APL?
 
It has already taken over Mars guru3d.com/news-story/…
 
@Bubbler Apparently there is one, and it even says the speed is competitive enough
except that Intel won't give any attention on it
 
9:24 AM
@Bubbler It would seem ideal as one can select desired precision.
 
@Adám Oh hello! Yes; I'm more familiar with k, but I enjoyed using apl for the advent of code last year.
 
@C.Quilley Cool. Were you able to complete all of AoC in APL?
 
No - I got caught up working/the problems became harder than I could solve in time and had to abandon ship. I did the first couple of weeks, and then ran into performance troubles and switched to rust, which I know better. Outside of December there isn't much motivation to fix them up
 
@C.Quilley Did you publish them anywhere? I could add you to the list at apl.wiki/aoc
 
@Adám github.com/icendoan/aoc is my motley collection of AoC solutions
 
9:40 AM
@C.Quilley Nice. Added. Let me know if there's anything we can do further your APL skills.
 
 
1 hour later…
11:08 AM
Enjoying having bi-directional ]link.
The interpreter certainly sees changes made externally, although open )ed windows don't seem to reflect changes.
 
@xpqz Right, because you wouldn't want to lose your changes. However, if you try to close an editor that you've made changes in, while the source file also changed, I think you'll be warned about the clash.
 
Yes, that makes sense.
 
11:32 AM
How do 'real' apl programmers do testing? Is there a way to have all functions in a namespace called testX (for ints X) run by a single command? Or is testing unnecessarey becasue APLers never create bugs?
 
RGS
The latter. Testing is unnecessary because APLers never create bugs. 😆
 
I like it -- a clear metric for how far I have to go.
Testing is for wimps.
 
@xpqz Excellent question. They tend to roll their own ad-hoc testing framework. You can certainly do ns.(⍎¨'text\d+'⎕S'&'⎕NL ¯3)
 
That + Roger's assert will do just fine.
 
@xpqz New Link probably has some of the most extensive QA of any tool we ship. Have a look at it here.
 
11:36 AM
⍝_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓_↓
              ok∧←(⍎test)folder NAME      ⍝ ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ← ←
⍝¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑¯↑
lol
 
wow - that's comprehensive.
 
@xpqz Here is an example of a QA that extracts examples from the documentation and tries those.
@xpqz The test framework of dfns.dws which we also run as part of our QA during the interpreter build process. This at least ensures dfns don't break :-)
 
If Cultivations return, maybe testing strategies could be a potential topic.
Anway -- thanks -- that's more than I'll ever need.
 
@xpqz Many user command source files contain tests too. Try e.g. ]uload calendar then )ed JSUtils.Test
 
Actually, I might write something on testing for my book thing.
 
RGS
11:54 AM
@Adám will cultivations be back? when?
 
@RGS We recently hired a new member of team Dyalog. I hear that his main focus will be teaching and creation of teaching material. Maybe I can ask him to pick up the mantle. What do you think?
 
@Adám :D
 
@rak1507 No, new hires have a trial period of 3 months, and only after their staying on is confirmed do they get added there.
 
Ah makes sense
 
12:06 PM
@xpqz Sounds like a good idea.
 
@Adám oh, it's just clicked, were you meaning RGS?
 
Yes.
 
He went very silent.
 
@Adám lol, I'm a bit slow today it seems...
 
RGS
@Adám as long as he's able to live up to the standard you set
@rak1507 :-P
 
12:17 PM
For a moment there I was thinking 'ooh new person exciting!' and then I realised... not that you aren't exciting too
 
I have big plans for RGS. *rubs hands*
 
1:01 PM
@MortenKromberg Has he considered reading the internal wiki page on future performance work I left behind? I believe there's some advice about this issue there.
 
Anyone know how to use a different modifier key for APL on the mac? Using Option is hopeless if using VS Code...
 
1:19 PM
@xpqz You may need to design your own keyboard layout using Ukelele or similar) and select a different modifier key. You can start with our layout which is available on dyalog.com/apl-font-keyboard.htm. Or I suppose you could use the back-tick keyboard. But I am not aware of an option to simply use a different modifier key
 
@xpqz Whatever you figure out, adding a MacOS entry to the APL Wiki list would be much appreciated.
 
@Marshall Possibly not; Roger wasn't really looking for new things to tune, he only looked at this because it came up here and I asked him to. I shall let him know there might be something relevant there, thanks!
 
I see that the keyboard layout is just XML. I'll try modifying the existing one with Ukulele. I think as for most any external editor bar vim, the only sane modiifier key will be fn, as it's not really used on a mac.
This is the yak shave of the year: from dict benchmarking, via unit testing to creating new keyboard layouts.
Hmm, fn isn't allowed, sadly.
 
 
2 hours later…
3:11 PM
@Wezl Not quite as stylish or tiny as yours, but you may like the non-HD version of Fairfax or Fairfax Serif.
 
Is APL2 still in production at IBM?
 
@nathanrogers No: apl.wiki/APL2
 
But if you follow the link on that font list, it takes you to a form, that looks like they're reqeusting IBM credentials
oh that's recent
 
Yeah, well.
 
3:34 PM
@Adám There are several nice fonts I would love to use as my Dyalog font, but are missing some glyphs. Is there some way to specify a "fallback" font for when glyphs aren't in the main font? (like vscode allows you to provide a list of fonts, and will fallback in sequence)
 
@nathanrogers No, unfortunately not in the Windows IDE. However, you can hack RIDE to handle that. Though you may have misaligned characters and the editor may not handle that well (like insertion point at wrong location).
 
4:10 PM
@Adám here's what my "unit test framework" ended up looking like: gist.github.com/xpqz/f7990c11cdb1a7ee4856bbeb2a0f0dfc
 
ngn
4:23 PM
@xpqz and here's my unit test framework :) ngn.bitbucket.io/apl/unit-test-framework.dyalog
 
lmao
 
@ngn I aspire to reach your golf handicap.
 
@ngn Cute, but not true. When it comes to code golf answers, you tend to have pretty elaborate test frameworks where I use none!
 
ngn
@Adám elaborate? rarely more than 1 line like t←{⍺≡r←f⍵:'ok'⋄'fail'r⍺⍵} - for golfing i want some output on success, and i want to see the actual result next to the expected result on failure
 
generally for code golf I'll just use tio to test a bunch of inputs at once
 
ngn
4:37 PM
@xpqz no offence, but you know what born-again tradfn-ers are called? retrad-ed :)
 
lol
 
ngn
4:57 PM
well done @Bubbler. it's so simple and obvious in hindsight, i feel stupid.
 
yeah, really nice solution
 
@ngn Meanwhile I am sitting here with my 26 byte solution
 
lol
 
5:12 PM
@Adám Depending on how you interpret that question, the answer may be "we don't know". IBM is not selling APL2 any more, but whether they are still using it internally for production is a different question.
 
@MortenKromberg Oh, heh.
 
Last time I looked, IBM was selling products that embedded APL+Win (one financial planning package), Dyalog APL and J (in another).
 
Announcement: Dyalog APL Seeds ― A free online event aimed at new and prospective users of APL
3
Anyone who wishes to have this ^ ad shown on CGCC, can upvote it here.
 
@rak1507 Roger posted his writeup of the * vs ⍟ saga to the Dyalog Forums: forums.dyalog.com/viewtopic.php?f=30&t=1741.
 
@Adám the session is loading fine, but now this is happening
]link.create # 'c:\d\aoc2015'
* Invalid user command; to see a list of all user commands type
 
5:22 PM
@nathanrogers Something is very wrong. Maybe uninstall and reinstall?
 
fair enough
I was thinking the same
 
Maybe make sure you remove all traces from your Documents folder too.
 
@ngn Do you take bookings for parties? :)
 
ngn
i'm sure this is a trap. ok, i must tread carefully.
@xpqz what do you mean?
 
@MortenKromberg I tried to contact the APL2 team on internal channels a while back but got zero response.
@ngn your comedy game is strong today.
 
5:32 PM
@Adám nice! yes, looks good, I will actually try that
it actually seems to have the same dimensions as poultreM, though with some "fake diagonals"
 
ngn
@xpqz hah. i thought you were going to return fire with a pun on dfn-ers :) yes, i take comedy very seriously
 
“Retrad“ - actually funny.
 
@ngn best I can come up with is intellexically challenged
 
6:06 PM
@MortenKromberg thanks for the link, interesting stuff
 
@Razetime you're famous.
 
Not mentioned in the post, the maximum relative difference of 8.72981E¯14 between 0.1*b and *b×⍟0.1 is hundreds of ULP, when usually about 1 ULP error is assumed for exponentiation.
 
6:25 PM
@Marshall That doesn't sound very nice, no.
 
6:41 PM
@Adám is there a way to get the name of an operand?
if all I have is ⍺⍺ or ⍵⍵ can I get the name it is bound to, if any?
 
@nathanrogers This?
      a←{⍵}
      a{f←⍺⍺ ⋄ ⊢(⎕NS⍬).⎕FX⎕NR'f'}⍬
f
 
6:57 PM
no I think he wants 'a' there
 
yes I want a
I want the name of the operand being passed in
 
7:12 PM
@Adám it might be jank, but it might just be easier to pass in a string left arg, and eval the string instead of passing the operand
but that's basically what I'm looking for, I need the string of the name of the function operand
 
that will definitely be easier than any other solution imo
although there could be a clever way that I don't know about
 
@nathanrogers In principle, functions shouldn't know their name (tradfns are odd), but there is a hack…
 
I know in principle, but its for a purpose
 
@nathanrogers Has limitations (but there is a hack to overcome that too…):
      a←{⍵ ⍵}
      b←{⌽,\⌽⍵}
      ∇(y y y)←Trad3 y
       ∇
      avg←+⌿÷≢
      AA←{f←⍺⍺⌶ ⋄ ⊢(⎕NS⍬).⎕FX⊃⎕NR'f'}
      a AA⍬
a
      b AA⍬
b
      Trad3 AA⍬
Trad3
      avg AA⍬
1
 
so it won't work with named trains
 
7:27 PM
@nathanrogers This one does:
 AA←{
     3.3=⎕NC⊂'⍺⍺':⍺⍺{
         nrs←⎕NR¨⎕NL ¯3.3
         nl←⎕NL ¯3.3
         f←⍺⍺
         nr←⎕NR'f'
         nl⊃⍨nrs⍳⊂nr
     }⍵
     f←⍺⍺⌶
     ⊢(⎕NS ⍬).⎕FX⊃⎕NR'f'
 }
This one consistently returns 1 if the operand is unnamed:
 AA←{
     3.3=⎕NC⊂'⍺⍺':⍺⍺{
         nrs←⎕NR¨⎕NL ¯3.3
         nl←⎕NL ¯3.3
         f←⍺⍺
         nr←⎕NR'f'
         (nrs⍳⊂nr)⊃nl,1
     }⍵
     f←⍺⍺⌶
     ⊢(⎕NS ⍬).⎕FX⊃⎕NR'f'
 }
@nathanrogers Does ^ work for you?
 
do I have to define that each time?
 
@nathanrogers Not sure what you mean. You could define a utility operator once. Would you like me to modify it so it takes the target namespace as argument?
 
I mean can I call AA from another function that takes an operand?
and I think taking a target namespace would be good. just ⍵.⎕NL?
 
Another operator? Yes, that should work.
 
yes it appears to be working
 
7:37 PM
@nathanrogers That idea, everywhere:
 AA←{
     3.3=⍵.⎕NC⊂'⍺⍺':⍺⍺{
         nrs←⍵.⎕NR¨⍵.⎕NL ¯3.3
         nl←⍵.⎕NL ¯3.3
         f←⍺⍺
         nr←⍵.⎕NR'f'
         (nrs⍳⊂nr)⊃nl,1
     }⍵
     f←⍺⍺⌶
     ⊢(⎕NS ⍬).⎕FX⊃⍵.⎕NR'f'
 }
 
with a AA #
?
 
Yes.
Should handle ⎕THIS as well if you want to use it on AA's home ns.
 
beautiful
 
I'd say "ugly", but taste is subjective ;-)
 
um, I broke it
 
7:39 PM
?
Oh, no I see a bug. Should be:
 AA←{
     3.3=⍵.⎕NC⊂'⍺⍺':⍺⍺{
         nrs←⍵.⎕NR¨⍵.⎕NL ¯3.3
         nl←⍵.⎕NL ¯3.3
         f←⍺⍺
         nr←⎕NR'f'
         (nrs⍳⊂nr)⊃nl,1
     }⍵
     f←⍺⍺⌶
     ⊢(⎕NS ⍬).⎕FX⊃⎕NR'f'
 }
One Two ⍵. too many…
 
I'll have to come back to it
gotta run afk for a bit
thanks for the help!
 
Sure thing. Let me know if you hit any issues with it.
 
at the moment I'm getting 0 but I might be calling it wrong
I'll check later
 
Darn, it is ⎕IO sensitive. Will fix.
OK, this should make it ⎕IO insensitive and always return 0 upon failure:
 AA←{
     3.3=⍵.⎕NC⊂'⍺⍺':⍺⍺{
         nrs←⍵.⎕NR¨⍵.⎕NL ¯3.3
         nl←⍵.⎕NL ¯3.3
         f←⍺⍺
         nr←⍵.⎕NR'f'
         (nrs⍳⊂nr)⊃nl,0
     }⍵
     f←⍺⍺⌶
     0@(1∘=)(⎕NS ⍬).⎕FX⊃⍵.⎕NR'f'
 }
 
hmmm. wierd it was working for a bit now its not
maybe I need to relink
nah, its always returning 0 now
 
7:50 PM
(Note to self: Test code before posting.)
It does seem to work for me.
 
 
1 hour later…
8:55 PM
how do I know what NS I'm in?
 
⎕THIS
btw, I think passing the name and using eval would be much simpler than code above
 
that is true, and it also allows the thing I'm working on to be data driven
I thought # refers to "current NS"
 
# is the root namespace
@nathanrogers what is the current thing you're working on?
 
I'm about to share it
 
alright cool
 
9:05 PM
bit.ly/3q7uaRX @xpqz here is a short testing framework I wrote around the first 2 problems of Advent of Code 2015. If I were structuring an application, I would put this test function in test.aplf in the root of your project, so that when you ]link # '/path/to/project it is in the root namespace. Left argument is the namespace, with the right argument being the name of a function in the namespace you've passed in.
 
ooh cool
 
Define your function, and a vector of tuples (input expected) named <function_name>_tests
it will look for that variable name in the same namespace as the function
looks like I'm not actually using linefeed anymore
let me clean it up and I'll relink it
bit.ly/3e23BeL @rak1507 @xpqz here it is with a bit of tidying up
oh, and I made a mistake too, second
Ok, now it actually looks for the function in the namespace you pass
 
btw, you can just send the tio link, it doesn't matter that it's long no need for a link shortener
 
its super long
I mean, won't even let me paste long
@xpqz ibb.co/PWhXYmW here you can see, aoc2015 is an .apln so it is defined as a namespace, but you could do the same with a folder with files. you can also see test.aplf is in the root.
and here is how I call the test function
you can imagine something like #.myNamespace∘test¨'fn1' 'fn2' 'fn3' and now you have a data driven test reporting tool
 
@nathanrogers if you make the message multiline, SE will accept at least dozens of kilobytes of message. For a link-only message, you can just append a newline with shift+enter, otherwise you need to prepend one (which will disable markdown as with multiline messages usually)
 
9:20 PM
can you make a link multiline?
it was a link of substantial length, and I didn't want to post a wall of text for a single link
 
@nathanrogers yeah, why not
 
@nathanrogers it wouldn't fill up the entire thing
 
a leading newline will make the message a proper multiline message, and SE won't load it all unless requested by pressing the "(see full text)" link. But for some reason SE also allows a trailing newline for a link-only message, which loads it all immediately for some reason, leading to a nicer user experience, but also potentially loading a lot of data. </SE-chat-weirdness>
 
okeedoke
I hope that answers some questions about testing in APL. It's pretty trivial to whip one up super quick
Of course if you don't need reporting, like which arguments caused which cases to fail, then a simple really can do the trick. or ≡¨ if you want to know how many passed or failed.
 
9:46 PM
↑{⍵∘test¨⍵.⎕NL ¯3}#.aoc2015 or you can go full meme, test all the functions in the namespace, assuming there is an associate fname_tests
 
10:10 PM
https://tio.run/##jZRLbxMxEMfv@RRzW1tJybO0isShog8ilRSxvSOzcdqVNrtR7JRWVTiAFJGqW1FQBRck4BQhJA6oQuoxfBN/kTBjZ5NwKCWP1dge/2b898yKbrTSOhFRcjCdmourxp4Zvi3ltFQajdMc4Mekn/B/DThhhu8gFh0JSRva/TjQYRJDGOPyzZLrzbKr6opAQpDEWoRxGB8Qau67ud3063U7bIsweuzv0FY49Rpxt6/rHnhbx10ZaNkieyfBqYJJvxFjAJBRwrid9DqgDyX0lezBi0OhLU@2LLorlFqgn2z4/tZmHRC4vdHYtSZBmUmv8kUkc2e9JHNgAwRJP9Z0ZiKBiFuWnrNwHdBh0@uC94xUUx78x4eglC7tWAmEknAkeqF4Hkkn75KkpQdo3cOraT7EWHV7E15zD/a3/H3fw6nbI8jjUEPYBgqgoB@3ZDuMURPLZSFJrNDJCcztnb036cgMLzGkSS9uYzu66kaI1wkc4f6kp7JsR18deZbq040maV26S40AQkym09UnEIVKuySPRNTH1O3NMZcU3cpkPEv@38wgiSLMDXpS9SOt5rUgW46YHR3
"final" for now, cleaned up version with a bit of error handling
um... I tried to paste the full link it takes me to an APL TIO with no code in it? @dzaima
https://tio.run/##jZRLbxMxEMfv@RRzW1tJybO0isShog8ilRSxvSOzcdqVNrtR7JRWVTiAFJGqW1FQBRck4BQhJA6oQuoxfBN/kTBjZ5NwKCWP1dge/2b898yKbrTSOhFRcjCdmourxp4Zvi3ltFQajdMc4Mekn/B/DThhhu8gFh0JSRva/TjQYRJDGOPyzZLrzbKr6opAQpDEWoRxGB8Qau67ud3063U7bIsweuzv0FY49Rpxt6/rHnhbx10ZaNkieyfBqYJJvxFjAJBRwrid9DqgDyX0lezBi0OhLU@2LLorlFqgn2z4/tZmHRC4vdHYtSZBmUmv8kUkc2e9JHNgAwRJP9Z0ZiKBiFuWnrNwHdBh0@uC94xUUx78x4eglC7tWAmEknAkeqF4Hkkn75KkpQdo3cOraT7EWHV7E15zD/a3/H3fw6nbI8jjUEPYBgqgoB@3ZDuMURPLZSFJrNDJCcztnb036cgMLzGkSS9uYzu66kaI1wkc4f6kp7JsR18deZbq040maV26S40AQkym09UnEIVKuySPRNTH1O3NMZcU3cpkPEv@38wgiSLMDXpS9SOt5rUgW46YHR3
@dzaima yeah using shift enter breaks the link
 
@nathanrogers you need to click the '(see full text)'
 
oh, wierd
 
otherwise you open a truncated link. Annoying that SE doesn't disable clicking the link if it's truncated, but what can you do
 
10:48 PM
I'm getting a funky error. I'm querying ⎕NL and trying to convert it to something that ⎕NC can read
`⊆⍕⎕NL 9.1`
┌───────┐
│aoc2015│
└───────┘
this seems like it should be a nested string, which is what I'm sending to ⎕NC, hoping to get 9.1 as the result
nvm
 
@nathanrogers you might want ⎕NL ¯9.1 which returns a vector of vectors
 
Yes, that's what I discovered. I only had the 1 NS, adding a second revealed my error
 
11:42 PM
what is the canonical way to set ⎕IO using ]link for #? @Adám
 

« first day (1497 days earlier)      last day (1150 days later) »