« first day (1609 days earlier)      last day (1035 days later) » 
00:00 - 21:0021:00 - 22:00

12:00 AM
Afaik, only APL and J have IDEs where you can go back up and edit previous input (and output) for (re-)execution.
 
Yeah, to my eyes it seemed to magical i didn't realise it until i saw it being used in a APL video... Makes me wonder if there are other tricks in the editor that I'm unfamiliar with
 
Amazing, though, that such an interface has been a mainstay of APL implementations since CRTs took over from type writer terminals.
@0xACE Did you read the tips?
 
Yeah i was reading the manual in regards to CLI usage, I wasn't expecting dyalog via cli to support the extra features (im amazed of how cool ")ed myfunc" is) but I couldn't figure out how to invoke the BK (ctrl-shift-backspace) and other shortcuts...
nah, ill check it out now
 
@0xACE This might help.
 
Aawww :'( that's so beautiful how come i couldn't find it by navigating dyalog.com
 
12:10 AM
@0xACE I can find it by searching help for "linux terminal".
 
@Adám (i've yet to figure out what the APL key there means)
 
dzaima that's the exact problem i had, but atleast the new link resolved Cmd and CMD for me...
 
 
@Adám well, afaik, I have no way of allowing a terminal to see the windows key (and i definitely don't want to!)
 
I sortof modified this gist.github.com/Russtopia/20ae5ab571d5bed73359ca956d9010a7 but for w/e reason when i swap over to it CPU spikes too 100% for a couple of seconds...
 
12:14 AM
@dzaima (but ctrl+x b works)
 
dzaima, you can but it'd require that you modify your terminal and termcap for your terminal, also that applications accept it. afaik it's troublesome...
i was considering making a python script to interpret `<Keystroke> as a glyph
 
@0xACE for just entering apl chars? you can use XCompose for e.g. `a
 
yes. for entering apl chars
not familiar with xcompose, let me have a look
 
this in ~/.XCompose works (note that you need to restart a given program for it to recognize the updated .XCompose file)
 
@dzaima do you have a full list of this for apl?
 
12:20 AM
@0xACE no
you can probably extract a list of mappings from the browser bar, the xkb apl layout, or wherever else there's an APL keyboard. gtg though
 
alright, thanks :)
 
 
4 hours later…
4:06 AM
@0xACE you might want to try the Genera Lisp Machine :) or McCLIM's repl (which is a cut down version of that)
 
4:40 AM
As an idea for the APL twitter bot, it may make sense to only display an image of the output, and link to tryapl with the actual text since Twitter doesn't have code formatting
 
5:15 AM
Ooh, expression + TryAPL link + picture!
 
@Adám Not adding (+=)(⊸)(÷⟜≠)(⌾‿⌾), ` (≡÷≠)⊢⟨⌾,⌾⟩` & (≡÷≠)⟨˙⋄˙⟩?
Darn, I missed them. I see!
But I do still like the cuteness factor on this worm best for the main entry: (+=)(⊸)(÷⟜≠)(⌾‿⌾)
 
5:41 AM
@AviFS pull request to bqn crate
 
@Adám FYI. I have a computer under a centralized management. So basically I can't do nothing. The main problem with Dyalog is that registry is out of question. I can start Dyalog with DYALOG_NETCORE=1 which allows me to use binary version of .NetCore 3.1. I was able to do this with Jupyter-Lab Notebooks too. I just added it to line 233 in kernel.py like this
self.dyalog_subprocess = subprocess.Popen([dyalogPath, "RIDE_SPAWNED=1", "DYALOG_NETCORE=1" , 'RIDE_INIT=SERVE::' + str(
self._port).strip(), 'LOG_FILE=nul', os.path.dirname(os.path.abspath(__file__)) + '/init.dws'])
 
@kimmolinna You can use a config file instead of the registry.
 
@Adám That's true but I made a mistake and asked them to install Dyalog for all users so I can't edit the config file.
 
@kimmolinna But you can just add your own config file which overrride that.
 
@Adám What is the easiest way to save all present settings to configuration file and use it? That's not so well documented...
 
5:53 AM
@kimmolinna Because there's no automated way to do so. Lots of questions there: Should it also write defaults? What about settings that have been set to the default to override another non-default settings, etc.
 
