-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for extensions, including usage and args check - use it to add math functions #96
Conversation
…ck, example with math.Pow()
} | ||
} | ||
|
||
func pow(args []object.Object) object.Object { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't use a variadic or simply have 2 parameter, it might be a huge refactoring but it would be better I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean? MaxArgs -1 is variadic (and variadic is same as [] anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be pow(val, exp)
Or pow(args ...object.Object)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes... so that would be like it is today MinArgs=MaxArgs=2
the second one is MinArgs=0 MaxArgs=-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 7d759b8 for sprintf
integration as variadic example
In one commit you said "gofump, instead of gofumpt" |
…turned (still fatal, but returned)
…he function to name mapping
…ent PR for this but 1/2 of them are new to this PR and it came up here
…commands, so renamed accordingly
… the variadic any args to it
@ccoVeille I'm working on a grol side variadic support off this branch but... I think we should merge this first? |
example with math.Pow() exposed as pow(float1 float2) (and auto convert from integer)
Fixes #9, #41