Skip to content

Basics

Comments

$ wo '(* This comment is ignored *) 5'
5
$ wo '5 (* This comment is ignored *)'
5
$ wo '(**)'
Null
$ wo '(* only a comment *)'
Null

Semicolon

$ wo 'x = 2; x'
2
$ wo 'x = 2; x = x + 5'
7

A trailing semicolon evaluates but returns Null:

$ wo '1 + 2;'
Null
$ wo '{1,2,3} // Map[Print];'
1
2
3
Null

Set

Assign a value to a variable.

$ wo 'Set[x, 5]'
5
$ wo 'Set[x, 5]; x + 3'
8

Print

Print values to the console.

$ wo 'Print[]'

Null
$ wo 'Print[5]'
5
Null

Multiple arguments are concatenated:

$ wo 'Print["a", "b", "c"]'
abc
Null
$ wo 'Print[1, " + ", 2, " = ", 3]'
1 + 2 = 3
Null

Constants

Woxi ships with the most common mathematical constants and atomic symbols from the Wolfram Language. Each constant is a symbolic value that stays exact until you ask for a numeric approximation with N.

Pi

The ratio of a circle's circumference to its diameter.

$ wo 'Pi'
Pi
$ wo 'N[Pi]'
3.141592653589793
$ wo 'Sin[Pi]'
0

E

Euler's number, the base of the natural logarithm.

$ wo 'E'
E
$ wo 'N[E]'
2.718281828459045

Degree

The angle unit Pi/180, used to convert from degrees to radians.

$ wo 'Degree'
Degree
$ wo 'N[Degree]'
0.017453292519943295

GoldenRatio

The golden ratio, (1 + Sqrt[5])/2.

$ wo 'GoldenRatio'
GoldenRatio
$ wo 'N[GoldenRatio]'
1.618033988749895

Catalan

Catalan's constant, Sum[(-1)^k/(2k+1)^2, {k, 0, Infinity}].

$ wo 'Catalan'
Catalan
$ wo 'N[Catalan]'
0.915965594177219

EulerGamma

The Euler–Mascheroni constant.

$ wo 'EulerGamma'
EulerGamma
$ wo 'N[EulerGamma]'
0.5772156649015329

Glaisher

The Glaisher–Kinkelin constant.

$ wo 'N[Glaisher]'
1.2824271291006226

Khinchin

Khinchin's constant, the limit of the geometric mean of the continued-fraction coefficients of almost every real number.

$ wo 'N[Khinchin]'
2.6854520010653062

Infinity

Represents a positive unbounded quantity. Arithmetic with Infinity follows the usual conventions.

$ wo 'Infinity'
Infinity
$ wo 'Pi > 3'
True

ComplexInfinity

A direction-less unbounded quantity, returned for example by 1/0.

$ wo 'ComplexInfinity'
ComplexInfinity

Indeterminate

Represents an expression with no well-defined value, such as 0/0.

$ wo 'Indeterminate'
Indeterminate

I

The imaginary unit, satisfying I^2 == -1.

$ wo 'I'
I
$ wo 'I^2'
-1
$ wo 'I^3'
-I

Boolean Atoms

True and False

The two Boolean literals.

$ wo 'True'
True
$ wo 'False'
False

Null

The empty / absent value. Expressions terminated by ; evaluate to Null.

$ wo 'Null'
Null