Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Basics

Comments

$ wo '(* This comment is ignored *) 5'
5
$ wo '5 (* This comment is ignored *)'
5

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