First Entry into Matrix Pushes Stack

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Epidiah
Posts: 21
Joined: Mon Jan 29, 2018 3:08 am

First Entry into Matrix Pushes Stack

Post by Epidiah »

I'm not sure if this is the expected behavior or not, but when I open a matrix with EDIT or EDITN, if I try to key in a number before using the arrow menu keys, it pushes the old entry into the stack.

If I use an arrow menu key first to move to a neighboring entry, then key in the number just replaces the current one and nothing is pushed into the Y register.

For example, if I fill the stack with 2s, open the matrix menu, and press NEW, I get this:

T: 2
Z: 2
Y: 2
X: [ 2x2 Matrix ]

Then I press EDIT, it looks like this:

1:1=0
T: 2
Z: 2
Y: 2
X: 0

Which is to be expected. If I key in 42 for my first entry, the 0 in X is pushed to Y.

1:1=42
T: 2
Z: 2
Y: 0
X: 42

Then I right arrow over to 1:2, where there's another 0 waiting for me. I key in 17 there and the 0 is just overwritten, not pushed into the stack the previous one.

1:2=17
T: 2
Z: 2
Y: 0
X: 17

I see the same pushing behavior after I use the GOTO command within the matrix. Once I use an arrow to navigate the matrix, the pushing stops, but if I use GOTO it'll start again.

So I was just checking in to see if that's how it's supposed to behave. It seems odd to me changes like that, but I'm still trying to find my way around this machine.
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: First Entry into Matrix Pushes Stack

Post by Thomas Okken »

Epidiah wrote:
Fri Mar 09, 2018 10:58 pm
So I was just checking in to see if that's how it's supposed to behave. It seems odd to me changes like that, but I'm still trying to find my way around this machine.
It is not supposed to behave like that; that's a bug. Or two bugs, actually. :D

Things are a bit chaotic around here because of the aftermath of the storm (seriously, America, put your power lines underground already!), but I'll fix that in the next release, when I can.
Epidiah
Posts: 21
Joined: Mon Jan 29, 2018 3:08 am

Re: First Entry into Matrix Pushes Stack

Post by Epidiah »

Two for one! Score!
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: First Entry into Matrix Pushes Stack

Post by Thomas Okken »

Fixed in 2.0.18, out now for Android, Windows, MacOS, and Linux. And for iOS today or tomorrow, if recent experience is anything to go by.
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: First Entry into Matrix Pushes Stack

Post by whuyse »

In the 42S, EDIT enables stack lift, GOTO disables it, as do the four arrow commands.
So there was only one bug, the GOTO behaviour?
Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: First Entry into Matrix Pushes Stack

Post by Thomas Okken »

whuyse wrote:
Sat Mar 10, 2018 5:01 pm
In the 42S, EDIT enables stack lift, GOTO disables it, as do the four arrow commands.
So there was only one bug, the GOTO behaviour?
Werner
Hmm, on closer inspection, EDIT enables stack lift, and EDITN disables it. I could have sworn when I checked this yesterday that they both disabled it. I guess I was hallucinating. :|

Update: no, wait, it's even weirder. EDIT preserves the existing stack lift status. Hmm, and that's exactly what my old code did.

So, in fixing EDITN, I introduced a bug in EDIT. Although I wonder if I should just leave it the way it is now, since it's the original calculator's behavior that's weird to the point of seeming buggy. I certainly can see no advantage to the way it behaves.

Further update: well, except I can't rule out that there might be programs that rely on this behavior, or work around it if you will, and would break with this more consistent behavior. I guess I should roll back the EDIT change, then. Aaargh.
toml_12953
Posts: 795
Joined: Wed May 03, 2017 7:46 pm
Location: Malone, NY USA

Re: First Entry into Matrix Pushes Stack

Post by toml_12953 »

Thomas Okken wrote:
Sat Mar 10, 2018 5:37 pm
whuyse wrote:
Sat Mar 10, 2018 5:01 pm
In the 42S, EDIT enables stack lift, GOTO disables it, as do the four arrow commands.
So there was only one bug, the GOTO behaviour?
Werner
Hmm, on closer inspection, EDIT enables stack lift, and EDITN disables it. I could have sworn when I checked this yesterday that they both disabled it. I guess I was hallucinating. :|

Update: no, wait, it's even weirder. EDIT preserves the existing stack lift status. Hmm, and that's exactly what my old code did.

So, in fixing EDITN, I introduced a bug in EDIT. Although I wonder if I should just leave it the way it is now, since it's the original calculator's behavior that's weird to the point of seeming buggy. I certainly can see no advantage to the way it behaves.

Further update: well, except I can't rule out that there might be programs that rely on this behavior, or work around it if you will, and would break with this more consistent behavior. I guess I should roll back the EDIT change, then. Aaargh.
If you ask me (I know you didn't but that's never stopped me) when you have a choice, always go for the behavior of the original even if it's buggy.

Omnis Convenientiae! Kompatibilität über alles!
Tom L

Some people call me inept but I'm as ept as anybody!
DM10L SN: 059/100
DM41X SN: 00023 (Beta)
DM41X SN: 00506 (Shipping)
DM42 SN: 00025 (Beta)
DM42 SN: 00221 (Shipping)
WP43 SN: 00025 (Prototype)
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: First Entry into Matrix Pushes Stack

Post by Thomas Okken »

toml_12953 wrote:
Sat Mar 10, 2018 6:11 pm
If you ask me (I know you didn't but that's never stopped me) when you have a choice, always go for the behavior of the original even if it's buggy.
As a general rule, yes, although I have made exceptions, when there really doesn't seem to be any need for bug compatibility. Free42 does not have the 42S' PERM and COMB bugs, for example.
Epidiah
Posts: 21
Joined: Mon Jan 29, 2018 3:08 am

Re: First Entry into Matrix Pushes Stack

Post by Epidiah »

Sorry to cause all this trouble. Unfortunately, I don't have 42S to compare it to. I had to depend on the kindness of you good strangers. :D

So, on the original 42S, the EDIT function is the odd one out? That is EDITN, GOTO and all the arrows disable attack lift, but EDIT preserves it?

Now I'm rather curious if it was deliberately designed that way, and for what reason. It seems easier to depend on trusty old ENTER to enable stack lift whenever you need it than to remember in this one specific case you need to rely on CLX or perhaps flag 30 to disable it if you don't want it. I mean, I'll commit it to heart either way. It's just not clear to me what the intention was.
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: First Entry into Matrix Pushes Stack

Post by Thomas Okken »

Epidiah wrote:
Sat Mar 10, 2018 6:54 pm
Now I'm rather curious if it was deliberately designed that way, and for what reason.
We'll probably never know for sure, but the way EDIT handles stack lift is so weird I'm sure it's a bug. And, while I generally don't reproduce bugs, this one can easily affect how programs are written, so this behavior should be the same in Free42.
Post Reply