[seqfan] Re: Maple strongly discouraged

W. Edwin Clark wclark at mail.usf.edu
Sun Jan 12 21:20:07 CET 2014


I also get the same values with the procedure for Maple 16 and Maple 17.
I would like to see a specific example where RETURN and return give
different
values in any two versions of Maple.

--Edwin


On Sun, Jan 12, 2014 at 3:13 PM, Neil Sloane <njasloane at gmail.com> wrote:

> Robert, I was quoting Russell Walsmith,
> from an email to seq fans this morning,
> as follows:
>
> (quote)
>
> [seqfan] Re: Re Nice variant on A030067
> Russell Walsmith ixitol at gmail.com via list.seqfan.eu
> 9:59 PM (17 hours ago)
>
> to Sequence
> Just found this A109671 entry... pretty cool. But the Maple code, cut and
> pasted into Maple 17, gives me the sequence
> 1, 1, 2, 1, 1, 2, 1, 1, 4, 3, 3, 2, 7, 5, 6, 1, 15, 6, 11, 3, 20, 9, 17, 2,
> 33, 11, 26, 5, 43, 16, 37, 1...
>
> Any suggestions?
>
> Russell
> (end quote)
>
> Here is what the code was:
>
> > 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;
>
> I replaced it by one M Hasler sent,
> which avoided using RETURN
>
> Neil
>
>
>
> On Sun, Jan 12, 2014 at 2:59 PM, <israel at math.ubc.ca> wrote:
>
> > How and when does it produce incorrect answers in Maple 17? In my copy of
> > Maple 17 (actually Maple 17.02), as far as I can tell it produces the
> same
> > results as the current updated version.
> >
> > Cheers,
> > Robert Israel
> >
> >
> >
> >
> >
> > On Jan 12 2014, Neil Sloane wrote:
> >
> >  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
> >>
> >>
> > _______________________________________________
> >
> > Seqfan Mailing list - http://list.seqfan.eu/
> >
>
>
>
> --
> 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
>
> _______________________________________________
>
> Seqfan Mailing list - http://list.seqfan.eu/
>



More information about the SeqFan mailing list