Group Abstract Group Abstract

Message Boards Message Boards

Differences between Mathematica on the desktop and the cloud?

POSTED BY: John Erickson
2 Replies

Hi David,

Thank you for the explanation. So you really can't just say, "Just wrap it in CloudDeploy and it will work!" as I had been telling myself since the normal evaluation rules still apply. Are there any guidelines or best practices for how one handles these situations? The question that troubled me was an expression like FormFunction[{ToString[RandomChoice[{a,b,c}]]->"String"},#&][]. This works as you would expect in the notebook producing pseudo random associations like <|"a" -> "1" |> (assuming you put in 1 as your input).

If you try wrapping this in Delayed at any level and then try and Deploy it to the cloud it fails. I found a rather insane workaround to all of this by changing my approach, but I am still wondering if there is anything that can be said in general on the order of if expr works in the the desktop then expr suitably modified will work in the cloud. I am just trying to avoid ad hoc hacky solutions if possible.

John

POSTED BY: John Erickson

This is because, before CloudDeploy is executed in

CloudDeploy[RandomInteger[10]]

The RandomInteger[10] is first executed, yielding an integer to be deployed. So what gets deployed to the cloud is the result of the execution of RandomInteger[10]. The Delayed function is specifically designed to help overcome this behavior in the Cloud.

So, not a bug.

POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard