Skip to content

Fixes #17 Support callback#18

Closed
m4yk3ldev wants to merge 9 commits intosimelo:masterfrom
simelotech:stdevHan_t17_support_callback
Closed

Fixes #17 Support callback#18
m4yk3ldev wants to merge 9 commits intosimelo:masterfrom
simelotech:stdevHan_t17_support_callback

Conversation

@m4yk3ldev
Copy link

Fixes #17

Changes:

  • Added support callback in coin.transactions

Does this change need to mentioned in CHANGELOG.md?

No

@m4yk3ldev m4yk3ldev added this to the 0.1.0 milestone Jan 20, 2020
@m4yk3ldev m4yk3ldev self-assigned this Jan 20, 2020
call_func_code =
jen.List(retvars...).Op(":=").Id(fdecl.Name.Name).Call(callparams...)
}
callFuncCode =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this conditional statement ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already analyze mainPackage at the beginning, that rounds code

} else {
call_func_code = jen.Id(fdecl.Name.Name).Call(callparams...)
}
callFuncCode = jen.Qual(mainPackagePath+packagePath,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removed this conditional statement ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already analyze mainPackage at the beginning, that rounds code

}
leftPart = leftPart.Parens(jen.Op("*").Id(packName).Id(".").Id(typeName)).
Parens(jen.Qual("unsafe", "Pointer").Parens(jen.Id(argName(name))))
if typeName == "FeeCalculator" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cgogen code has to be generic , it must not depend upon specific names of a particular library used as input

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in my opinion , maybe this check should be about whether type was defined as ast.FuncType .

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem of callbacks that are very specific. And the functions are different, it can't be treated that way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it definitely can't be treated as hard-coded type names belonging in a separate library package .

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly then what do you suggest

@olemis olemis mentioned this pull request Feb 24, 2020
@m4yk3ldev m4yk3ldev closed this Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support to define callback

2 participants