One icon indicating copy to clipboard operation
One copied to clipboard

🩱 THE `One` syntax: Idea, Improve 1️⃣

Open BaseMax opened this issue 4 years ago • 8 comments

Hi there; Welcome here. please share what you think and all of your idea.

BaseMax avatar Jun 14 '21 20:06 BaseMax

// not required - default: package main

fn test {
    _ 1
    _ 2, 4, 6, 8
    _ 5+8
    _ (2 + 15 * ( 25 - 13 ) / 1 - 4) + 10 / 2
}

fn main {
    _ 1
    _ 110
    _ 123
}

BaseMax avatar Jun 14 '21 20:06 BaseMax

i32 main {
   ret 10
}

BaseMax avatar Jun 14 '21 20:06 BaseMax

test {

}
main {
   test()
}

BaseMax avatar Jun 14 '21 20:06 BaseMax

type struct my {
  i32 a
  i32 b
}

main {
   my a
   a.a = 10
   a.b = 20
}

BaseMax avatar Jun 14 '21 20:06 BaseMax

type enum my {
  MY_A
  MY_B
  MY_C
}

main {
   my a = MY_A
   _ a
}

BaseMax avatar Jun 14 '21 20:06 BaseMax

type Point {
   i64 x
   i64 y
}

Point Point+(Point left, Point right) {
   Point p
   p.x = left.x + right.x
   p.y = left.y + right.y
   ret p
}

i32 main {
   Point p
   p.x = 50
   p.y = 80

   p = p+p

   __ p.x
   __ p.y

   return 1 // 1 = okay, default
}

BaseMax avatar Jun 14 '21 20:06 BaseMax

a image from Amir (Go Language):

photo_2021-06-15_19-30-28

BaseMax avatar Jun 15 '21 15:06 BaseMax

a image from Amir (Dart language):

photo_2021-06-15_19-31-02

BaseMax avatar Jun 15 '21 15:06 BaseMax