Principles of Wolfram Language
Principle of Wolfram Language Syntax
- Everything is a Expression.
- Expression is either an atom, or a list of atoms in the form
e0[e1, e2 etc], arbitrarily nested.
- Atom is a number e.g.
3.4, a Symbol
"cat", or special character e.g.
- There are many short syntax for function or function call. e.g.
List[1,2,3]can be written as
Set[x,2]can be written as
Plus[1,2]can be written as
1+2. WolframEngine transform any short syntax to the fully nested form
e0[e1, e2 etc]internally before computation. [see WolframLang Syntax/Operators]
- Builtin symbols start with Capital letter or
- WolframLang code is just a sequence of expressions, practically just function calls. Knowing what function to call is the essence of coding WolframLang. [see WolframLang: List Functions, Find Function]
How Does Wolfram Language Do Computation
There are 2 ways WolframLang does computation.
- Function call. Either builtin or user defined. For example,
If[3 > 2, "yes", "no"]
- Syntactical transformation by pattern matching and replacement. (aka term rewriting system)