Not necessarily. The easiest way would be something like

{
Extend: "my_default_configuration.dcfg",

Settings: {
DYALOG_NETCORE: 1
}
}
 
@Razetime Wdym? I meant for Adám to add to his submission.
 
@Adám And how can I start dyalog with my own config file?
 
6:17 AM
@AviFS oh, to the submission.
 
Yupadee :)
 
RGS
@Adám "expression" means result or original one?
 
@Adám I found it from documentation. I can use ConfigFile="dyalog.dcfg"
 
6:36 AM
@RGS Result.
 
RGS
And generating the image with the result is also easy
I only need to figure out how to size the image appropriately.
 
 
1 hour later…
7:50 AM
@RGS what'd you use for generating the image?
 
RGS
I'm using PIL
And that is already working fine.
 
@RGS link's broken
 
RGS
I'm just having a final hurdle with figuring out a priori what is the length of the status I'm updating
@Razetime yeah I keep deleting the bot's answers and reuploading
The "stable" link is to the original tweet: twitter.com/rojergs/status/1407114811624808450
 
How do we use the bot again? It's not in aplwiki.com/wiki/APL_Orchard; we should add it!
Hey @RGS, great to be back and great to see you again!
 
RGS
@AviFS Which one? If you are talking about the Twitter one, let me just have everything running smoothly first :P
Great to see you ○/
Btw, does anyone have suggestions for free/inexpensive hosting for the bot? (The bot was written in Python)
(I can't host it on replit because I don't have the paid plan that allows you to have your code always on)
 
7:54 AM
(P.S. I'm listening to Portuguese music; I just fell into it in the past week. I've been listening to Roberto Carlos non-stop!)
 
@RGS We'll host it!
 
@RGS Wait no, sorry for the confusion. I meant the one that used to be here.
But then wasn't due to the pandemic, but now is again?
For executing APL
 
RGS
@AviFS yeah, the bot is still sick :P Hasn't been around for a long time.
 
