-
Notifications
You must be signed in to change notification settings - Fork 15
Function symbol Ruby Wrappers #51
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
Conversation
ext/symengine/ruby_function.c
Outdated
| VALUE cfunction_functionsymbol_init(VALUE self, VALUE args) | ||
| { | ||
| int argc = NUM2INT(rb_funcall(args, rb_intern("length"), 0, NULL)); | ||
| printf("argc : %d\n", argc); |
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.
The function shouldn't print anything.
symengine_version.txt
Outdated
| @@ -1,2 +1,3 @@ | |||
| b91c64a3b82f15133f4a7df64749523bb0bed185 | |||
| 1d80d81096b66c08ad3fe4e43ee586cd91b5ccf8 | |||
|
|
|||
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.
No need of these extra lines
|
Python wrappers have a nice syntax for creating FunctionSymbols.
What do you think? |
|
@isuruf What are the advantages of doing it in two steps? What about, haveing |
spec/function_symbol_spec.rb
Outdated
| it { is_expected.to be_a SymEngine::Subs } | ||
| end | ||
|
|
||
| context 'by constant' do |
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.
Remove this. Differentiation should throw an error if the input is not a Symbol.
|
Advantage is for easy typing when there are multiple function symbols made and also for readability instead of |
lib/symengine.rb
Outdated
| end | ||
| end | ||
|
|
||
| def SymEngine.Function(n) |
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.
You can move this inside class << self block and then you can remove SymEngine.
Wrappers for the function symbol class