VARIABLESSSS
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
depend "io.pla"
|
||||
|
||||
if (1 + 2 == 3) {
|
||||
print("The universe is functional!")
|
||||
print("The universe is functional!");
|
||||
}
|
||||
unless
|
||||
{
|
||||
print("WHAT, HOW")
|
||||
print("WHAT, HOW");
|
||||
}
|
||||
@@ -2,7 +2,7 @@ depend "io.pla"
|
||||
depend "string.pla"
|
||||
|
||||
add = Func(a: Int, b: Int): Int {
|
||||
return a + b
|
||||
return a + b;
|
||||
}
|
||||
|
||||
print(String(add(1, 3)))
|
||||
print(String(add(1, 3)));
|
||||
@@ -1,2 +1,2 @@
|
||||
depend "io.pla"
|
||||
print("Hello, World!")
|
||||
print("Hello, World!");
|
||||
@@ -1,6 +0,0 @@
|
||||
123
|
||||
0.456
|
||||
[]
|
||||
{}
|
||||
(1 + 3 * 2 ^ 4) % 2
|
||||
2 - 1
|
||||
@@ -1 +0,0 @@
|
||||
(5 + 5) * 3 + 2
|
||||
2
tests/test.pla
Normal file
2
tests/test.pla
Normal file
@@ -0,0 +1,2 @@
|
||||
a: Float = 1.23;
|
||||
b: Int = 456;
|
||||
@@ -14,6 +14,6 @@ struct Person {
|
||||
|
||||
speak = Func(sentence: String): Nil {
|
||||
print(sentence)
|
||||
}
|
||||
}
|
||||
|
||||
max: Person = {"Max", 17, }
|
||||
max: Person = {"Max", 17, speak, Gender.male};
|
||||
@@ -1,16 +1,16 @@
|
||||
depend "string.pla"
|
||||
depend "io.h"
|
||||
|
||||
myInt: Int = 123
|
||||
myDecimal: Float = 0.456
|
||||
myBoolean: Bool = true
|
||||
myString: String = "Hello!\n"
|
||||
myList: List = [1, "hi", true, [1, 2, 3], 0.789]
|
||||
myInt: Int = 123;
|
||||
myDecimal: Float = 0.456;
|
||||
myBoolean: Bool = true;
|
||||
myString: String = "Hello!\n";
|
||||
myList: List = [1, "hi", true, [1, 2, 3], 0.789];
|
||||
|
||||
MY_CONSTANT: Const(String) = "foo bar"
|
||||
MY_CONSTANT: Const(String) = "foo bar";
|
||||
|
||||
print(String(myInt))
|
||||
print(String(myDecimal))
|
||||
print(String(myBoolean))
|
||||
print(myString)
|
||||
print(String(myList))
|
||||
print(String(myInt));
|
||||
print(String(myDecimal));
|
||||
print(String(myBoolean));
|
||||
print(myString);
|
||||
print(String(myList));
|
||||
Reference in New Issue
Block a user