@AviFS (Let me know if you have any recommendations!)
@RGS Ouch! Really? :((
 
RGS
@AviFS Depends on the type of music you enjoy listening to.
 
7:56 AM
Soft rock/pop/ballads these days
I can ask my question without the bot, though. (Dyalog 18.0)
    3=/1 0 0 0 1 1
1 0 1 0
Can someone explain it please? I would've expected 0 1 0 0
 
RGS
@AviFS that's exactly what it returned :P
 
Hahaha, that's pretty funny. You're right, let me edit that
 
It's (1=0=0)(0=0=0)(0=0=1)(0=1=1), evaluated RTL inside each paren
 
RGS
3=/1 0 0 0 1 1 is
(1=0=0) (0=0=0) (0=0=1) (0=1=1)
 
Oh my goodness...
I know
But I was expecting...
=/
Yeah that's what I meant
But that doesn't work
 
RGS
8:00 AM
except that doesn't work out of the box
 
But that's exactly what I was expecting
 
=/ on a boolean vector is the same as 2|+/
 
@Bubbler Thanks Bubbler, very obvious in retrospect. I was hoping for (=/1 0 0)(=/0 0 0)(=/0 0 1)(=/0 1 1)
 
@AviFS that is what it is
=/ does not check if all of them are the same
 
^
There's no all-equal built-in in APL
 
8:01 AM
that would be ∧/2=/ or something
 
Oh yeah...
 
RGS
3 (1≥≢∘∪)/ 1 0 0 0 1 1
 
Wait, that'd be ∧.=
Wait no
 
⊃∧.=⊢
 
RGS
@rak1507 ⍒≡⍋
 
8:02 AM
i like how RGS feels the need to be nice to the bot when debugging the output
 
What's happening?!
 
@RGS actually no that doesn't work either
bc 3 f/ x is f/¨ 3,/ x not f¨ 3,/x
 
I don't understand how to use either of these, nor how they would work: ⊃∧.=⊢ & ⍒≡⍋
 
RGS
@rak1507 right -.- it gave incorrect output to my face, but I saw some output and thought it was correct :P
 
@RGS This isn't working either, it's returning 1 1 1 1
 
8:03 AM
(⊃∧.=⊢)¨3,/1 0 0 0 1 1
 
RGS
@AviFS yeah today my brain isn't working
 
@AviFS if the ascending order matches descending order, then all elems are equal
 
@RGS Not at all, just way more serious answers than I was expecting, haha
Trying to stay above water :p
 
(⊃∧.=⊢)¨3,/1 0 0 0 1 1
0 1 0 0
 
@rak1507 actually no it isn't, oops
@Razetime which is the expected result
 
8:05 AM
Easier one if you allow some processing after 3 f/: 0 3∊⍨3+/1 0 0 0 1 1
 
@Razetime Ah that yes, but I'm not trying to check if ALL elems are equal. I want to do it in chunks
Like 3+/ would add in 3-piece chunks
 
@Bubbler yeah this is nicer for bools only
 
One byte shorter: 0=3|3+/1 0 0 0 1 1
      3(⌊/=⌈/)1 0 0 0 1 1
0 1 0 0
 
@AviFS For a more general sliding window, look at
Un-ninja'd.
 
      1 1⍷2=/1 0 0 0 1 1
0 1 0 0 0
 
8:08 AM
Stencil is a good idea
Thanks
 
:58407805 You go ahead. I have things to do…
 
@Bubbler Neat!
 
      2∧/2=/1 0 0 0 1 1
0 1 0 0
 
I'm trying to trainify this, to see if that's shorter, since I just want to do this on a boolean array
 
@Bubbler That's very clever.
 
8:09 AM
      {⊂(⍋≡⍒)⍵}⌺3⊢1 0 0 0 1 1
0 0 1 0 0 0
 
Something like ⍱/3 0∊+/1 0 0 0 1 1
 
pretty prime example for window
 
Ouch. Not great for golf though
 
windows needs enclosing however
 
@Razetime {1=≢∪⍵}⌺3
@Razetime No need to enclose simple scalars.
 
8:09 AM
Can you trainify 3 or 0 in 3+/1 0 0 0 1 1?
 
@AviFS 2∧/2=/⊢
 
@AviFS Like this
 
(0 3∊⍨3+/⊢)x or 3(+/∊0,⊣)x
 
      (⍋≡⍒)⍤⊢⌺3⊢1 0 0 0 1 1
0 0 1 0 0 0
 
@Adám Thanks!
It didn't occur to me this would all be so ungolfy
Does anyone have any better ideas for doing this with a boolean list?
 
8:12 AM
0=3|3+/⊢ for Adám's first one
 
Nice.
@Razetime 1=≢⍤∪⍤⊢⌺3 or {1=≢∪⍵}⌺3 have same length with better performance.
 
@AviFS I think ⌊/=⌈/ is indeed shortest as a dyadic function if you pass the window size as its left arg
 
I was also working on something to do with:
(3^/1 0 0 0 1 1) ∨ (3∧/~1 0 0 0 1 1)
But haven't golfed that very well yet
 
I think you mean ∨ in the middle
 
Thanks, good point
 
8:15 AM
@Bubbler Should be ∧/=∨/ for Booleans, no?
 
For better reading, yes
 
Even ⌈/=⌊/ works only for real numbers.
{1=≢∪⍵}⌺3 is the proper solution for all types and ranks.
 
Thanks, I'm surprised that's the best one can do
@AviFS You don't think something like this could be golfed shorter?
 
@AviFS (∧/∨∧/∘~)
Isn't that the same as (∧/>∨/) or something?
 
@Adám interesting
 
8:18 AM
I suppose not then! Well thank everyone, that's all really interesting
 
(I forgot that windows had a left arg)
 
Is anyone else surprised that it isn't easier to do, given how easy it is to n-wise reduce with other dyads?
 
@AviFS That's why J has n f\y for applying f on windows of size n without forcing a reduction.
 
Is there a use for =/ the way it usually is?
 
Usually only with a left arg of 2.
 
8:20 AM
I wonder if golf-APLs could stand to benefit from implementing =/ like this, as an exception to the rule
 
That's why K has an operator for our ¯2 f/
 
@Adám The left arg of 2 would still work the same if you did
 
@AviFS So =/ and {⍺=⍵}/ wouldn't give the same result? Please don't.
 
A reduction function for window size larger than 2 is impossible to design in general
 
@Bubbler What?
 
8:21 AM
@Adám K's ` and /` are quite insane in capability
 
@Adám Mathematical purity is of course lost, but that's why I said for golf-APLs
 
@Razetime Try doubling your backticks!
 
ah eyah meh
 
Not too late, mate.
 
@Adám I mean, the function f in n f/ x when you want to do some arbitrary thing n-wise
 
8:23 AM
@Bubbler You mean to counteract the reduction? Sure.
Technically, it isn't too late to add J's f\
 
I don't like the idea of adding additional builtins to APL, which is most of the reason why I haven't made a golfed APL yet
 
It's not additional, it's instead
Assuming you mean the =/ thing
 
The thing is that pretty much every one of the original APL operators has issues.
 
@AviFS No, it won't be a thing ever
 
Are we talking about the =/ or something else?
Ouch. This is some strong opposition
 
8:26 AM
@AviFS I'm talking about a shorter APL in general
 
Actual golfing languages tend to have an AllEqual built-in anyway.
 
You mean a golfier APL?
 
..yes
 
@Adám Is extended intended for golfing?
Or is it just a convenient use?
 
Why not both?
 
8:29 AM
extended is kinda like a beta for what could possibly be in the next dyalog version
which also happens to be very golfy
 
@Adám Just wondering if you had an 'intended audience?'
And to what extent it favors/balances mathematical elegance with practicality
Since that just came up
 
well it definitely doesn't do anything crazy like redefining specific reduces or anything like that
 
It was intended to showcase how Dyalog APL can be extended.
 
I see, so the philosophy is the same then?
Just a little more experimental and cutting-edge?
 
The only breaking changes are there by mistake. (Oh, and then gave a conflicting meaning to a previously unused primitive.)
@AviFS Same as?
 
8:33 AM
As current Dyalog APL
 
Yes.
@AviFS Very much experimental, as it is based on crazy hacking.
 
Illuminating, thanks. I'd figured it was more of a recreational & golfy thing than a demoing-the-Dyalog-of-the-future
 
@AviFS APL′ is intended to show what Dyalog APL could be if problematic primitives were fixed.
 
I like the pun here:
> The goal is to make APL more appealing to the modern audience. That is, to bring APL into its prime.
Interesting, I see. So that one includes breaking changes, but extended doesn't. Correct?
 
@AviFS Atop, Over, and Constant were adopted by vanilla Dyalog, straight from Extended.
 
8:36 AM
And even APL' is breaking only in the service of the math and principles , correct?
 
@AviFS Yup, almost every change in APL′ is breaking.
 
@RGS i say completely remove text output
 
@AviFS Also utility (though you could call that "principles"). First axis functions are much more versatile than last-axis functions, and hybrids are just awkward.
@RGS What's with the trailing dots?
 
RGS
@Adám currently I'm trying to keep lines short enough so they don't wrap (hence the ∙) but I also have the hard limit on total character count, so I add the "..." when I hit that.
 
8:40 AM
text output just loooks bad on twitter
 
I agree that you should remove text output altogether if multi-line.
 
@Adám Yeah, I'm calling them principles for lack of a better word. It's not to contrast it against practicality, but to say that the utility gained is from 'better math,' rather than hackish oddities a la C++.
 
RGS
@Razetime even if it is single-line? I figure single-line output might be nice for expressions that evaluate to simple scalars/vectors
 
twitter has a 280 char limit, i think it's best to save all of it for a tryAPL url, and the image wto show output
 
@Razetime I think all links count as a fixed amount.
 
RGS
8:43 AM
@Razetime the image doesn't take char space and the URL always takes 23, so I have 257 chars to play around with.
 
URL always 23? that helps a lot then
 
RGS
I can use a couple to say something : "Here's a link to your expression: <tryapl link>"
then if it's single line result, add it; if it's multiline, either say something about the image or say absolutely nothing.
 
maybe anything that
a) doesn't require boxing
b) is not multiline
 
