0
$\begingroup$

How does the official implement a list/tuple of parameters that can be different in type and quantity as a whole?

After re-read @Szabolcs's and @MichaelE2's comments.
Finally, I accepted the suggestion in @Kuba's comment ("tutorial/evaluation") as the "answer" according to @Shredderroy's comment:

the tutorial/evaluation suggestion by @Kuba is the best explanation that the general public can provide since Mathematica is a proprietary system.


Details of the original question:

In particular, RegularPolygon and Plot3D – these two symbols make me most curious:

The lists of parameters accepted by RegularPolygon can be any of the following (can be found at the beginning of the official document):

RegularPolygon[{r, θ}, n]
RegularPolygon[{x, y}, rspec, n]

The lists of parameters of Plot3D can be any of the following:

Plot3D[{…, w[f_i], …}, …]
Plot3D[…, {x, y}∈reg]

Although using any programming language can achieve automatic matching of parameters by defining properties/rules/traits or by pattern matching, I still want to know what the specific implementation of these are by the official.

I am very grateful to you!

$\endgroup$
  • 1
    $\begingroup$ Is this what you mean? foo[x_Integer]:=1; foo[x_String]:=2] $\endgroup$ – Kuba Jul 29 '19 at 10:32
  • 1
    $\begingroup$ Performing 'evaluation', see tutorial/Evaluation. $\endgroup$ – Kuba Jul 29 '19 at 10:43
  • 1
    $\begingroup$ The long comment thread illustrates well why this was not a clearly written question (BTW the title is still not decoupled)... $\endgroup$ – Szabolcs Jul 29 '19 at 11:31
  • 2
    $\begingroup$ Interesting. The question was clear to me the moment I read the title. I think the tutorial/evaluation suggestion by @Kuba is the best explanation that the general public can provide since Mathematica is a proprietary system. Based on the description provided in the documentation there, it would not be too hard to suggest reasonable algorithms for implementing the ideas. But as to an authoritative account of the actual algorithms used by the Wolfram engineering team, well, that will probably be hard to come by. $\endgroup$ – Shredderroy Jul 29 '19 at 12:34
  • 1
    $\begingroup$ Many WL functions are written at top level; i.e. in WL using definitions just like the user would. This is why changing system variables can be dangerous. $\endgroup$ – lirtosiast Jul 29 '19 at 13:23