octave-ruby 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/ext/octave_api/octave-ruby.cpp +4 -1
- data/octave-ruby.gemspec +1 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -28,6 +28,8 @@ VALUE or_feval(VALUE function_name, VALUE arguments)
|
|
28
28
|
|
29
29
|
n = RARRAY_LEN(arguments);
|
30
30
|
|
31
|
+
bool is_function_definition = (n == 1 && FIXNUM_P(RARRAY_PTR(arguments)[0]) == 0 && strncmp(RSTRING_PTR(StringValue(RARRAY_PTR(arguments)[0])), "function ", 9) == 0);
|
32
|
+
|
31
33
|
for (i = 0; i < n; i++) {
|
32
34
|
argList(i) = OR_Variable(RARRAY_PTR(arguments)[i]).to_octave();
|
33
35
|
}
|
@@ -44,7 +46,8 @@ VALUE or_feval(VALUE function_name, VALUE arguments)
|
|
44
46
|
symbol_table::set_scope(symbol_table::top_scope());
|
45
47
|
reset_error_handler();
|
46
48
|
|
47
|
-
|
49
|
+
int nargout = (is_function_definition ? 0 : 1);
|
50
|
+
octave_value_list val = feval(std::string(RSTRING_PTR(function_name)), argList, nargout);
|
48
51
|
if(val.length() > 0 && val(0).is_defined()) {
|
49
52
|
ruby_val = OR_Variable(val(0)).to_ruby();
|
50
53
|
}
|
data/octave-ruby.gemspec
CHANGED