Skip to main content

Questions tagged [language-design]

for questions about the design of the Mathematica language itself

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

Create auto-completion for Wolfram Entity framework related functions when using with user-defined entity store

I am trying to create autocompletion for my custom entity store, for example in the document of EntityStore ...
Nhan_nht's user avatar
1 vote
0 answers
50 views

Why do rules not default to local scope? [closed]

Consider the following: 80 //. a_?EvenQ -> a/2 a = 3 80 //. a_?EvenQ -> a/2 which outputs: 5 3 3/2 I think I understand ...
Jonah's user avatar
  • 121
1 vote
0 answers
122 views

Why is the dot operator not just matrix multiplication?

It seems to me Mathematica does not have an inbuilt matrix multiplication operator. The dot operator fails as such, as is even noted under "Possible Issues" in its documentation it ...
cbartondock's user avatar
4 votes
0 answers
74 views

Why does `MakeBoxes` have the HoldAllComplete attribute and ignore it rather than HoldAll?

MakeBoxes has the attribute HoldAllComplete. For a normal function, it would imply that Upvalues should not be taken into account when the expression is evaluated: <...
Juan Mauricio Matera's user avatar
7 votes
2 answers
377 views

Why do some functions require its arguments to be in a list while others accept these as a sequence? [closed]

With Midpoint[{{4, -2}, {2, 5}}], the vectors must be in a list. But with EuclideanDistance[{-2, 2}, {3, -6}], they don't. These ...
cybervigilante's user avatar
6 votes
1 answer
201 views

What is the difference between OperatorApplied and CurryApplied?

Reading both OperatorApplied & CurryApplied function documentations seems to indicate that they are essentially the same ...
p._phidot_'s user avatar
2 votes
1 answer
262 views

Separating the Numerator & Denominator

It's been years since I last programmed in Wolfram & for the first few days, I felt like I've been feeling around the dark; now that I've mostly forgotten how to code it. Again, I could be ...
Tempus Nomen's user avatar
4 votes
2 answers
218 views

What should mapping over a number or symbol produce?

I expected it to be an error (i.e., produce an error message), but Map[f,num] is num. Why is this the correct behavior? If it is ...
Alan's user avatar
  • 13.8k
1 vote
2 answers
102 views

Please I need help to define a function of two variables (t,x)!

Let's define the following function: f[t_, x_] = t^2 + t*x*(1 - x) such that $x \in (0,1)$ and `$t \in (0,0.02)$ The problem is when I want to define the following ...
walid fssm's user avatar
4 votes
1 answer
277 views

Differences between minimization functions?

There's more than 20 functions having to do with minimization ...
Adam's user avatar
  • 3,956
2 votes
0 answers
100 views

Why does Plot function have HoldAll attribute?

I had an odd issue where my plot wasn't drawn correctly when I called it via Plot[Join[fs,gs], (*..*)]. However, these two versions worked: ...
Niklas Vest's user avatar
9 votes
0 answers
65 views

Does ArgumentsOptions do anything we couldn't do without it?

ArgumentsOptions was new in version 12.2. I looked at the application on that page, and it makes code very difficult to understand. What if anything does ArgumentsOptions do for us that we couldn't do ...
Ted Ersek's user avatar
  • 7,134
49 votes
6 answers
4k views

How could Wolfram Research increase Wolfram Language adoption?

Introduction Hello, this is a more general question than is typically asked here. However, I chose to post it here because this seems to be the most active community for Wolfram Language / Mathematica ...
Alec Graves's user avatar
  • 1,058
2 votes
0 answers
119 views

Why is ComplexQ not available? [closed]

For names = Names["System`*"]; executing the following returns 200 hits. ...
Syed's user avatar
  • 55.5k
-1 votes
1 answer
502 views

Keywords for the Wolfram Language [closed]

For a programming language, certain keywords are reserved; i.e., these tokens can't be used in any other context while programming in that particular language. Here is a list of C language keywords ...
Syed's user avatar
  • 55.5k
2 votes
1 answer
164 views

How to think about the answer to Rationalize[-11.5, 1]

In the open source Mathematica implementation called Mathics, an issue was raised where Mathics computes Rationalize[-11.5, 1] as -12 rather than Mathematica which ...
rocky's user avatar
  • 245
19 votes
1 answer
461 views

Programming language prototyping in Mathematica

