Questions tagged [language-design]

for questions about the design of the Mathematica language itself

Filter by
Sorted by
Tagged with
3
votes
3answers
109 views

Orderless storage of tabulated function values

I would like to elaborate on my previous question Function of arguments given in non-fixed order and a relevant related one Best practice of passing a large number of parameters to functions I find ...
3
votes
2answers
337 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 ...
3
votes
1answer
110 views

Span starting from the end

I could not find something similar. Given, e.g. lst = Range[10] (* {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} *) the following gives the reverse of ...
3
votes
1answer
200 views

Refactoring: Why? When? How?

A good Refactoring can transform a kludgy WL code-base into a thing of pristine coherency but how to do so consistently?
3
votes
1answer
129 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 ...
3
votes
1answer
137 views

Why is left NumberPadding always applied in NumberForm?

I would like to display numbers like 9.0001 and 10.0001 in the fixed-width form of xx.xxxx. ...
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 )
3
votes
0answers
127 views

Why is MeshRegion atomic?

I wanted to make some changes inside a MeshRegion today and found that unlike Graphics objects, it can't be done directly ...
3
votes
0answers
60 views

Why was StringRepeat designed so that StringRepeat[s, 0] throws an error?

I'm wondering about the rationale behind the design decision that leads to the following expression throwing an error: ...
3
votes
0answers
376 views

Mixing Wolfram Language & WolframAlpha Queries - How robust is it?

The advent of Mathematica in the cloud and linguistic input potentially transforms expectations of the Wolfram Language's programming model and its inherent robustness. An example of this comes form ...
2
votes
1answer
117 views

Why does `Position` by default return a list of lists of positions instead of a simple list of positions?

Position[{1,2,3,4,2,3,4,5},2] (* Output: {{2},{5}} *) Why does Position work this way? I understand this form might be ...
2
votes
2answers
108 views

Sets of identical equality/inequalities

So I've used Mathematica for some months, but I never noticed this sort of thing about it, namely: (a > b) == (b < a) which are supposed to be identical ...
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 ...
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 (...
2
votes
0answers
66 views

Why does Mathematica round numbers in this way where the fractional part is 0.5? [duplicate]

I was trying to comment on sequence https://oeis.org/A047229 in the OEIS, when one of the editors pointed out that the rounding is done wrong in this Mathematica one-liner: ...
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 ...
1
vote
2answers
174 views

inappropriate domain restriction on FromPolarCoordinates?

The only way I can understand the domain restriction on FromPolarCoordinates is as ensuring a round-trip is possible: ...
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: ...
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 ...
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 ...
1
vote
0answers
90 views

What's in a Name? [closed]

StringReplacePart["StringReplacePart","At",{14,17}] ... Surely you can't be serious? ... Naming Matters: I think what and how we call things is ...
0
votes
2answers
53 views

How to make Mathematica to assemble components we already have like a regular input

Suppose we have the following list: {5, 3} I want to add the -> to the end of the first element in the list in Mathematica ...

1 2
3