Compiling and running first program!
This commit is contained in:
38
globals.kl
38
globals.kl
@@ -1,58 +1,58 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Function types
|
||||
//-----------------------------------------------------------------------------
|
||||
test_function :: (thing: Int): *Int
|
||||
test_function :: (thing: int): *int
|
||||
function_type: test_function
|
||||
const_function_alias :: test_function
|
||||
// null_function: (t: Int): *Int = null
|
||||
// null_function: (t: int): *int = null
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Booleans
|
||||
//-----------------------------------------------------------------------------
|
||||
Boolean: Bool = true
|
||||
value_of_Bool: Int = cast(Boolean: Int)
|
||||
value_of_Bool: int = cast(Boolean: int)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Nulls
|
||||
//-----------------------------------------------------------------------------
|
||||
// Int_null: Int = null
|
||||
// int_null: int = null
|
||||
// str_null: String = null
|
||||
// Bool_null: Bool = null
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Compound expressions
|
||||
//-----------------------------------------------------------------------------
|
||||
array1: [4]Int = [4]Int(1,2,3,4)
|
||||
array2 := [32]Int(1,2,3,4)
|
||||
array3 := [32]Int(
|
||||
array1: [4]int = [4]int(1,2,3,4)
|
||||
array2 := [32]int(1,2,3,4)
|
||||
array3 := [32]int(
|
||||
[0] = 0,
|
||||
[1] = 1,
|
||||
[2] = 2,
|
||||
[31] = 31,
|
||||
)
|
||||
array_item := array1[0]
|
||||
array_item_imp: Int = array2[2]
|
||||
array_item_imp: int = array2[2]
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PoInters
|
||||
// Pointers
|
||||
//-----------------------------------------------------------------------------
|
||||
poInter_decl : *Int
|
||||
variable_from_deref: Int = *poInter_decl
|
||||
poInter_from_var : *Int = &variable_from_deref
|
||||
Boolean_poInter := &Boolean
|
||||
pointer_decl : *int
|
||||
variable_from_deref: int = *pointer_decl
|
||||
pointer_from_var : *int = &variable_from_deref
|
||||
Boolean_pointer := &Boolean
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Implicit type
|
||||
//-----------------------------------------------------------------------------
|
||||
implicit_Int :: 10
|
||||
implicit_int :: 10
|
||||
implicit_str :: "Hello world"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PoInters
|
||||
// Pointers
|
||||
//-----------------------------------------------------------------------------
|
||||
// poInter1: *Int = 0
|
||||
// poInter2: *Int = poInter1
|
||||
// poInter3: **Int = 0
|
||||
// pointer1: *int = 0
|
||||
// pointer2: *int = pointer1
|
||||
// pointer3: **int = 0
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// String types
|
||||
@@ -61,7 +61,7 @@ string1 :: "Test"
|
||||
string2 :: string1
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constant Int variables
|
||||
// Constant int variables
|
||||
//-----------------------------------------------------------------------------
|
||||
thing0 :: 10
|
||||
thing1 :: thing0 + 11
|
||||
|
||||
Reference in New Issue
Block a user