Tymless Tutorial: Reference



   
  < system functions

Operators

 
precedence >
 

Drawing

Control

Data

Reference

 

An operator is a keyword which takes an argument before and after, and returns a value. Either argument can be the result of a function or another operator (see operator precedence), e.g.

sin 1.2 + cos 1.5

The sine of 1.2 is added to the cosine of 1.5.

a + b + c

Adds a, b and c.

Argument Types

  n number
  n number or location
s shape or the entire shape list $shapes.
  loc location
  t text
  a any type
aff an affine transformation object

Operation Result
n1 + n2 n1 plus n2
s + n adds n to s
n1 - n2 n1 minus n2
s - n subtracts n from s
n1 * n2 n1 times n2
s * n mutliplies s by n
n1 / n2 n1 divided by n2
s / m divides s by n
n1 min n2 the larger of the two
n1 max n2 the smaller of the two
n1 ** n2 n1 to the power of n2
s ** n raises s to the power n
n1 log n2 the logarithm of n1, base n2
n1 mod n2 n1 mod n2
n1 by n2 the location (n1, n2)
a1 eq a2 1 if a1 equals a2, otherwise 0
a1 ne a2 0 if a1 equals a2, otherwise 1
n1 gt n2 1 if a1 is greater than a2, otherwise 0
n1 ge n2 1 if a1 is greater than or equal to a2, otherwise 0
n1 lt n2 1 if a1 is less than a2, otherwise 0
n1 le n2 1 if a1 is less than or equal to a2, otherwise 0
n1 and n2 1 if a1 and a2 are both non-zero, otherwise 0
n1 or n2 1 if a1 or a2 is non-zero, otherwise 0
n transform aff the location given by the affine transformation aff upon n
s transform aff transforms s using aff
t strleft n the first n characters of t
t strright n the last n characters of t
n rotate loc the location created by rotating n through $> radians about loc
s rotate loc rotates s through $> radians about loc
n1 rotate n2 the location created by rotating n1 through n2 radians about $here
s rotate n rotates s through nradians about $here
n1 rotate (loc, n2) the location created by rotating n1 through n2 radians about loc
s rotate (loc, n) rotates s through n radians about loc
n invert n the location created by inverting n through a circle of radius n centred at $here
s invert n inverts s through a circle of radius n centred at $here
   
  < system functions
 
precedence >