Group Abstract Group Abstract

Message Boards Message Boards

0
|
1.8K Views
|
5 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Question Regarding the Behavior of ValueQ Function in Mathematica

POSTED BY: Hengjian Wang
5 Replies

Thank you very much for your response. It may indeed be due to the "Legacy" option, but I'm still unclear about the specific effects of using "Legacy". This is because I'm not familiar with how the ValueQ function behaved in previous versions. Additionally, I'm puzzled as to why ValueQ[a[b]] returns True, even though a[b] itself hasn't been assigned a value.

Is there any documentation available for older versions? Or is there another method to understand how ValueQ worked in previous versions? I noticed in the "History" section it only mentions updates to the function, but where can I find specific details about what those updates entail?

POSTED BY: Hengjian Wang
Posted 1 year ago

ValueQ was updated in 12.2. One gets the book behaviour with the option Method->"Legacy". See documentation for ValueQ, the Details section.

a[b][1] = x;
ValueQ[a[b], Method -> "Legacy"]
POSTED BY: Hans Milton
Posted 1 year ago

The documentation (http://reference.wolfram.com/language/ref/ValueQ.html) seems pretty clear. ValueQ takes a Method option, and Method has 5 choices: Automatic, "SymbolDefinitionsPresent", "TrialEvaluation", "OwnValuesPresent", and "Legacy". I think the answer to your question is found in the documentation for "Legacy": "match behavior in Version 12.1 and earlier".

POSTED BY: Eric Rimbey
POSTED BY: Hengjian Wang

The way I understand the documentation, ValueQ[a[b]] gives False because a[b] has no value, in the sense that you never defined a[b]=something; iif I enter a[b] I get back a[b]. Your definition a[b][1] = x defines a subvalue, not a value, of a[b]. Try ValueQ[a[b][1]].

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