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

Used-defined aspects #17

Closed 0xF6 closed 2 years ago

0xF6 commented 3 years ago

define custom aspect

public aspect customAspect(arg1: String, arg2: String);

[customAspect("foo", "bar")]
public fn(): void {}

std api for reflection of custom aspect

[customAspect("foo", "bar")]
public FooMethod(): void 
{
    auto aspect = getType(this)
              .getMethod(nameof(FooMethod))
              .getAspects()
              .first()
              .as<customAspect>();

    Out.println(aspect.arg1); // "foo"
    Out.println(aspect.arg2); // "bar"
}

Ishtar view (transformation result)


[aspect]
public class customAspect: vein/lang/Aspect
{
    public new(arg1: String, arg2: String): this
    { 
        // ...
    }
}
urumo commented 3 years ago

Hi, we need this feature ASAP, can you please prioritize it?

0xF6 commented 3 years ago

Hi, we need this feature ASAP, can you please prioritize it?

no :) there are more important tasks~

0xF6 commented 2 years ago

Hi, we need this feature ASAP, can you please prioritize it?

@urumo That is resolved, try use :)

urumo commented 2 years ago

@0xF6 thanks for notifying, but too much time has passed since we began to feel the need in this feature, so we decided to rewrite our software using golang