Menu

Primitive Types

Mark Anthony Taylor (Shyreman)

There are 6 primitive types in Sexy:

(Float32 value) // Creates a 32-bit IEEE floating point number
(Float64 value) // Creates a 64-bit IEEE floating point number
(Int32 value)   // Creates a signed 32-bit integer
(Int64 value)   // Creates a signed 64-bit integer
(Bool value)    // Creates a 32-bit boolean value, which is either true (1) of false (0)
(Pointer value) // Creates a system-dependent pointer value useful in native callback APIs.

All primitive types can be used to specify the input type or output type in a function definition. They
can also be used to specify the field types in a structure or class definition. Local and global
variables can also be of any primitive type.

A local variable is created by using the name of a primitive type or a legal alias from a namespace, and
following it with a name to form an s-expression. Names must begin with a lower case letter a-z and be
followed by a series of alpha numeric characters.

(Int32 i)

Optionally one can initialize the variable after an assignment operator (=) in the definition:

(Int32 year = 2014) // Creates i, j and k variables and initializes them to 0, 1 and 2 respectively.

All uninitialized variables are set to zero. (N.B boolean 0 is false)


Related

Wiki: Content

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.