public static object gvar_set(string gvar_name, object value, Frame caller) { if (!global_vars.ContainsKey(gvar_name)) global_vars[gvar_name] = new global_variable(); global_vars[gvar_name].setter(gvar_name, value, caller); return value; }
internal static void rb_define_variable(string name, global_variable var) { global_vars[name] = var; }
internal static void opt_i_set(object value, string id, object data, global_variable var) { if (!Eval.Test(value)) { ruby_inplace_mode = null; } else { ruby_inplace_mode = String.StringValue(value, null); // fixme: might need a valid frame to call StringValue } }
internal static object opt_i_get(string id, object data, global_variable var) { if (ruby_inplace_mode == null) return null; else return new String((string)ruby_inplace_mode); }
internal static void deferr_setter(Frame caller, object value, string id, object data, global_variable var) { stdout_setter(caller, value, id, data, var); Errors.rb_warn("$deferr is obsolete; use $stderr instead"); }
internal static void stdout_setter(Frame caller, object value, string id, object data, global_variable var) { must_respond_to(caller, "write", value, id); var.value = value; }
// ---------------------------------------------------------------------------- internal static void lineno_setter(object value, string id, object data, global_variable var) { gets_lineno = Integer.rb_num2long(value, null); var.value = gets_lineno; }