updatesR4/compatibility - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : updatesR4/compatibility

Compatibility between Maple V Release 3 to Maple V Release 4.

  

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

 

Major Differences:

Semantic changes:

Error checking:

System changes:

Deletions:

Name changes:

Useful idioms:

Mathematical changes:

Major Differences:

• 

Release 3 .m files cannot be read by Release 4 Maple.

• 

Grammar changes: ``:'' in procedure declarations replaced by ``::''. The old syntax is still accepted, but a warning is issued.

• 

``::'' is an operator. See typematch. It used to mean "end of statement" followed by "null statement" followed by "end of statement".

• 

The angle bracket functions have been removed. The two constructs < | > and < | | > functions have been removed. The construct "< expr >" is no longer a function, but is a call to the anglebracket function. As an example "< x+2 >" used to be a function that adds 2 to its argument; now it is "anglebracket(x+2)". The function anglebracket does not have any specified meaning. To recover the Release 3 functionality:

< 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, mutatis mutandis, for sets.

• 

The name `+` is now a function that evaluates (it does the addition). For example, {`+`(1,2)} returns 3. It used to remain 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).

• 

Plots of a list now mean multiple-plots instead of a point plots. The functionality that used to be provided by {plot([x1,y1, ..., xn,y1])} is now obtained by stating explicitly the pairs of points {plot( [[x1,y1], ..., [xn,yn]] )}. The reason for this change is to be able to give specific options for each sub-plot; for example, one can specify a list of colors.

Error checking:

• 

It is now an error to have duplicate globals, locals and argument names. Maple now gives error messages for the following examples:

proc(x) global y,y; end;

 Error, global `y` is declared more than once

proc(x) local y,y; end;

 Error, local `y` is declared more than once

proc(y) global y; end;

 Error, parameter and global `y` have the same name

• 

The following variables are now protected:

<>

=

real

algext

algfun

algnum

algnumext

arctrig

array

complex

cubic

even

evenfunc

expanded

facint

infinity

intersect

laurent

linear

listlist

mathfunc

matrix

minus

monomial

negative

negint

nonneg

nonnegint

nothing

odd

oddfunc

PLOT

PLOT3D

point

polynom

posint

positive

prime

quadratic

quartic

radext

radfun

radfunext

radnum

radnumext

ratpoly

realcons

realcons

RootOf

scalar

sqrt

square

symmfunc

taylor

trig

type

union

vector

 

 

System changes:

• 

Name protection is no longer removed by unassignment. Given protect(n); one used to be able to remove the protection using n:='n'; This is no longer possible. The mechanism to be used is unprotect(n). This is because name protection is implemented using attributes. See also attributes.

• 

List addition is now active. It used to be that [1,2]+[20,30] remained unchanged. Now the addition will be performed.

[1,2]+[20,30];

21&comma;32

(1)
  

Because of this, the data structure for padic and evalr have been changed.

with(padic): lprint(cosp(3,3));

PADICp_adic3&comma;0&comma;1&comma;0&comma;1&comma;0&comma;2&comma;0&comma;1&comma;2&comma;1&comma;1

(2)
  

It used to give "PADIC([3, 0, [1, 0, 1, 0, 2, 0, 1, 2, 1, 1]])". See also padic. 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. One can set infolevel[hints] to 0 to avoid these messages.

• 

The functions words() and gc(num) have been superseded by the kernelopts() function. The function gc() remains, and will still perform a garbage collection upon evaluation. The function words() is removed entirely.

  

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

• 

The end of line no longer terminates the input to the readstat function. One needs to terminate the input with a semi-colon. This is to allow multi-line statement input. The I/O library and the readline and the parse function can be used to recover the previous behavior. See readstat, readline and iolib.

• 

The status variable has been removed. Its functionality is in the kernelopts function.

status[1]

-->

kernelopts(bytesused)

status[2]

-->

kernelopts(bytesalloc)

status[3]

-->

kernelopts(cputime)

status[4]

-->

no equivalent, is related to kernelopts(printbytes)

status[5]

-->

kernelopts(gcfreq)

status[6]

-->

kernelopts(gcwordsreturned)

status[7]

-->

kernelopts(gcwordsavail)

status[8]

-->

kernelopts(gctimes)

• 

The functionality of {interface(endcolon)} is now in {parse()}, with no arguments. See parse.

Deletions:

• 

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

• 

The name E no longer has any special meaning (it used to mean the constant 2.718...). Most of the time, alias(E=exp(1)) can be used 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 have been removed.

• 

The debever, cartan, petrov, and tensor packages have been superseded by a new tensor package.

• 

The function write() has been deleted since it has been superseded by the IO library. See iolib.

• 

Package changes:

• 

The geometry and DEtools packages have been rewritten.

Name changes:

• 

We replaced define(linear(...)) by define(Linear(...)) because of the new type(.., linear). See define and type/linear.

• 

The top level functions: inttrans[fourier], invfourier, invlaplace, invztrans, inttrans[laplace], inttrans[mellin] are now part of the new inttrans package.

• 

Because of the new top level function add(), the function linalg[add] has been renamed linalg[matadd]. Similarly, powseries[add] has been renamed powseries[powadd].

• 

The financial functions readlib(finance) have been superseded by a finance package.

• 

Because of the new top level function remove, the function stats[transform,remove] has been renamed stats[transform, subtractfrom]. The new name has been chosen by analogy to the name stats[transform, divideby]. See transform[subtractfrom]

• 

The Gauss package was renamed to Domains, to avoid confusion with a different software of the same name, marketed by another vendor.

• 

The type(..., prime) construct has been renamed type(..., primeint).

• 

The function W() has been renamed LambertW().

Useful idioms:

• 

The add() function replaces effectively the construction convert( ..., `+`). Similarly mul() should be used instead of convert( ..., `*`). 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.

  

RootOf's are denested if possible.

  

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

  

Function numtheory[legendre] now computes the Legendre symbol.