[seqfan] Re: Maple program
Richard J. Mathar
mathar at mpia-hd.mpg.de
Mon Oct 26 13:16:29 CET 2020
faw> Date: Fri, 23 Oct 2020 11:17:11 +0000 (UTC)
faw> From: Frank Adams-watters <franktaw at netscape.net>
faw> To: "seqfan at list.seqfan.eu" <seqfan at list.seqfan.eu>
faw> Subject: [seqfan] Maple program
faw>
faw> I'm looking at A081258. The Maple program there has the statement:
faw>
faw> if max(op(%)) <= n then
faw> true;
faw> else
faw> false;
faw> end if;
faw>
faw> I'm not familiar with Maple, but is there any reason to write this instead of just
faw>
faw> max(op(%)) <= n;
In many cases one needs an additional 'indirection' to return
a value that is simply one of the two truth values. Since it's
often a case of trial and error to figure out whether in-line-if's are fully
evaluated to one of the two values (at least with my Maple 9) I'm in
almost all cases wrapping these binary evaluations into if-then-else-clauses.
And, in addition, I'm never trying to squeeze all code into one-liners...
More information about the SeqFan
mailing list