
                       Maple V R3/R4 Compatibility
                       ===========================


This document itemizes compatibility issues affecting users upgrading from
Maple V Release 3 to Maple V Release 4.


Due to internal changes, Maple V Release 4 cannot read Release 3 .m files.

Grammar changes:

  :: replaced : in procedure declarations.
     The new release still accepts the old syntax, but issues a warning.
  :: is an operator. (See ?typematch.) Its use represents an "end of statement"
     followed by "null statement" followed by "end of statement"

  The angle bracket functions no longer exist.
  The two constructs < | > and < | | > also no longer exist.
  The construct "< expr >" is no longer a function, but is a call to
    the anglebracket function. As an example, "< x+2 >" was previously a 
  function
    that added 2 to its argument; now this function is  "anglebracket(x+2)".
  The function anglebracket does not have any specified meaning.
  To recover the Release 3 functionality, do the following:
     < x+3 >          becomes   x -> x+3
     < x*y | x >      becomes   x -> x*y
     < x*y | x | y >  becomes   proc(x) local y; x*y end


Semantic changes:

  Subrange indexing on a list returns a list instead of an expression 
    sequence. For example:  L:=[10,20,30]; L[1..2] returns the list [10,20]
    instead of the expression sequence 10, 20. The same holds for sets.
 
  The name `+` is now a function that evaluates (it does the addition).
    For example, `+`(1,2)  returns 3. Before, it had remained unevaluated. 
    This affects type checking,  type(z+x+y, `+`( name ) ); 
    now requires additional forward quotes: type(z+x+y, '`+`'(name) );.

  Angle bracket functions: <f> has a different meaning (see above).


Error checking: 

  Duplicate globals, locals and argument names are now errors. An example
    of such an error would be the following: proc(x,x) end; 
	    proc(x) local y,y; end;
    and 
	    proc(x) global y,y; end;
    are no longer acceptable.


System changes:

  Unassignment no longer removes name protection.
    Given  protect(n); previously, you could remove the protection using
    n:='n', but not now. The mechanism to use is 
    unprotect(n);
    The reason being that you implement name protection using attributes.
    (See ?attribute)

  List addition is now active. Previously, [1,2]+[20,30]
    remained unchanged. Now, Maple performs the addition. 
    Also &* is now an active function, and will compute the inner product
    of its arguments. [1,2] &* [20, 30] previously remained unchanged.
    See the linalg.ms example worksheet.
  This created the need to change the data structure for padic and evalr.
    with(padic): lprint(cosp(3,3)); previously gave:
      PADIC([3, 0, [1, 0, 1, 0, 2, 0, 1, 2, 1, 1]])
    but now gives:
      PADIC(p_adic(3,0,[1, 0, 1, 0, 2, 0, 1, 2, 1, 1]))
    See the help on the padic package. This change should be mostly 
    invisible.
  The data structure for evalr used to be [a..b], [x,a..b], [a..b,c..d, ...]
    and so on.
    It is now INTERVAL(a..b), INTERVAL(x,a..b), INTERVAL(a..b, c..d, ...)
 
  Some userinfo messages can appear because  infolevel[hints] has the 
    value 1 by default.

  The kernelots() function has superseded the functions words() and gc(num). 
    See ?kernelopts. The function gc() remains, and will still
    perform a garbage collection upon evaluation. The function words() no
    longer exists.

  The internal representation of Maple objects has changed in some cases. 
    This can affect code involving the hackware package. ?hackware

  The end of line no longer terminates the input to the readstat function.
    One needs to terminate the input with a semi-colon. This action allows 
    multi-line statement input. You can use the I/O library and the readline 
    function to recover the previous behaviour. See ?readstat, ?readline
    and ?iolib


Deletions:

  The %i format for printf() has been removed.

  The name E no longer has any special meaning (it previously meant the 
    constant 2.718...). Most of the time, you can use alias(E=exp(1)) to
    update Release 3 code. Be aware that some simplifications will be
    different and that type(exp(1),name) is false.

  The bianchi, geom3d, projgeom, and oframe packages no longer exist.

  The new tensor package has superseded the debever, cartan, petrov, and
  tensor packages. 

  The function write() no longer exists since the I/O library has superseded it.
  See ?iolib


Package changes:

  View the geometry and DEtools package rewrites under ?geometry 
  and ?DEtools.
 

Name changes:

  The new type(.., linear) replaced define(linear(...)) by define(Linear(...)). 
    See ?define and  ?type[linear]

  The top level functions: fourier, invfourier, invlaplace, invztrans,
    laplace, mellin and ztrans are now part of the new inttrans package.
    See ?inttrans

  Because of the new top level function add(), linalg[matadd] replaced the 
    function name linalg[add].
    Similarly, powseries[powadd] replaced powseries[add]. 
    See ?linalg[add], ?linalg[matadd] and ?powseries[powadd].

  The finance package superseded the financial functions readlib(finance) 
    package.
    See ?finance

  Because of the new top level function remove(), the function
    stats[transform,remove] now has the name stats[transform, subtractfrom].
    An analogy to the name 
    stats[transform, divideby] inspired the choice for the new name.
    See ?remove and ?transform[remove]

  Domains is the new name for the Gauss package, to avoid confusion with a 
    software package of the same name, marketed by another vendor. 
    See ?Domains.

  The construct name type(..., primeint) replaced type(..., prime).

  LambertW is the replacement name for the function W.


Useful idioms:

  The add() function effectively replaces the construction  
    convert( ..., `+`).
  Similarly, you should use mul() instead of convert( ..., `*`).
    See ?add and ?mul. 
  These functions are similar to the functions sum() and product() which
    provide *symbolic* sums and products. 


Mathematical changes:

  The branch cut definitions for BesselJ, Ci have changed.

  You will find RootOf's denested where possible.

  Function composition of the form trigh@ln now automatically simplifies.

