Question: Unexpected behavior of "read"

Hi Guys,

I encountered this rather unexpected behavior of Maple 18 when using the "read" function as shown below, where Maple fails to reduce the answer to 0, especially for (5). I'm curious if there's any deeper reason for this, and if there's a better or more standard solution than mine, that is, to use "parse( convert( expr, string ) )" as in (6)?

Thanks a lot!

``

restart;

 

assume(x>0);

 

f := x^2;

x^2

(1)

 

save f, "read_test.m";

 

restart;

 

f;

f

(2)

 

read "read_test.m";

 

f;

x^2

(3)

 

f - x^2;

-x^2+x^2

(4)

 

assume(x>0);

 

f - x^2;

x^2-x^2

(5)

 

f1 := parse( convert( f, string ) );

x^2

(6)

 

f1;

x^2

(7)

 

f1 - x^2;

0

(8)

 

NULL

Download test1.mw

Please Wait...