RGS
if it requires boxing, it is multiline.
 
well, 3 3⍴3 would be multiline and non boxed, no?
 
RGS
8:45 AM
yes
I just mean to say that the "requires boxing" restriction adds nothing.
I just need to check the number of lines.
 
ah ok
I'm considering submitting an APL notebook to a Kaggle challenge
RGS have you tried any contests on Kaggle
 
that reminds me about the bioinformatics contest what were your solutions @Razetime and @RGS
 
@RGS Why not give it as an expression if multiline? (A: because you can't get an expression from TryAPL.)
But hey, I can maybe add that.
 
RGS
@Adám maybe ⎕SE.Dyalog.Utils.repObj could be whitelisted
 
Yeah, or simply add ]repr
 
9:08 AM
Yesss, I finally managed to consistently repro an obscure bug that has been bothering me for years.
 
are you allowed to say what it is
 
Sure. Only happens in Windows IDE. Search for some text, click inside the resulting selection, then hold shift and use a movement key to select. Rather than what should be selected, everything before the caret is selected.
 
@rak1507 i did the bioinformatics contest in ruby although every competitive programmer i knew told me it was bad
 
oh
ruby is bad, they are right, slow and memory intensive
closest←{i⊃⍤0 1⍨⊃⍤⍋⍤1|⍵-⍤0 1⊢⍺[i←1⌈(≢⍺)⌊0 1∘.+⍨⍺⍸⍵]}
r←''⋄{}{m a s←{⍎'¯'@('-'∘=)⊢⍵}¨1↓4↑⍵⋄r,←⍕¨⊃,/(⊂sm←m[g←⍋m]){{⍵,¨⍨g[⍵⊃⍤0 1⊢c]}⊃⍤⍋⍤1|⍉⍵-⍤1⍉(⌈/⍬)@(0>⊢)a+⍤1⊢⍺[c←⍺ closest ⍵∘.-a]}¨{⍵⊂⍨(≢⍵)⍴200↑1}s⋄4↓⍵}⍣{0≡≢⍺}1↓data
 
it is not like I bothered anyway
 
9:19 AM
p2
 
I got throught to sorta trying p3 in K and then err decided against it
 
yeah I did a simple solution in apl but it was wayy too slow and couldn't be bothered figuring out how to do it properly
 
RGS
 Solver←{
     (m a t)←⍎¨¨' '∘(≠⊆⊢)¨⍵
     val←(pos←val>0)⌿val←,m∘.+a
     ord←⍋val                      ⍝ How to order possible values in ascending order.
     idx←(¯1+≢val)⌊0 1∘.+val[ord]⍸⍤1 0⊢t
     best←(⍉idx){⍺⊃⍨⊃⍋⍵}⍤1⊢|⍉val[ord][idx]-⍤1⊢t
     ⍕¨1+(≢m)(≢a)∘⊤¨(⍸pos)[ord][best]
 }
My P2
Didn't solve test case 4, only 1-3 and 5
 
ah
looks fairly similar to mine also using interval index
 
RGS
That's the core, at least; I had a :While loop to read the test cases and feed them to the Solver
 
9:22 AM
ew, control flow
{⍺⊃⍨⊃⍋⍵}⍤1 will be slow bc ⊃⍋ will be n log n, ⊃⍤⍋ will use the idiom and be much faster for large arrays, not that I suppose it particularly matters here
m∘.+a will be the killer
 
RGS
@rak1507 what idiom?
 
      a ← ?⍨ 100000
      ]runtime -c '⊃⍤⍋a' '⊃⍋a'

  ⊃⍤⍋a → 1.2E¯5 |     0% ⎕
  ⊃⍋a  → 4.2E¯4 | +3329% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
RGS
Lol then why isn't ⊃⍤⍋ coloured as an idiom?
 
no idea, don't think I have that turned on anyway
 
⊃⍤⍋ is also not on APLcart
 
RGS
9:49 AM
Do you think this is a good Tweet example to have pinned at the top of the bot? twitter.com/dyalogaplbot/status/1407272520919797762
I'm fairly happy with what I have now, for me I'd leave it like this for a couple of days to see what happens.
 
@RGS Why is the image so much taller than the session display?
 
RGS
I give it a min width and height so that it doesn't zoom in like crazy and makes everything look bad
Your session will also have plenty of empty space when you open the interpreter :P
 
I see. And then it always shows the session transcript?
 
