Fortuitous inverse
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 !
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 !
6 posts
• Page 1 of 1
Fortuitous inverse
I always keep an if operator in the ws:
What's not immediately obvious is that
Sometimes APL is just right even without meaning to be!
if←{
1∊⍵⍵⊣⍵:⍺⍺⊣⍵
⍵
}
This allows me to do, among an awful lot of other stuff: ⊂if≡
which I understand is going to be an i-beam in 16 as "enclose if simple".What's not immediately obvious is that
⊃if≢
is in many cases its direct inverse "disclose if single".Sometimes APL is just right even without meaning to be!
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
Re: Fortuitous inverse
Hi Phil,
a minor detail: it's not going to be i-beam, it will have its own symbol!
a minor detail: it's not going to be i-beam, it will have its own symbol!
- Michael|Dyalog
- Posts: 23
- 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.
"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
Re: Fortuitous inverse
Dyadic ⊆ will be APL2(⎕ML=3)-style "partition". We're hoping this will encourage people towards writing their code in migration-level 1.
I've been meaning to do this for a while, and that will certainly help. I feel somewhat duped by Dyalog ... I had always thought that one should be using the highest migration level...
Anyway, I want to change a large code base from ML 3 to ML 1. Can this be done programatically or is it a painful line-by-line inspection? I haven't thought that much about it yet...
- paulmansour
- Posts: 420
- 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.
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: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
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: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group