mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add $member.get(value) to replace value.$eval($member.nameof)
This commit is contained in:
@@ -71,6 +71,8 @@ fn void methodsof()
|
||||
Foo foo = { .i = 4, .b = true };
|
||||
assert(Foo.$eval(Foo.methodsof[2])(&foo) == true); // Foo.xyz
|
||||
assert(Foo.$eval(Foo.methodsof[1])(&foo, 2) == 8); // Foo.bar
|
||||
assert(Foo.$eval(Foo.methodsof[2])(&foo) == true); // Foo.xyz
|
||||
assert(Foo.$eval(Foo.methodsof[1])(&foo, 2) == 8); // Foo.bar
|
||||
|
||||
Foo foo2 = { .i = 2, .b = false };
|
||||
assert(foo2.$eval(Foo.methodsof[2])() == false); // Foo.xyz
|
||||
|
||||
Reference in New Issue
Block a user