Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 142

Questions about how Mathematica evaluates expressions, tracing evaluation (Trace*), handling expressions in unevaluated form (Hold*, Unevaluated), nonstandard evaluation, etc.

12
votes
functionality use this (e.g. Dataset). When investigating the transition from unoptimized to optimized expression forms, beware that any evaluation will disturb the observations. We must write … expressions like AtomQ[Unevaluated@...]. TreeForm in particular is known to have evaluation leaks that require doubling up constructions such as Unevaluated to see the actual structure (e.g. TreeForm[Unevaluated@Unevaluated@<|1 -> 2|>]). …
modified Aug 26 by WReach
10
votes
the original definition to unwrap the association object during the initial evaluation and to recreate it upon use. We do that using Normal@URLParse[...] and Inactive[URLBuild@*Association]. The …
modified Aug 3 by WReach
3
votes
Short Version The behaviour we see is by design. It is due to the fact that we are using the special head Evaluate to force early evaluation of the second argument of CompoundExpression -- an … wrap the second expression within Evaluate, it is evaluated before the compound expression itself is evaluated: Print["one"]; Evaluate[Print["two"]] (* two one *) After that early evaluation and …
modified Jan 8 by WReach
51
votes
Which one we use depends upon what we are trying to determine. If our goal is to measure algorithmic time complexity, Timing (used carefully) is the tool. If we want to measure how long a computatio …
modified Jan 26 '18 by WReach
8
votes
case of Hold appears to be an evaluation leak, but maybe it is intentional for symmetry with HoldForm. HoldForm Variant A trace of the HoldForm variant suggests that the behaviour is by design … . A close inspection of the trace yields use of Unevaluated, which suggests that some attempt was made to prevent evaluation. But this measure is defeated by later steps. My guess is that there is …
modified Nov 15 '17 by WReach
7
votes
. Responding to the Updated Question If we wish to update the original variables, we need to prevent the evaluation of the individual variables. For example: Scan[Function[Null, PrependTo[#, {"A", "B … programs the chance for so-called "evaluation leaks" to spring up grows quickly. All of the built-in destructive operators (like PrependTo, Set, SetDelayed etc) require held arguments. In other …
modified Mar 8 '17 by WReach
7
votes
Prior to version 10 of Mathematica, there was a menu option Evaluation / Interrupt Evaluation... with the hot-key ALT-, (comma). This would temporarily suspend the current evaluation in progress … . The bad news is that this menu item is gone. The good news is that the hot-key still works in versions 10 and 11. The sequence of events is as follows: Start a long-running evaluation. At some …
modified Jan 22 '17 by WReach
5
votes
h[e1,e2,...]. The evaluation sequence is described in more detail in Chapter 7 of Power Programming with Mathematica by David B. Wagner. It is freely available to StackExchangers via (16485). When … they self-evaluate. Such symbols are said to be "inert". In the present case, f is inert. As a result, when evaluation gets down to the eleventh step the down-value of f is used to produce the …
modified Oct 11 '16 by Community
10
votes
[1 + 1]]] (* a :> 1 + 1 *) This is different from the normal evaluation process which only strips one level: ClearAll[f] f[x_] := x f[Unevaluated[Unevaluated[Unevaluated[1 + 1]]]] (* Unevaluated …
modified Aug 18 '16 by WReach
75
votes
RuleCondition provides an undocumented, but very convenient, way to make replacements in held expressions. For example, if we want to square the odd integers in a held list: Hold[{1, 2, 3, 4, 5}] /. …
modified Mar 23 '16 by Jacob Akkerboom
2
votes
I agree with the comment by @march that using an indexed list would simplify things nicely. However, if we wish to press on with named lists then one way would be to create a list of functions that e …
modified Jan 7 '16 by WReach
21
votes
I think the problem might be related to a bug in FullForm when applied to a ByteArray object: ByteArray["aV+jpGtfd3BHhoSvOthJpQ=="] // FullForm (* List[105,95,163,164,107,95,119,112,71,134,132,175,58 …
modified Nov 12 '15 by WReach
4
votes
A simple way to inject the value of expression into the unevaluated LinkWrite argument is to use With: Clear[bar] expression = Hold[bar = 3]; bar (* bar *) With[{x = expression}, LinkWrite[newK …
modified Sep 10 '15 by WReach
4
votes
As @image_doctor notes in a comment, the problem occurs because the definition of Test`Private`fQ is not being distributed to the other kernels. DistributeDefinitions uses Language`ExtendedFullDefini …
modified Jan 31 '15 by WReach
3
votes
: Iteration limit of 4096 exceeded. >> *) To guard against this possibility, we make sure that the last definition only takes effect if the evaluation of its argument actually resulted in a change … themselves HoldAll because Block will temporarily disable that attribute as well, leading to evaluation leaks. It would also be unsuitable if the application will not tolerate the partial evaluation of expressions such as we see in the last example above. …
modified Jan 31 '15 by WReach

15 30 50 per page