Skip to content

Instantly share code, notes, and snippets.



Last active Jun 13, 2019
What would you like to do?
package metaobjectTest
Annotation 'extract' is replaced by an Int value corresponding to
its argument, which should be of the form 'int_value' or 'intvalue'.
assert extract(int5) == 5;
assert extract(int_555) == 555;
This annotation is used inside a generic prototype to simulate
the passage of an Int as argument:
var v = MyVector(Int, int_100) new;
MyVector could have been declared as
object MyVector<T, V>
var Array<T> array = Array<T> new: @extract(V);
object Extract
func run {
var v = generic.MyVector<Int, int_100> new;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.