[seqfan] Re: Re Nice variant on A030067

Neil Sloane njasloane at gmail.com
Sun Jan 12 18:46:39 CET 2014


Maximilian, That is very helpful, thanks - I replaced the Maple code.
Maple has done this repeatedly over the years - changing fundamental
commands
so that old programs no longer work. Guess it is time to
switch to Mathematica.


On Sun, Jan 12, 2014 at 11:48 AM, M. F. Hasler <oeis at hasler.fr> wrote:

> If I may:
>
> The RETURN() or return() or RETURN or return functions/statements are
> useless and error-producing since the syntax changes in each version of
> Maple. (I exaggerate, of course.) But its true that they are useless
> (unless you really have to "bail out" from inside a multiply nested loop or
> similar construct) and it's not only simpler, shorter, but plain better to
> just remove them, so it should read:
>
>   f:=proc(n) option remember; local t1;
> >   if n = 1 then 1
> >   elif n mod 2 = 0 then f(n/2)
> >   else t1:= f(n-2)-f((n-1)/2);
> >   if t1 > 0 then t1 else f(n-2)+f((n-1)/2) fi fi end;
>
>
> (unless I'm wrong)
> See also http://www.maplesoft.com/support/help/Maple/view.aspx?path=return:
>
>>
> One common form of return from a procedure invocation occurs when execution
> ``falls through'' the end of the statement sequence which makes up the
> procedure body, in which case the value of the procedure invocation is the
> value of the last statement executed.
>>
> The return statement supersedes the RETURN function, which still exists for
> backward compatibility. However, use of the RETURN procedure is strongly
> discouraged.
>
>
> Maximilian
>
> _______________________________________________
>
> 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



More information about the SeqFan mailing list