Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Foo1 {.pure.} = object
- x:int
- y:int
- type Foo2 = tuple [
- x:int;
- y:int;
- ]
- proc newFoo1a(x:int, y:int): Foo1 =
- result = Foo1(x:x, y:y)
- proc newFoo1b(x:int, y:int): Foo1 =
- result.x = x
- result.y = y
- proc newFoo2a(x:int, y:int): Foo2 =
- result = (x:x, y:y)
- proc newFoo2b(x:int, y:int): Foo2 =
- result.x = x
- result.y = y
- # =====================================================
- # Generated code
- struct foo131003 {
- NI X;
- NI Y;
- };
- struct foo231008 {
- NI Field0;
- NI Field1;
- };
- N_NIMCALL(foo131003, newfoo1a_31012)(NI x, NI y) {
- foo131003 result;
- foo131003 LOC1;
- memset((void*)&result, 0, sizeof(result));
- memset((void*)&LOC1, 0, sizeof(LOC1));
- LOC1.X = x;
- LOC1.Y = y;
- result = LOC1;
- return result;
- }
- N_NIMCALL(foo131003, newfoo1b_31020)(NI x, NI y) {
- foo131003 result;
- memset((void*)&result, 0, sizeof(result));
- result.X = x;
- result.Y = y;
- return result;
- }
- N_NIMCALL(foo231008, newfoo2a_31027)(NI x, NI y) {
- foo231008 result;
- memset((void*)&result, 0, sizeof(result));
- result.Field0 = x;
- result.Field1 = y;
- return result;
- }
- N_NIMCALL(foo231008, newfoo2b_31037)(NI x, NI y) {
- foo231008 result;
- memset((void*)&result, 0, sizeof(result));
- result.Field0 = x;
- result.Field1 = y;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment