Last active
June 13, 2019 22:31
-
-
Save joseoliv/e14272fb6ec0a5a5d2bc5d23fa75b73f to your computer and use it in GitHub Desktop.
extract
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
@doc{* | |
Annotation 'extract' is replaced by an Int value corresponding to | |
its argument, which should be of the form 'int_value' or 'intvalue'. | |
Example: | |
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); | |
... | |
end | |
*} | |
object Extract | |
func run { | |
var v = generic.MyVector<Int, int_100> new; | |
} | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment