Numbers

Type 1; into the Hope interpreter like this:
>: 1;
The Hope system responds with
>> 1 : num
This tells us the result of evaluating the expression 1 is 1 and the type of the expression is num. i.e. a number (usually called an integer).

Now try the following

>: 1+1;
>: 1+2*10;
>: (1+2)*10;

The replies given by Hope are:
>> 2 : num
>> 21 : num
>> 30 : num
So every expression is evaluated and the type of each expression is given.



Subsections

s.danicic@gold.ac.uk
Sebastian Danicic BSc MSc PhD (Reader in Computer Science)
Dept of Computing, Goldsmiths, University of London, London SE14 6NW
Last updated 2010-12-29