layout | title | date | categories |
---|---|---|---|
post |
mruby 2.1.0 released |
2019-11-18 16:00:00 -0800 |
releases |
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.
- Suffix support (
Rational
andComplex
literals) (#4125)
- Add
Array#intersection
method which returns a new array containing elements common to both arrays. (mrbgems/mruby-array-ext) - Add
Enumerable#filter_map
method which is a short hand forfilter
+map
in a single call. (mrbgems/mruby-enum-ext) - Add
Enumerable#tally
method which group and count elements of the collection. (mrbgems/mruby-enum-ext) - Add
Enumerator.produce
method which creates an infinite enumerator from any block. (mrbgems/mruby-enumerator) - Add
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.
- Add
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)
- Add
mrbgems/mruby-rational
:
Rational
class has been included into the core library, and rational numbers like1/3
can be handled. - Add
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);
- Add customized
mrb_ro_data_p()
(#4408)
- Add
filter
aliases forEnumerable
andHash
. (57a0132b)
- (Proof of Concept) mruby tuning profiles (#4446)
- Warn if assertion is missing inside
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)
- As with
irb
in Ruby, a local variable_
is added to store the last result.
- Allow newlines and comments between method calls. (4296c77e)
- Support
&.
at the beginning of the line (4124047c)
- Support lock file
It is now possible to fix mruby and mrbgems versions in products that use mruby. - Rename MRB_USE_ETEXT_EDATA to MRB_USE_LINK_TIME_RO_DATA_P and support lld linked programs (#4716)
- Keyword arguments can be obtained with
mrb_get_args
using the format string:
. mrb_parser_dump
supports displayingNODE_DSYM
,NODE_WORDS
,NODE_SYMBOLS
andNODE_LITERAL_DELIM
.- Raise
ArgumentError
byaspec
check. (30f37872)
- Add new specifiers/modifiers to format string of
mrb_vfromat()
(#4608)
- Nested
assert
for mrbtest (#4540)
- Pad leading zero to month and day in
MRUBY_RELEASE_DATE
(#4353)
- Add
Class#new(*args, &block)
method. - Add optional argument to
Module#class_variables
. - Add constants for floating point number. (
RADIX
,MANT_DIG
,EPSILON
,DIG
,MIN_EXP
,MIN
,MIN_10_EXP
,MAX_EXP
,MAX
,MAX_10_EXP
) - Removed
$1
..$9
fromKernel#global_variables
. - String#unpack/Array#pack does support base64 directive (
m
). - Add encoding argument to
Integral#chr
(#4593) - Fixed
length
for IO should be in bytes, not in characters (8c90b5fc)
There are three major breaking changes from mruby 2.0.1.
- Move
Array#append
andArray#prepend
from core tomrbgems/mruby-ary-ext
. - Move
Numeric#div
frommrbgems/mruby-numeric-ext
to the core. - Move
Integral#zero?
,Integral#nonzero?
,Integral#positive?
andIntegral#negative)?
toNumeric
class. - Move
Numeric#__coerce_step_counter
toIntegral
class. - Move
Kernel#instance_exec
,Kernel#equal?
andKernel#instance_eval
toBasicObject
class. - Move
NilClass#to_h
tomrbgems/mruby-object-ext
frommrbgems/mruby-enum-ext
- Move
String#getbyte
,String#setbyte
andString#byteslice
to the core. (#4696) - Remove
Kernel#global_variables
from core. This method is defined inmrbgems/mruby-metaprog
. - Integrate
Integral#chr
(Fixnum#chr
) tomrbgems/mruby-string-ext
. - Remove
String#=~
andString#match
that requiresRegexp
(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.- Explicit
.0
is removed from result ofFloat#to_s
andFloat#inspect
. (9d08025b)
- Rename symbol-to-string functions. (#4684)
mrb_sym2name()
->mrb_sym_name()
mrb_sym2name_len()
->mrb_sym_name_len()
mrb_sym2str()
->mrb_sym_str()
- Functions to remove
MRB_API
from definitions (referenced from withinlibmruby
):
mrb_instance_new()
,mrb_vm_define_class()
,mrb_vm_define_module()
struct RIstruct
is renamed tostruct RIStruct
(e41f1574)
- Remove
mrb_fixnum_plus()
,mrb_fixnum_minus()
,mrb_fixnum_mul()
, andmrb_num_div()
. Usemrb_num_plus()
,mrb_num_minus()
,mrb_num_mul()
instead.
- Remove a member
ary
ofstruct RString
.struct RStringEmbed
is used for String embedding. (#4646)
- Remove global variable
$/
. The current Ruby policy do not encourage Perl-ish global variables. - Remove
MRB_TT_HAS_BASIC
macro. (#4728) - Remove members
flags
andmems
ofstruct mrb_state
. (0c5f26e0 and #4470)
- Remove
MRB_METHOD_TABLE_INLINE
andMRB_NO_INIT_ARRAY_START
. (2256bb07 and #4716) MRB_USE_ETEXT_EDATA
is deprecated (warned and ignored). instead, useMRB_USE_LINK_TIME_RO_DATA_P
. (#4716)
- Remove "LINE" section reader. (#4455)
SystemStackError
is raised fromString#=~
. (#4363)- Null pointer dereference in ecall. (#4370)
- mismatched shift functions. (#4380)
- Compilation error with "MRB_ARY_EMBED_LEN_MAX" in "array.h". (#4382)
- Fixed a bug in recursive
mrb_top_run
calls; fix (#4384) - Unexpected error:
Can't get cfunc env from non-cfunc proc.
(#4389) - build error on master by MRB_WITHOUT_FLOAT. (#4478)
- Null pointer dereference in mrb_str_cat_str. (#4504)
- Some comments do not increment lineno on context. (#4513)
- Null pointer dereference in mrb_check_frozen. (#4519)
- Invalid read in mrb_class. (#4534)
- Array#inspect recurses too much for self-referential arrays. (#4552)
- Infinite loop in Integer#step when both args are INFINITY. (#4555)
- Float#round hangs for large ndigits. (#4566)
- Cannot call
Fiber.yield
in method. (#4567) - Reference to top-level variable in top-level block is broken. (#4581)
- Bugs with mutually recursive Array and Hash. (#4582)
mrb_gc_unregister()
may access freed memory. (#4618)- memcpy-param-overlap in str_replace_partial. (#4627)
- Symbol#inspect does not handle Unicode characters. (#4678)
- mrb_funcall returns odd value. (#4696)
- behavior of alias is different from CRuby. (#4718)
- compile error at master by clang 9. (#4786)
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
.