====== Expressions ====== * Introduction * Examples for Expressions ===== Introduction ===== Lets start with the easy thing: a value. What's that? First a value has a type. A value could be an integer number, a floating point number, a character, a color, a text or whatever you like. And a value is something unique, that means that it is comparable to other values of the same type. You can compare 1 with 2 and you see a difference. Maybe they have an order, so you can see that 2 is greater then 1. But at least you can see that 1 is not equal to 2. If you compare 1 with 1 you cannot distinguish which 1 is the better, greater or nicer one. They are equal. It is the same value and it does not matter which 1 you use. An expression is something that evolves to a value. Lets say you want the value of one liter of water. Therefore you can open the water faucet and get one liter with a measuring cup into your pot. But you also can use a 0.2 liter glass and put 0.2 liter of water into your pot for five times. In the first example you take 1 liter in the second example you take 0.2 liter for five times. Here you express how to get one liter of water. But at the end of the day you have the value of 1 liter into your pot and it does not matter how you get it. A value is used as a result or as the unique thing which can be compared and an expression can be evolved to one value. ===== Examples for Expressions ===== Our domain is a programming language, so we're in computer science. Instead of handling with measure cups we are handling our problems with mathematical operations. 17 + 4 18 - 10 21 * 3 10 / 4 Every operator returns a value. With Genesys everything is an operation, so everything results in a value of the corresponding data type. ===== Datatypes ===== The datatype in our water measuring example is "water". You put water into a measure cup and add it to other water. The result of this operation is even more water. The value is greater than before but the type of measured thing is still "water". With Genesys you can define your very own data types. But there are also several build-in data types, called "primitives", corresponding to your computer system: byte, short, int and long for integer data, float and double for floating point data. Additionally Genesys offers you build-in datatypes for string processing. Further data types are defined in the standard libary.