We are proudly announcing the stable release of mruby 2.0 series - mruby 2.1.0.
The mruby 2.1.0 has been enhanced with compatibility with Ruby 2 series, and some new features of Ruby 2.7 have been added.
Rational and Complex literals) (#4125)Array#intersection method which returns a new array containing elements common to both arrays. (mrbgems/mruby-array-ext)Enumerable#filter_map method which is a short hand for filter + map in a single call. (mrbgems/mruby-enum-ext)Enumerable#tally method which group and count elements of the collection. (mrbgems/mruby-enum-ext)Enumerator.produce method which creates an infinite enumerator from any block. (mrbgems/mruby-enumerator)UnboundMethod#bind_call method which call a method that overridden without allocation of intermediate Method object. (mruby-method)Module#name, true#to_s, false#to_s return a frozen string. The returned string is always the same object.Array#difference method:Array#difference returns a new array that is a copy of the original array, removing any items that also appear in other_ary. (mrbgems/mruby-array-ext)mrbgems/mruby-rational:Rational class has been included into the core library, and rational numbers like 1/3 can be handled.mrbgems/mruby-complex:Complex class has been included into the core library to handle complex numbers.mrb_false_p(o)
mrb_true_p(o)
mrb_free_p(o)
mrb_object_p(o)
mrb_class_p(o)
mrb_module_p(o)
mrb_iclass_p(o)
mrb_sclass_p(o)
mrb_proc_p(o)
mrb_range_p(o)
mrb_file_p(o)
mrb_env_p(o)
mrb_data_p(o)
mrb_fiber_p(o)
mrb_istruct_p(o)
mrb_break_p(o)
MRB_API mrb_int mrb_cmp(mrb_state *mrb, mrb_value obj1, mrb_value obj2);
MRB_API mrb_irep *mrb_read_irep_buf(mrb_state*, const void*, size_t); // mruby/dump.h
MRB_API mrb_value mrb_load_irep_buf(mrb_state*, const void*, size_t); // mruby/irep.h
MRB_API mrb_value mrb_load_irep_buf_cxt(mrb_state*, const void*, size_t, mrbc_context*); // mruby/irep.h
MRB_API mrb_value mrb_num_plus(mrb_state *mrb, mrb_value x, mrb_value y);
MRB_API mrb_value mrb_num_minus(mrb_state *mrb, mrb_value x, mrb_value y);
MRB_API mrb_value mrb_num_mul(mrb_state *mrb, mrb_value x, mrb_value y);
MRB_API mrb_value mrb_int_value(mrb_state *mrb, mrb_float f);
MRB_API void mrb_str_modify_keep_ascii(mrb_state *mrb, struct RString *s);
MRB_API const char *mrb_string_cstr(mrb_state *mrb, mrb_value str);
mrb_ro_data_p() (#4408)filter aliases for Enumerable and Hash. (57a0132b)assert (#4320)assert_match(pattern, str, msg=nil)
assert_not_match(pattern, str, msg=nil)
assert_raise_with_message(exc, exp_msg, msg = nil, &block
assert_raise_with_message_pattern(exc, exp_msg, msg = nil, &block)
assert_not_nil(target, msg)
irb in Ruby, a local variable _ is added to store the last result.&. at the beginning of the line (4124047c)mrb_get_args using the format string :.mrb_parser_dump supports displaying NODE_DSYM, NODE_WORDS, NODE_SYMBOLS and NODE_LITERAL_DELIM.ArgumentError by aspec check. (30f37872)mrb_vfromat() (#4608)assert for mrbtest (#4540)MRUBY_RELEASE_DATE (#4353)Class#new(*args, &block) method.Module#class_variables.RADIX, MANT_DIG, EPSILON, DIG, MIN_EXP, MIN, MIN_10_EXP, MAX_EXP, MAX, MAX_10_EXP)$1..$9 from Kernel#global_variables.m).Integral#chr (#4593)length for IO should be in bytes, not in characters (8c90b5fc)There are three major breaking changes from mruby 2.0.1.
Array#append and Array#prepend from core to mrbgems/mruby-ary-ext.Numeric#div from mrbgems/mruby-numeric-ext to the core.Integral#zero?, Integral#nonzero?, Integral#positive? and Integral#negative)? to Numeric class.Numeric#__coerce_step_counter to Integral class.Kernel#instance_exec, Kernel#equal? and Kernel#instance_eval to BasicObject class.NilClass#to_h to mrbgems/mruby-object-ext from mrbgems/mruby-enum-extString#getbyte, String#setbyte and String#byteslice to the core. (#4696)Kernel#global_variables from core. This method is defined in mrbgems/mruby-metaprog.Integral#chr (Fixnum#chr) to mrbgems/mruby-string-ext.String#=~ and String#match that requires Regexp (fd37bc53)Symbol#to_s return a frozen string. The returned string is always the same object. This feature will be reverted next mruby, because which reverted from Ruby 2.7..0 is removed from result of Float#to_s and Float#inspect. (9d08025b)mrb_sym2name() -> mrb_sym_name()mrb_sym2name_len() -> mrb_sym_name_len()mrb_sym2str() -> mrb_sym_str()MRB_API from definitions (referenced from within libmruby):mrb_instance_new(), mrb_vm_define_class(), mrb_vm_define_module()struct RIstruct is renamed to struct RIStruct (e41f1574)mrb_fixnum_plus(), mrb_fixnum_minus(), mrb_fixnum_mul(), and mrb_num_div(). Use mrb_num_plus(), mrb_num_minus(), mrb_num_mul() instead.ary of struct RString. struct RStringEmbed is used for String embedding. (#4646)$/. The current Ruby policy do not encourage Perl-ish global variables.MRB_TT_HAS_BASIC macro. (#4728)flags and mems of struct mrb_state. (0c5f26e0 and #4470)MRB_METHOD_TABLE_INLINE and MRB_NO_INIT_ARRAY_START. (2256bb07 and #4716)MRB_USE_ETEXT_EDATA is deprecated (warned and ignored). instead, use MRB_USE_LINK_TIME_RO_DATA_P. (#4716)SystemStackError is raised from String#=~. (#4363)mrb_top_run calls; fix (#4384)Can't get cfunc env from non-cfunc proc. (#4389)Fiber.yield in method. (#4567)mrb_gc_unregister() may access freed memory. (#4618)We have done 912 commits to 229 files, 12,006 lines were added, 5,382 lines removed since mruby 2.0.1. For more detail of the updates, see Commit Log.
Let’s try mruby 2.1.0.