# Variables & Types | EasyNet Docs Source: https://easynet.run/docs/aal/types # Variables & Types Give inputs and results explicit types. Assignment creates a local variable and infers its type from the expression. Explicit public parameter and return types let both compiler and kernel validate data. ## Complete example Save the example as types.aal types.aal ``` agent Tutorial is Agent public ability run(name: String?, count: Int) -> String effects() next = count + 1 label = if name == None then "Guest" else name return "{label}: {next}" ``` [Download .aal](data:text/plain;charset=utf-8,agent%20Tutorial%20is%20Agent%0A%20%20public%0A%20%20%20%20ability%20run(name%3A%20String%3F%2C%20count%3A%20Int)%20-%3E%20String%20effects()%0A%20%20%20%20%20%20next%20%3D%20count%20%2B%201%0A%20%20%20%20%20%20label%20%3D%20if%20name%20%3D%3D%20None%20then%20%22Guest%22%20else%20name%0A%20%20%20%20%20%20return%20%22%7Blabel%7D%3A%20%7Bnext%7D%22%0A) ## Syntax explained Basic types include String, Int, Float and Bool. Int is arbitrary precision; Float is finite 64-bit floating point. String? permits a String or None. Check for None before using the value. You cannot freely reassign an integer variable to a string. An omitted annotation introduces Any, not a static type guarantee. ## Build and run Terminal ``` cargo run --locked --bin aalc -- check types.aal cargo run --locked --bin aalc -- build types.aal -o types.aalc cargo run --locked --bin aalc -- run types.aalc \ --agent Tutorial --ability run \ --args '{"name":null,"count":2}' \ --state-dir .aal-tutorial/types --invocation types-1 ``` Run with a fresh state directory. The returned value is shown below; the CLI also prints execution information. Expected result ``` "Guest: 3" ``` ## Try it yourself Set name to Ada and count to 9. Run with a new invocation ID; the result should be Ada: 10. [Language source and specification](https://github.com/Brain-Cell-Coding/Agent-Assembly-Language/blob/main/docs/language-v0.2.md)