first steps to allow easy functors via macros

This commit is contained in:
Andreas Rumpf
2017-06-04 11:17:41 +02:00
parent 42c9bb3ace
commit c59bc0cc18
5 changed files with 65 additions and 20 deletions

View File

@@ -0,0 +1,19 @@
discard """
out: '''(foo0: 38, other1: string here)
43'''
"""
type
Base = ref object of RootObj
Foo {.partial.} = ref object of Base
proc my(f: Foo) =
#var f.next = f
let f.foo = 38
let f.other = "string here"
echo f[]
echo f.foo0 + 5
var g: Foo
new(g)
my(g)