Post Reply 
Somewhere between a bug or feature:
11-13-2014, 09:59 PM (This post was last modified: 11-13-2014 10:26 PM by Han.)
Post: #2
RE: Somewhere between a bug or feature:
(11-13-2014 05:52 PM)DrD Wrote:  While working with a more complicated problem, I discovered this (a simple example):

[Entry Line]
b:=x^2;

a:=b|x=2; ---> x^2
-[but]-
a:=(b|x=2); ---> 4

While the behavior may be acceptable, remembering how the '|' (where) works is a little mind-tweaky, and it's history representation put a different spin even on that:

[History Screen]
(a:=b)|x=2 ----------- x^2
a:=b|x=2 ----------- 4

I'm not sure that it's worth discussing, but the way ()'s worked seemed a little peculiar. If one goes to the trouble of placing a constraint (substitution) on the underlying variable, it would seem that it was meant to be used in the solution. The result of either expression should have returned the numerical answer 4.

I don't see any issues here (which doesn't mean there aren't issues). When assigning variables a value, any expression that needs to be evaluated first will be done prior to storing. So when you type:

a:=(b|x=2), you are storing the result of b|x=2 into the variable a. Of course, if b:=x^2, then b|x=2 will return 4, which is then stored into a. Basically the right hand side of ":=" is evaluated first prior to storing into a.

(a:=b)|x=2 means to substitute x=2 into (a:=b) except there is no x to substitute into because (a:=b) is not a mathematical expression or function; it's a calculator process for storing variables.

Edit: Typing in: a:=b|x=2 will result in (a:=b)|x=2. I would have expected the calculator to think a:=(b|x=2) and not (a:=b)|x=2

Edit again: a:=b|x=2 being treated as (a:=b)|x=2 is at least consistent with other similar input: x+x^2|x=2 is interpreted as (x+x^2)|x=2 and not x+(x^2|x=2).

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Somewhere between a bug or feature: - DrD - 11-13-2014, 05:52 PM
RE: Somewhere between a bug or feature: - Han - 11-13-2014 09:59 PM



User(s) browsing this thread: 1 Guest(s)