Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • $\begingroup$ "ValueQ gives False only if expr would not change if it were to be entered as Wolfram Language input. " - x[i + 10] would change, becoming x[10+i] $\endgroup$ Commented Feb 5, 2018 at 21:02
  • $\begingroup$ For your application here, use a smarter test function, like IntegerQ or NumericQ $\endgroup$ Commented Feb 5, 2018 at 21:19
  • $\begingroup$ @JasonB Actually, it would change also because i has a value within the loop. $\endgroup$ Commented Feb 5, 2018 at 21:21
  • $\begingroup$ From my experience, lists work much faster than constructions like x[i]. And they have no such weird artifacts. $\endgroup$ Commented Feb 5, 2018 at 21:28
  • 1
    $\begingroup$ Sounds like you should be using memoization? $\endgroup$ Commented Feb 5, 2018 at 21:48