RGS
@Adám "always"? You mean the full thing? If it is too long it gets truncated.
 
No, I mean, it doesn't just show the result, it shows the transcript including input.
 
RGS
10:00 AM
On top of TryAPL's default ]rows behaviour, if the full session has 101+ lines, it gets truncated to 100 lines. But if things aren't crazy-long, it shows input+output
You can give me a couple of things to try, I'll tweet them at the bot, and we can work from there.
 
3⍴'`'
 
RGS
@Adám the bot doesn't escape strings right now, and it won't for a long time. I don't feel like writing a parser
 
@RGS It is super easy to parse APL strings.
 
RGS
@Adám even with comments and all? if so, then maybe I can add that.
 
dyalogaplbot←5 then - @dyalogaplbot ⍳10
 
RGS
10:03 AM
Right now I just use a simple regex to look for code: "`(.*?)`"
 
' @dyalogaplbot ',4⍴⎕UCS 96 9075 51
 
RGS
@Adám hehe that's a nice one; let's see what happens
 
Next up: a quine
@RGS Did you forget backticks?
 
RGS
@Adám yes give me a sec
 
Huh, how comes it didn't react to its result tweet?
 
RGS
10:10 AM
@Adám it did
but there's an interval
 
Oh, I see.
 
RGS
I can only query for mentions 75 times every 15 mins, so I have to pull mentions once every 12s.
So there was a delay between the mention and the reply.
 
CMC: Quine that includes @dyalogaplbot and two backticks with something between them.
 
RGS
xD
 
@RGS You might want to let it ignore tweets from itself.
 
RGS
10:18 AM
True, that is a restriction worth considering.
Now I'll go afk for a bit, if people come up with such a quine, feel free to throw it at the bot.
(The bot might fall asleep if my computer does; still have to figure out hosting @Adám)
 
Jason will set that up for you.
 
@rak1507 I find that depressing.
 
@RGS Because it isn't a single token. Rather recognises certain operands.
 
RGS
10:45 AM
@Adám ah I understand, thanks.
 
RGS
 
@JeffZeitlin ^
@RGS :-) Did you make the bot ignore itself?
 
RGS
not yet
on it, though
 
ooh, recursive tryAPl bot calls lmao
 
@RGS How do you construct the TryAPL URLs?
 
RGS
What specific part do you want to know about?
Wait are you talking about the requests to execute code or the "try it online" links in the replies?
 
11:05 AM
The links in the replies.
 
RGS
I take all the code that was ran and join it with " ⋄ ", then I do fancy url escaping with urllib.parse.quote_plus and then I plug it into "https://tryapl.org/?q=$1&run"
Where $1 is replaced by the escaped code.
 
Can you try {⍵}2?
 
Thanks, that works.
The thing is that standards don't require %-escaping {} but if they occur in a URL, Twitter gets confused.
 
RGS
Alright, so now the bot avoids recursion introduced by other users, but still replies to its self-replies
so that the bot can write threads and evaluate its own code
But it won't evaluate code that appears in replies to evaluating code from others.
 
11:18 AM
very neat
how do i set default RIDe editor
 
RGS
11:38 AM
 
I think that's very neat.
We should make TryAPL understand %0A…
 
RGS
Is that the newline?
 
Yeah.
 
RGS
That'd be neat.
 
We're planning multi-line input anyway.
 
12:16 PM
> complete confidence
Maybe time for formal verification?
 
@Bubbler What do you mean? Open sourcing it?
 
@Adám No, formal verification is e.g. writing a computer-assisted proof that the given algorithm works correctly on all possible inputs
 
@Bubbler Hm, that's an interesting idea. Not sure how one would go about it, though.
 
12:32 PM
@Adám This is a great textbook in that topic, if you're interested
Volumes 5 and 6 are actually new, and it looks like you can verify C programs directly now (VST project was still ongoing when I was first learning Coq)
 
 
7 hours later…
7:16 PM
@Adám Thank you for the pointers! I'm now digesting the Legrand book.
 
@MarekKowalczyk Great. Feel free to ask if you have any questions or run into roadblocks.
 
