Questions tagged [language-design]

for questions about the design of the Mathematica language itself

Filter by
Sorted by
Tagged with
18
votes
2answers
243 views

Is mathematica adequately improving?

A bit of a loaded question, but in your opinion is Wolfram's team making good progress on improving their software? I've used Mathematica for almost 10 years now, and honestly I'm personally ...
19
votes
1answer
162 views

Why does OperatorApplied by default reverse the arguments?

Perhaps this is just one of those Mathematica curiosities, but I'd like to know why by default OperatorApplied[f][x][y] === f[y,x] versus the more usual way one ...
15
votes
2answers
4k views

Why does Mathematica order polynomial forms in reverse from traditional order?

I could very well be missing something obvious, but this has always bugged me with Mathematica and I don't know why it does it or how to fix it. If I enter any polynomial, say, x^2 + x - 1 for ...
16
votes
2answers
1k views

Why it seems that there is no counterpart function as to multiplication, to `Total` as to addition?

Times and Plus have the same grammar, and so do Product and ...
3
votes
0answers
52 views

what are the principles of good design with Wolfram Language a la Zen of Python? [closed]

The Zen of Python — is a list of 19 general truths for Python design principles. ( https://medium.com/@Pythonidaer/a-brief-analysis-of-the-zen-of-python-2bfd3b76edbf )
26
votes
2answers
527 views

Version inconsistency with optional arguments: what if the default value doesn't match the pattern?

I just came across some weird behaviour. Take this function definition: ClearAll[f] f[vs_List : All] := "match" The default value of ...
1
vote
0answers
56 views

Should SubsetMap be called CombineAt?

I'm a big fan of the functionality introduced by SubsetMap but am puzzled as to why it was not called "CombineAt". There are ...
5
votes
1answer
67 views

Missing[“reason”]—can any reason be used?

Can any string be used as a "reason"? Or is there a specific list of acceptable reasons? For instance, Missing["refuse"] works as a missing? Is there any ...
21
votes
1answer
277 views

Series vs Asymptotic in 12.1

The functionality of Series and Asymptotic (new in V12.1) is very similar. In fact, they are both listed in the Asymptotics ...
12
votes
2answers
238 views

ToExpression and ToBoxes aren't inverses of each other?

Applying ToExpression and ToBoxes repeatedly to Hold[1/1] gives many ...
19
votes
2answers
345 views

Unexpected behaviour when pattern matching with Longest

I came across some unexpected behaviour today when using the Longest function when trying to do some pattern matching. ...
4
votes
0answers
75 views

Obtain complete list of built-in graphical objects, and split them into groups?

I would like to obtain the complete listing of built-in graphical objects (which can be used in Graphics or Graphics3D) ...
6
votes
1answer
162 views

when two associations are equal?

<|a -> 2, b -> 3|> == <|b -> 3, a -> 2|> returns False; can anybody explain why? If I am not mistaken ...
7
votes
1answer
653 views

Set PlotTheme globally?

Can one set a default PlotTheme globally? While I recognize one can make lots of workarounds to sort of do this: Go to ...
9
votes
1answer
438 views

Why is Reap result nested? [closed]

A minimal (toy) example for my question: i= 1; Reap[Do[Sow[i = (i + 1)^2], {4}]] (* {Null, {{4, 25, 676, 458329}}} *) I presume the entire result is a ...
3
votes
1answer
76 views

Understanding how List head works

I am trying to understand how Wolfram Language is actually meant to work and here is something that I fail to understand. Apply[f, expr] replaces the head of expr by f. So how come I get different ...
13
votes
1answer
251 views

Code indenting of // postfix functions

Preamble Following the recommendation of a presentation or article which I now only vaguely remember I have been experimenting with a particular code format: ...
18
votes
1answer
477 views

What are the benefits of Entity Classes for Databases?

To me, using the older database functionality is much simpler: ...
1
vote
1answer
78 views

Variable substitution like usual maths

So... I'm trying to get some simplifications on equations using own defined variables, but the tries I gave didn't result on what I wanted. The problem: I have 2 variables defined as: ...
6
votes
3answers
484 views

Is $2x$ documented?

According to the official documentation of Times[], multiplication of $x$ and $y$ is represented as one of x*y x×y ...
10
votes
3answers
203 views

Lists for built-in functions that can work without brackets

I just noticed that Exit and Quit can work without brackets i.e. a single Exit or ...
6
votes
2answers
145 views

Separation of statements vs “space mul”, formal definition of Mathematica syntax?

In Mathematica, space can often be used to indicate multiply. For example "a b" = "a * b". On the other hand, in a *.m file, we also have multiple statements separated by newlines. How does the ...
8
votes
0answers
135 views

Relation between the syntactic and evaluated Association

This question is inspired by this answer and related to unsolved post "Association's Attributes change between 10.3.1 & 10.4"...
3
votes
3answers
112 views

Why Graph does not recognize chains of vertexes like NetGraph

Cross posted on Wolfram Community. Perfect logic: NetGraph[{1, 1, 1}, {1 -> 2 -> 3}] But this does not make sense: ...
27
votes
2answers
2k views

Why did the Mathematica Language choose term rewriting instead of the Lambda Calculus as its basis?

Now we can see that Church was associated with the Simply Typed Lambda Calculus. Indeed, it seems he explained the Simply Typed Lambda Calculus in order to reduce misunderstanding about the Lambda ...
1
vote
0answers
74 views

Is there packages can help read, analyze or understand MMA codes? [closed]

Sometimes, I think that it's difficult to learn high level codes, or even when looking back on some long lines of codes I myself had written, espectially when lots of pure-functions was used, so I'm ...
45
votes
1answer
968 views

Is FullGraphics an abandoned function? Is there an alternative?

FullGraphics hasn't worked entirely for a long time and the situation appears to be getting worse instead of better. In Mathematica 10.0, 10.1 up to 11.3 a simple ...
8
votes
0answers
102 views

What is the philosophy behind \[Rule] (a.k.a. `->`) for assigning options?

Today I was banging my head against my desk when I realized that the problem I was experiencing was due to having typed ImageSize[Large] instead of ...
5
votes
1answer
86 views

Making an Association-like interface for HashTable

System`Utilities`HashTable is conceptually a lot like an Association but it has the pretty phenomenal (for Mathematica) property ...
19
votes
1answer
529 views

Are there advantages to using additional arguments of common functions rather than alternative ways of calculating with lists?

(Apologies for the long question title.) One of the interesting, if sometimes confusing, things about Mathematica is that there is always more than one way to do things. Even intermediate users can ...
9
votes
1answer
280 views

DiracDelta attributes

Is there any reason why DiracDelta isn't a NumericFunction but DiracComb is? I just ate a ...
20
votes
2answers
444 views

Second argument of BeginPackage with nested package loading

I naively thought that the second argument of BeginPackage can simply be used to ensure the loading and availability in the ...
2
votes
1answer
134 views

DeleteCases not working as expected

I am trying to reproduce the example of Data Cleaning from here. I had to make a slight change in input 13 to ...
6
votes
1answer
87 views

Counterintuitive DownValue precedence

Consider the following definitions for two symbols: foo[a] /; True := b foo[a] := a foo[a] (* a *) foo2[a_] /; True := b foo2[a_] := a foo2[a] (* b *) (The ...
20
votes
1answer
370 views

Why are some option values symbols, other strings?

Is there a rationale, beyond historical accident, why some Mathematica option values are strings, while others are symbols? It seems natural that some value spaces, e.g. named color schemes, are so ...
11
votes
2answers
2k views

Why did Mathematica choose brackets for function arguments over parentheses?

This is a non-technical question. I'm just curious why Mathematica breaks the convention that parentheses are widely used for function arguments. What's the advantage of ...
20
votes
4answers
980 views

Is expression in Mathematica well defined?

According to Mathematica, everything is an expression. So an atom is also an expression. But in other parts of documentation, they say that an expression is of form ...
82
votes
4answers
39k views

Why round to even integers?

According to the Mathematica help: Round rounds numbers of the form x.5 toward the nearest even integer. For example: Round[{0.5, 1.5, 2.5, 3.5, 4.5}] gives ...
2
votes
0answers
90 views

Areasinus hyperbolicus [closed]

Why is there a function ArcSinh[]? Shouldn't this be called ArSinh, since it is connected with an area and not with the length (...
7
votes
1answer
157 views

What is the logiс behind handling alpha-channel by various image-processing functions?

(Cross-posted on Wolfram Community.) When working on the answer to this question I discovered that starting from Mathematica 10.0 the behavior of such functions as ...
7
votes
1answer
97 views

A bug and inconsistency in current image arithmetic operations?

Let us start from a single-pixel RGBA image: i = Image[{{{0., .4, .7, .8}}}, Real, ColorSpace -> "RGB"]; Multiplying by .5 ...
9
votes
0answers
96 views

List assigment ({…}={…}) and UpValues

Let's say I want to track any assignment attempt for a variable a: a /: Set[a, x_] := Print@{a, x} This works as intended: <...
11
votes
2answers
504 views

Why is IdentityMatrix not defined as a SparseArray by default?

Simple (possibly silly) question: why are IdentityMatrix, DiagonalMatrix, ConstantArray ...
24
votes
2answers
561 views

Why doesn't a Composition[] hold its arguments and what can be done about it?

Now that Composition (also RightComposition) has shorthand syntax I am more inclined to use it, however what I feel should be ...
4
votes
0answers
72 views

Why is SparseArray atomic?

This answer tells us that functions like ReplaceAll do not straightforwardly work for the entries of sparse arrays because a ...
3
votes
2answers
338 views

Module inside Module. Conflict of names in arguments

I have a module which calls number of other smaller helper modules. But those other helper modules are not used by another module, so there is no needed to have them in global context. So I wanted to ...
1
vote
2answers
124 views

Why can we assign a value to a function that has not been defined yet?

Consider the following snippet, fib[1] = fib[2] = 1; fib[n_Integer] := fib[n - 1] + fib[n - 2] As a newbie, it seems for me, the first line assigns 1 to ...
16
votes
3answers
336 views

Why is the first argument of the SetDelayed evaluated?

In[1]: f=g; In[2]: SetDelayed[f[x_],x^2]; In[3]: ?f Global`f f=g In[4]: ?g Global`g g[x_]:=x^2 However, SetDelayed has the ...
6
votes
2answers
217 views

WL terminology: evaluate, call, invoke, use, etc

A WL (Mma) program is a sequence of expressions to be evaluated, which generally involves applying commands and functions to actual arguments. What is the accepted terminology for what I think of as ...
3
votes
1answer
130 views

Single argument operator form?

I've heard the explanation that functions like StringDrop[] are varargs and so that is why they do not have an operator form. But when you are only using the ...