Wolfram: Principles
Principle of Wolfram Language Syntax
- Everything is a Expression.
- Expression is either an atom, or a list of atoms in the form
a[b, c, etc], arbitrarily nested. - Atom is a number or a Symbol or a string or special character (e.g.
\[Pi]). - There are many short syntax for function or function call. e.g.
List[1,2,3]can be written as{1,2,3}, andSet[x,2]can be written asx=2, andPlus[1,2]can be written as1+2. WolframEngine transform any short syntax to the fully nested forma[b, c, etc]internally before computation. 〔see Wolfram: Syntax Shortcuts and Operators〕
- WolframLang code is just a sequence of expressions, practically just function calls. Knowing what function to call is the essence of coding WolframLang. 〔see Wolfram: Find Function by Name〕
How Does Wolfram Language Do Computation
There are 2 ways WolframLang does computation.
- Function call. Either builtin or user defined. e.g.
Plus[3, 2],Sin[3],Range[5],If[3 > 2, "yes", "no"] - Syntactical transformation by pattern matching and replacement.