8:08 PM
there was some discussion in TNB about a reduce-like operator that actually works for =/, and similarly for >/ and </
i implemented it as {∧/¨ 2⍺⍺/¨ ⍺ ,/⍵} - is there a better way of doing this (in terms of actual code style / efficiency, not golfing)?
and also, if i want this to work for both monadic and dyadic (like, might not be provided), how would I go about doing that? I'm not very familiar with implementing custom operators
 
@hyper-neutrino It would only work on simple vectors. The proper coding would be {∧/¨(2⍺⍺/⊢)⌺(⍪⍺1)⊢⍵} or {(∧/2⍺⍺/⊢)⌺(⍪⍺1)⊢⍵}
@hyper-neutrino So you'd want the default to be 2?
 
well, standard reduce reduces the whole thing so ideally this would work the same way
 
@hyper-neutrino So monadic should be identical to the current n f/ y?
 
uh, I think? ¯\_(ツ)_/¯
like =? where ? is the new operator should check if a list is all equal
 
Ah, then without a left argument, it would be ∧/2f/⊢ but with a left argument it'd do so on windows. Got it.
 
8:23 PM
yeah, that looks right
 
@hyper-neutrino Using your above definition (which only works sensibly on simple vectors) it'd be really easy: {⍺←⊢ ⋄ ∧/¨ 2⍺⍺/¨ ⍺ ,/⍵}
@hyper-neutrino Using Stencil: {⍺←≢⍵ ⋄ (∧/2⍺⍺/↓)⌺(⍪⍺1)⊢⍵} but note that this preserves the number of elements by using shorter windows at the edges. Also note that replaces from above. Otherwise we add padding rather than look at shorter windows.
 
how does ⍺←⊢ work
is it that if the left argument is not defined it replaces it with right-tack so ⊢ ,/⍵ is just ident(reduce ⍵ on ,) ?
 
8:42 PM
@hyper-neutrino Yes exactly. ⍺←… is basically a conditional in that the whole expression is only run if the containing function was called monadically, but skipped if it was called dyadically:
      {⍺←⎕←'monadic' ⋄ 42}⍬
monadic
42
      ⍬{⍺←⎕←'monadic' ⋄ 42}⍬
42
 
oh, that's cool! so it's a special-case for ?
 
It is a special case for ⍺← in that any (non-whitespace) variation is an error. E.g. ⎕←⍺← is an error and so is (⍺)←
While a function cannot take a non-array as argument, can be assigned any type of item, even a function or operator value.
E.g. a (simplified) model for is {⍺←{⍵ ⋄ ⍵⍵} ⋄ (⍵⍵ ⍺) ⍺⍺ (⍵⍵ ⍵)}
 
ah, okay. that's very interesting
 
Normally, x f⍥g y is (g x) f (g y) but if gets a "bypass" operator value, namely a monadic operator that ignores its operand and returns its argument, then the monadic call is (g{⍵ ⋄ ⍵⍵}) f (g y) making the left g be ignored and returning the result of f (g y)
(The real is not quite this, because it has to handle shy functions, but this version is fine for modelling.)
 
i'm not sure i understand here how ⍺←{⍵ ⋄ ⍵⍵} is working, specifically {⍵ ⋄ ⍵⍵}
so if it's just f⍥g y instead of x f⍥g y, then is set to {⍵ ⋄ ⍵⍵}?
 
8:50 PM
Yes.
 
and so the second statement (⍵⍵ ⍺) ⍺⍺ (⍵⍵ ⍵) is (⍵⍵ {⍵ ⋄ ⍵⍵}) ⍺⍺ (⍵⍵ ⍵) from what I can tell
 
Oops. I made a typo.
It should say {⍵ ⋄ ⍺⍺}
Dfns and dops terminate on the first statement which is neither an assignment, a guard or an error guard, so ⍺⍺ is never reached, as is returned, but it is the mere mention of ⍺⍺ that makes it into a monadic operator.
 
With ⍵⍵ it would fail because its mention would create a dyadic operator which isn't being given a right operand. Insta-fail.
 
ah okay this makes a bit more sense
 
8:53 PM
I'm so sorry about that.
 
no worries - thanks for explaining :)
 
00:00 - 21:0021:00 - 22:00

« first day (1609 days earlier)      last day (1035 days later) »