1
$\begingroup$

Mathematica 10.1 has a new function MinMax. It is absent in the current CDF Player 10.0.2. CDF files that use MinMax leave the function unevaluated, and thereby produce errors. One approach would be to rename the function in my own code, avoiding the problem. But I have been using a function of that name for many years, and it is deeply embedded in my libraries. Is there a workaround to this problem, other than waiting for Wolfram to update CDF Player to compatibility with 10.1? Here is a simple example for testing:

test = Manipulate[MinMax[{a, b}], {a, 0, 1}, {b, 0, 1}]

Export["test.cdf", test]
$\endgroup$
  • 8
    $\begingroup$ But I have been using a function of that name for many years That is one of the reason why one should not define user level functions that starts with UpperCase ! $\endgroup$ – Nasser Apr 12 '15 at 6:20
  • 2
    $\begingroup$ I don't understand the question. Are you asking how to get MinMax in CDF player, or how to avoid conflict between your own and the builtin MinMax? $\endgroup$ – Szabolcs Apr 12 '15 at 6:46
  • 1
    $\begingroup$ The Villegas-Gayley trick may be of some help here. $\endgroup$ – Sjoerd C. de Vries Apr 12 '15 at 6:49
  • $\begingroup$ if your MinMax is doing the same thing as the new 10.1 MinMax you could define it only for the older version, or probably more correctly if it isn't defined already. If they do different things, you'll need to rename your MinMax and Nassers comment fully applies... $\endgroup$ – Albert Retey Apr 12 '15 at 10:43
  • 1
    $\begingroup$ @abwatson: soory, I didn't see your comment, if you use the @ notation, a message will displayed for the user you are addressing so you are more likely to get an answer. "define only for older version" could either be done checking $VersionNumber and $ReleaseNumber or, and I think that would be the better solution by checking if the symbol already exists using NameQ: If[Not@NameQ["MinMax"],(*define it...*)]; $\endgroup$ – Albert Retey Apr 15 '15 at 15:02
1
$\begingroup$

The work-around I adopted was to create a temporary version of my library that used only a new non-conflicting version of minmax (no caps!) and used that library to create the CDF. Still hoping for a CDF Player that has the same functions as Mma 10.1.

$\endgroup$
  • $\begingroup$ the corresponding player versions ususally are made available a few months after a new mathematica version is available, so that seems to be WRIs strategy. I don't know why they do it that way, it makes the whole concept of CDFs somewhat questionable unless you stick to that version for which players already are available (which I usually do). You'd then use the newest mathematica version only to prepare stuff you want to deploy for the upcoming players... $\endgroup$ – Albert Retey Apr 15 '15 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.