In my opinion, Optional should just consistently not match when the default value does not match the pattern, period. Now we have nonsense like this: {}~MatchQ~{Optional[0., 0]} False You might ...

As pointed out in comments, this is caused by Plus[x] is x Here are some workarounds Plus[Power[x, 2], Power[y, 2]]~MatchQ~Verbatim[Plus][Power[_, 2] ..] Plus[Power[x, 2], Power[y, 2]]~MatchQ~...

HoldPattern and Unevaluated work too. You can also remove the HoldAll once you made the definition if you like. ClearAll[f, g, h] f[HoldPattern@Optional[x_, RandomReal[]]] := x g[Unevaluated@Optional[...

Association has HoldAllComplete attribute Association is not just another head denoting a special kind of list of rules or a certain kind of object. It has some properties that make querying it more ...

I think a third kind of behaviour would also be possible: it is debatable whether f@x_ = x, x_ -> x within Module[{x}, ... should not become f@x_ = x$123, x_ -> x$123 because then the sequence ...

I will give an elaborate answer because I think this is an area where Mathematica really shines ;) Let me digress. We know that, in general, an equation system defines a set of points as a function ...

You can do this using the discrete laplacian computed on the mesh by transforming along the thusly computed mean curvature flow. This operation is often called called smoothing in Geometry Processing. ...

For what it's worth, there also seems to be a way to integrate Mathematica into matlab (the other way around) using the "Mathematica Symbolic Toolbox for MATLAB--Version 2.0" http://ch.mathworks.com/...

Inspired by Szabolcs answer and the discussion in the comments, here's another solution: EvaluateOwnValuesOnlyAndHold~SetAttributes~HoldAll EvaluateOwnValuesOnlyAndHold[expr_] := Hold[expr] /. ...

HeldOptional = Function[, HoldPattern@Optional[#1, #2], HoldRest] Remove[CurrentTime] CurrentTime[time_~HeldOptional~DateList[]] := {time, DateList[]}; Pause CurrentTime[] c.f. How to write a ...

This formats Associations in the usual way: ShallowAssociation[x_Association] := RawBoxes@(({s = Shallow@Normal@x}~With~MakeBoxes@s)~ Replace~(RowBox[{"{", val_, "}"}] :> RowBox@{"\...

$r = Association["x" -> ConstantArray[0, {1000, 1000}]]; Shallow@($r /. Association -> Normal@*Association) performs well.

This numerical approach seems to work: Norm2[x_] := x.x; ConvertEquationsToLeastSquares[eqns : {__Equal}] := Norm2@Flatten[eqns //. { Equal[x_, y_, rest___] -> {Subtract[x, y], Equal[y, ...

This works: ClearAll[DontEvaluateInOptional]; DontEvaluateInOptional~SetAttributes~HoldAllComplete; DontEvaluateInOptional /: (h: Except[Optional])[l___, HoldPattern@DontEvaluateInOptional[b___], ...

Looks like this is a problem with the Suggestions Bar https://mathematica.stackexchange.com/a/75284/6804 When I disable it, I get the same context path consistently. This is version 10.2. The ...

I think the following also fits the present discussion. Who shadows whom? When you run (*cleanup*) $Context = "Global"; Quiet@Remove["temp*", "Global*"]; (*--*) Globalx = "global"; BeginPackage[... View answer 1 votes Consider using strings: BeginPackage["foo"]; Unprotect @@ Names["foo*"]; ClearAll @@ Names["foo*"]; f::usage = "sol=f[x,plist]"; Begin["Private"]; f[x_, plist_] := With[{y = Lookup[plist, "y"]... View answer 1 votes I think every line or statement that you enter into the frontend is parsed separately, so, when you use a CompoundStatement there is only one parsing process, while there is one for each line when you ... View answer 1 votes Instead of relying on WolframAlpha data, you can query the database directly, preferable through the /internal data format, documented here: https://oeis.org/eishelp1.html One such page is: https://... View answer Accepted answer 1 votes This has been filed and officially accepted as an issue: Thank you for contacting Wolfram Technical Support. I was able to reproduce the issue, and consequently, I filed a report with our ... View answer 1 votes All the former ML* functions now start with WS*, mathlink.h is now wstp.h. When you still get linker errors, try dragging and dropping the file "C:\Program Files\Wolfram Research\Mathematica\10.2\... View answer 0 votes Export["file.m", FullForm@HoldComplete[Format[$hello, StandardForm]], "String"] works, but all operators will be eliminated because of FullForm: FullForm@HoldComplete[Format[\$hello, StandardForm]*2] ...

This is not an answer as to why, wolfram-language-design wise, but to how: It seems Block[{x = new}, ...code...] effectively does the following: newValue = new; allValues = ...

A VerificationTest with Outcome Error cannot be fixed by changing the expected-messages argument. This only applies to MessagesFailure Outcome (orange versus yellow cross, a bit hard to distinguish). ...

t = CreateTemporary[]; Save[t, mySymbol]; Import[t, "Text"] applies some basic formatting to the definitions immediately and indirectly associated with mySymbol.

As suggested in a comment, you can use InterpolationOrder -> 1 and then fix the Indeterminate derivative. ClearAll[list, fint, dfint] list = Table[{j, Max[5, j]}, {j, 0, 15, 1}]; ListLinePlot@...

The documentation of FindRoot says FindRoot first localizes the values of all variables, then evaluates f with the variables being symbolic, and then repeatedly evaluates the result numerically....

You could use ListDensityPlot3D for visualization purposes instead. This also has the useful option "OpacityFunction"... IMO, you could also use Image3D and rescale the data only for display purposes....