------ DoNaLD (Definitive Notation for Line Drawing) QUICK REFERENCE ------

...this document isn't really finished either...


-- SYNTAX -----------------------------------------------------------------

No semi-colons: line feeds are terminators
Line continuation: use \ at the end of a line to continue to the next

# UNIX shell style one-line comments

Variables must be declared before use (except when using the ! operator)
Redeclaration of type is not possible

Name space: append ! to an identifier to reference an Eden variable: eg
  eq!(a, b).

Escaping to Eden: ? is a one-line escape to Eden.


-- DATA TYPES -------------------------------------------------------------

int: 34
real: 10.0
char: "abc"
boolean: true, false
point: {50, 100}, {modulo @ angle}
line: [{10, 10}, {80, 90}]
circle: circle(centre, radius), circle({500, 500}, 400)
ellipse: ellipse(centre, major, minor)
image: I!ImageFile("gif", "hill.gif")
label: label L1
       L1 = label("abc", {100, 100})
openshape: openshape cross
           within cross {
            line l1, l2
            l1 = [{10, -10}, {-10, 10}]
            l2 = [{10, 10}, {-10, -10}]
           }
shape: shape S
       S = trans(cross, 100, 200)
graph: (see other documentation)


-- FUNCTIONS --------------------------------------------------------------

Arithmetic: + - * div mod sqrt log exp trunc float rand
Trigonometric: sin cos tan asin acos atan
Relational: && || ! < <= == > >=

Geometric:
point midpoint(line)
point intersect(line, line)
line perpend(point, line)
real dist(point, point)
bool intersects(line, line)
bool separates(line, point, point)
bool includes(circle, point)
bool incident(line, point)
bool incident(circle, point)
bool pt_betwn_pts(point, point, point)
bool colinear(point, point, point)
bool distlarger(point, point, value)
bool distlarger(line, point, value)
bool distsmaller(point, point, value)
bool distsmaller(line, point, value)

Shape transformations:
trans(shape, x, y)
scale(shape, ratio)
rot(shape, point, angle)

String functions:
// (string concatenation)
itos(int)
rtos(real, fprintf-format-string)

Image functions:
I!functionName denotes a function returning an image


-- REFERENCES -------------------------------------------------------------

.1, .2: first and second points of a line or first and second coordinates
        of a point

.x, .y: projection of a point onto the x- and y- axes


-- ATTRIBUTES -------------------------------------------------------------

To give an attribute to the DoNaLD variable Obj/line1:
?A_Obj_line1 = "attribute1=value1,attribute2=value2..."

color
linewidth
linestyle: dotted, dashed or solid
arrow: first, last, both or none
locus: true, false
fill: solid or hollow


-- VIEWPORTS --------------------------------------------------------------

viewport VIEW1

The default viewport is DoNaLD.


-- MORE INFORMATION ----------------------------------------------------------

See http://www.dcs.warwick.ac.uk/modelling/ for more detail.
