[seqfan] Maple strongly discouraged

Neil Sloane njasloane at gmail.com
Sun Jan 12 19:07:24 CET 2014


Dear Seq Fans, Maximilian Hasler has pointed out that
my Maple program in A109671 (which worked correctly in Maple 16)  no
longer gives correct results in Maple 17 because it used the RETURN()
command.

The Maple web site says

"use of the RETURN procedure is strongly discouraged"

and I can see why - it produces incorrect answers (without any warning). Of
course I don't see WHY they did this.

Now there over 1900 Maple lines in the OEIS that use the RETURN statement.
 Maybe these lines need a comment saying:

# Warning: May give incorrect answers because Maple has changed the meaning
of RETURN. Suggest switching to Mathematica instead.

(Not sure about the second part)

I could (and probably will have to) do this with a global edit.
Is there any other solution?  It is unethical for us to include programs
that give wrong answers.

Here's the Maple program that works correctly in Maple 16 but gives wrong
answers  in Maple 17:

> f:=proc(n) option remember; local t1;

> if n = 1 then RETURN(1);

> elif n mod 2 = 0 then RETURN(f(n/2));

> else t1:= f(n-2)-f((n-1)/2);

> if t1 > 0 then RETURN(t1) else RETURN(f(n-2)+f((n-1)/2)); fi; fi; end;

Neil
-- 
Dear Friends, I have now retired from AT&T. New coordinates:

Neil J. A. Sloane, President, OEIS Foundation
11 South Adelaide Avenue, Highland Park, NJ 08904, USA.
Also Visiting Scientist, Math. Dept., Rutgers University, Piscataway, NJ.
Phone: 732 828 6098; home page: http://NeilSloane.com
Email: njasloane at gmail.com



More information about the SeqFan mailing list