## Fortuitous inverse

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

### Fortuitous inverse

I always keep an if operator in the ws:This allows me to do, among an awful lot of other stuff: which I understand is going to be an i-beam in 16 as "enclose if simple".
What's not immediately obvious is thatis in many cases its direct inverse "disclose if single".
Sometimes APL is just right even without meaning to be!

Phil Last

Posts: 460
Joined: Thu Jun 18, 2009 6:29 pm

### Re: Fortuitous inverse

Hi Phil,
a minor detail: it's not going to be i-beam, it will have its own symbol!
Michael|Dyalog

Posts: 8
Joined: Thu Mar 02, 2017 4:29 pm

### Re: Fortuitous inverse

If - nice!
"Nest" (formerly known as enclose-if-simple) will be monadic ⊆.
Dyadic ⊆ will be APL2(⎕ML=3)-style "partition". We're hoping this will encourage people towards writing their code in migration-level 1.

JohnS|Dyalog

Posts: 172
Joined: Wed Sep 10, 2008 10:01 am

### Re: Fortuitous inverse

paulmansour

Posts: 259
Joined: Fri Oct 03, 2008 4:14 pm

### Re: Fortuitous inverse

If up-arrow were only either mix or first, right-shoe were only first or mix and if equal-underbar were only depth then yes, you could write a function to do it.

If you could find a sure way to distinguish a monadic from a dyadic call to the functions represented by those glyphs you could still write a function to do it that would work most of the time. More if you could identify the exceptions to your default ⎕ML=3. .

Otherwise ...

There again there are only about eight hundred occurrencies of each of equal-underbar and right-shoe and about a thousand of up-arrow in FlipDB.

But to go back to John's thesis I think Dyalog might hope more realistically that the new primitive dyad will encourage users to go back to ⎕ML=2 which is the point after which dyadic left-shoe gained its new definition.

To go back to ⎕ML=1 might require a run-time intervention, a temporary bolt-on to the tracer (say), to flag the hits that count as the interpreter can only ascertain whether it's got a monad or a dyad at that time.

Phil Last

Posts: 460
Joined: Thu Jun 18, 2009 6:29 pm

### Re: Fortuitous inverse

This replaces a second identical copy of the above post. Dyalog was slow responding last evening and I seem to have hit "Submit" twice.
Last edited by Phil Last on Wed May 03, 2017 9:12 am, edited 1 time in total.

Phil Last

Posts: 460
Joined: Thu Jun 18, 2009 6:29 pm