Are you aware of any projects using the Wolfram language resp. Mathematica as an environment to explore the design of programming languages - in particular languages with a focus on mathematics (...
Math Gaudium's user avatar
9 votes
1 answer
428 views

How to write a simple interpreter / DSL with Wolfram Language?

I am specifically trying to write an interpreter for Mathematica predicates to MongoDB aggregation stages, but I wanted to phrase the question a bit more generically because I can see many times one ...
Dan's user avatar
  • 870
1 vote
0 answers
57 views

"Compile-time" patterns

If I define a function like f[x : {_, _Integer}] := (* function body *) then, as I understand it, every time f[expr] is ...
thorimur's user avatar
  • 9,020
1 vote
0 answers
143 views

Intervals v.s. Domains: when to use which and why?

or: How to use Interval correctly? Mathematica provides these constructs for various symbolic deductions tasks. Among those constructs are symbolic number sets ...
Gravifer's user avatar
  • 872
0 votes
1 answer
138 views

Is this a bug in Total?

The output from the last of these lines doesn't make sense to me Total[{}, {1}] Total[{}, {1, 2}] Total[{{1}, {1, 1}}, {2}] Total[{}, {2}] 0 0 {1, 2} 0 The 3 ...
MeMyselfI's user avatar
  • 1,116
23 votes
1 answer
518 views

What's the difference between these 2 associations?

I have 2 associations similar to these simplified ones: ...
Coolwater's user avatar
  • 20.3k
0 votes
0 answers
43 views

The command Total sums the entries of a list, is there a comparable command for the product of entries of a list? [duplicate]

I recently just found out about the command Total that gives the sum of a list. Was wondering whether there's an analogue that gives the product of the entries of a list? I see that there is the ...
Paul B. Slater's user avatar
3 votes
2 answers
458 views

Why are Quantity and Units inconsistent with regular Mathematica behavior?

When I enter this in Wolfram Mathematica V12: 0 Dogs + 5 Cats Mathematica sensibly returns this: 5 Cats BUT, if I using the ...
Francis Bush's user avatar
6 votes
1 answer
145 views

Why Does Subsets[...,{n}] not Output a Packed List, Even Though it Doesn't Unpack?

Assume list is packed. I expect Subsets[] is a structural operation because it depends on the number of elements, not on what ...
Just Some Old Man's user avatar
27 votes
6 answers
993 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 ...
Steven Sagona's user avatar
3 votes
0 answers
67 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 )
sunil joglekar's user avatar
2 votes
0 answers
66 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 ...
Ronald Monson's user avatar
19 votes
1 answer
242 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 ...
Kai's user avatar
  • 2,099
22 votes
1 answer
624 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 ...
imas145's user avatar
  • 998
5 votes
1 answer
80 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 ...
Slepecky Mamut's user avatar
4 votes
0 answers
102 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) ...
Alexey Popkov's user avatar
3 votes
1 answer
83 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 ...
Rene Duchamp's user avatar
  • 1,419
1 vote
1 answer
95 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: ...
bruno henrique's user avatar
6 votes
3 answers
524 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 ...
ynn's user avatar
  • 243
23 votes
1 answer
821 views

What are the benefits of Entity Classes for Databases?

To me, using the older database functionality is much simpler: ...
M.R.'s user avatar
  • 31.5k
6 votes
2 answers
299 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 ...
none's user avatar
  • 61
3 votes
3 answers
157 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: ...
Fortsaint's user avatar
  • 2,060
1 vote
0 answers
89 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 ...
Jerry's user avatar
  • 2,459
7 votes
1 answer
176 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 ...
b3m2a1's user avatar
  • 46.9k
8 votes
0 answers
106 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 ...
Kai's user avatar
  • 2,099
2 votes
1 answer
261 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 ...
Thadeu Freitas Filho's user avatar
44 votes
1 answer
2k views

What's the deal with next generation Wolfram compiler?

Sources: Old Compiler (Rob Knapp Nov2011) Computer Science in Mathematica (Abdul Dakkak Dec2014) Compilation Technology (Tom Wickham-Jones, Abdul Dakkak & Steve Wilson Dec2015) The Wolfram ...
user13892's user avatar
  • 9,443
18 votes
2 answers
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 ...
Αλέξανδρος Ζεγγ's user avatar
6 votes
1 answer
120 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 ...
Lukas Lang's user avatar
  • 34.1k
22 votes
4 answers
1k 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 ...
Bob Ueland's user avatar
  • 1,069
2 votes
0 answers
127 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 (...
pawel_winzig's user avatar
  • 1,577
7 votes
1 answer
178 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 ...
Alexey Popkov's user avatar
7 votes
1 answer
106 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 ...
Alexey Popkov's user avatar
9 votes
0 answers
126 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: <...
Lukas Lang's user avatar
  • 34.1k