vein-lang / vein

🔮⚡️Vein is an open source high-level strictly-typed programming language with a standalone OS, arm and quantum computing support.
https://vein-lang.org
Other
52 stars 6 forks source link

Syntax conditional for statement #24

Open 0xF6 opened 3 years ago

0xF6 commented 3 years ago

Syntax

public foo(obj: FooObject): void
{
   for (auto i = 0; i != 10; i++) when obj != null
       obj.Action(i);
}

Ishtar view (transformation result)

public foo(obj: FooObject): void
{
   if (obj != null)
   {
       for (auto i = 0; i != 10; i++) when 
           obj.Action(i);
    }
}