sic

The sic programming language, compiler and tools (WIP)
Log | Files | Refs

language.sic (734B)


      1 int ~age = 25
      2 dec height = 87.5
      3 str name = "George"
      4 
      5 int main {
      6 		str name = arg[0]
      7 	  print(name)
      8 		return 0
      9 }
     10 
     11 def Human {
     12 		str name
     13 		dec height
     14 		int age
     15 }
     16 
     17 opt<Human> test = none
     18 opt<Human> jockey = get_jockey()
     19 
     20 match jockey {
     21 	some(x) => print(x.name);
     22 	none => print("no jockey");
     23 }
     24 
     25 for int i in [0:100] {
     26 
     27 }
     28 
     29 some<T> my_func() {
     30 	some
     31 }
     32 
     33 str[] names = ["James", "Jake", "Janice"]
     34 
     35 for (str n in names) {
     36 		print(n)
     37 }
     38 
     39 for names as n {
     40 		print(n)
     41 }
     42 
     43 bool adult = age > 18
     44 
     45 return "Henry" if adult is Human else "Dog" if adult is Dog else "Animal"
     46 
     47 if adult is Human {
     48     return "Henry"
     49 } else {
     50 		return "Dog"
     51 }
     52 
     53 return adult is Human ? "Henry" : "Dog"
     54 
     55 float x = 12.5
     56 int y = 12
     57 
     58 if cast(int, x) == y {
     59 		print("yay")
     60 }
     61 
     62