-
Notifications
You must be signed in to change notification settings - Fork 21
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
cannnot call C functions #5
Comments
Thank you for your report. The first example is working on my computer. Can you use the current master and see if it still works? Also can you write the commands that you used over here? As for the second example: lib "<math.h>"
double cos(double)
end
def stray_cos
return cos(4.5)
end
class A
def cos
return cos(4.5)
end
end The lib "<math.h>"
double cos(double)
end
def stray_cos
return cos(4.5)
end
class A
def ruby_cos
return cos(4.5)
end
end It will work with |
|
If there are any updates please post in this thread. Closing for now. |
I tried experiment m1.rubex lib "<math.h>"
double sin(doublue)
end
def top_sin(x)
sin(x)
end
class RMath
def ruby_sin(x)
sin(x)
end
end m2.rubex lib "<math.h>"
double sin(doublue)
end
class RMath
def ruby_sin(x)
sin(x)
end
end change rubex-0.0.1/lib/rubex/symbol_table/scope.rb 172 private
173 def recursive_find name, scope
174 if scope
175 require 'rainbow'
176 if scope.has_entry?(name)
177 puts Rainbow("+" << name.to_s << " in " << scope.name.to_s).green
178 return scope[name]
179 else
180 puts Rainbow("- " << name.to_s << " in " << scope.name.to_s).red
181 return recursive_find(name, scope.outer_scope)
182 end
183 end
184
185 return nil
186 end rubex m1.rubex + Object in Object
+ Object in Object
+ top_sin in Object
+ x in top_sin
- sin in top_sin
+ sin in Object
- sin in top_sin
+ sin in Object
- sin in top_sin
+ sin in Object
- top_sin in top_sin
+ top_sin in Object
+ RMath in Object
+ ruby_sin in RMath
+ x in ruby_sin
- sin in ruby_sin
- sin in RMath
+ sin in Object
- sin in ruby_sin
- sin in RMath
+ sin in Object
- sin in ruby_sin
- sin in RMath
+ sin in Object
- ruby_sin in ruby_sin
+ ruby_sin in RMath
- sin in top_sin
+ sin in Object
- sin in ruby_sin
- sin in RMath
+ sin in Object
+ RMath in Object
+ Object in Object
+ Object in Object
+ RMath in Object Succeeded rubex m2.rubex - Object in Object
+ RMath in Object
+ ruby_sin in RMath
+ x in ruby_sin
- sin in ruby_sin
- sin in RMath
- sin in Object
- sin in ruby_sin
- sin in RMath
- sin in Object
+ sin in ruby_sin
- ruby_sin in ruby_sin
+ ruby_sin in RMath
+ sin in ruby_sin
+ sin in ruby_sin error 2.4.0/gems/rubex-0.0.1/lib/rubex/ast/expression.rb:694:in `code_for_ruby_method_call': undefined method `c_code' for nil:NilClass (NoMethodError) Well. I do not know whether it is correct or wrong. |
Investigating. |
Has been fixed in c9793b6 Thank you for your report! Do send more :) |
Hello.
I tried the sample code. #4 (comment)
However, the following error occured on my computer.
The following code can be executed without error. But it shows me a bit strange behavior.
This is C file.
Perhaps the setting and the execution environment are not sufficient, and that may be the reason it does not work. However, as it may be useful for something, I will report it as it is.
Thank you.
The text was updated successfully, but these errors were encountered: