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: 13
Joined: Mon Jan 29, 2018 2:08 am

First Entry into Matrix Pushes Stack

Post by Epidiah » Fri Mar 09, 2018 9:58 pm

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: 492
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

Re: First Entry into Matrix Pushes Stack

Post by Thomas Okken » Fri Mar 09, 2018 11:48 pm

Epidiah wrote:
Fri Mar 09, 2018 9: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: 13
Joined: Mon Jan 29, 2018 2:08 am

Re: First Entry into Matrix Pushes Stack

Post by Epidiah » Sat Mar 10, 2018 12:54 am

Two for one! Score!

Thomas Okken
Posts: 492
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

Re: First Entry into Matrix Pushes Stack

Post by Thomas Okken » Sat Mar 10, 2018 8:07 am

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: 30
Joined: Thu Dec 21, 2017 12:23 pm

Re: First Entry into Matrix Pushes Stack

Post by whuyse » Sat Mar 10, 2018 4: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
42S #3249S01123
DM42 #00345

Thomas Okken
Posts: 492
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

Re: First Entry into Matrix Pushes Stack

Post by Thomas Okken » Sat Mar 10, 2018 4:37 pm

whuyse wrote:
Sat Mar 10, 2018 4: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: 447
Joined: Wed May 03, 2017 5:46 pm
Location: Malone, NY USA

Re: First Entry into Matrix Pushes Stack

Post by toml_12953 » Sat Mar 10, 2018 5:11 pm

Thomas Okken wrote:
Sat Mar 10, 2018 4:37 pm
whuyse wrote:
Sat Mar 10, 2018 4: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

Ducator meus nihil agit sine lagunculae leynidae accedunt

DM42 SN: 00025 (Beta)
SN: 00221 (Shipping)

Thomas Okken
Posts: 492
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

Re: First Entry into Matrix Pushes Stack

Post by Thomas Okken » Sat Mar 10, 2018 5:18 pm

toml_12953 wrote:
Sat Mar 10, 2018 5: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: 13
Joined: Mon Jan 29, 2018 2:08 am

Re: First Entry into Matrix Pushes Stack

Post by Epidiah » Sat Mar 10, 2018 5:54 pm

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: 492
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

Re: First Entry into Matrix Pushes Stack

Post by Thomas Okken » Sat Mar 10, 2018 6:04 pm

Epidiah wrote:
Sat Mar 10, 2018 5: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