This articles was published on 2012-11-16

[October 2012] mruby news

Due to work and my preparation for RubyWorld Conference I couldn’t keep up the last couple of weeks. Here now a first update of what happened on the mruby front in October 2012.

Avoid memcpy()

Masaki Muranaka has cleanup the code a bit by avoiding memcpy at quite a few locations.

d5c4439013084ea5dcd30fd44a3a3d045e2dce67, 2cb183f1831d7949130ab8ecbca0630a08a1ba60, 93b56e70ee26428e2f56dd82d3318622628aa62d, e8abf03ae59b72bbc9c3af26eee33a9f4d17cc56, 170d5e7181cef90daa63c39b16ea66f6bd2b17b4

mrbc improvement

mrbc now takes input from STDIN.

76f28241f1a6eb76070d470779fc17d43ca838e3

Singleton improvement

A singleton classes is now able to have instance variables.

559933f577d5073464aa06facc1b754de6225d8a

Division by 0

A division by 0 is now not crashing anymore but returns [Inf,NaN]. This is potentially incompatible to CRuby.

1bf70ea255a36fc6ff0991c1ac05cb0f44df8ce1

Fix Kernel#block_given?

Fix bug in Kernel#block_given? which always returned false.

8271863fe5abb6d706d25f1dec87160f91bb28ff

Enumerable improvement

Enumerable#inject handles now empty enumerables.

fd949663d2229419a1e53e69351205cd27157653, 17278e8ca69d79f4d37e65830c95cc6004c2d8f5

rescue fix

return and break had a bug in a rescue clause.

2f5f853111dd5d73cb7a85c5306aa1e41d3d7fc4, 400a9d81019d987704c5890872d2599a3c60114c, da637cac4a3520f7d6d9a69b392be4309f36ef5b

LocalJumpError

Unexpected usage of break/next/redo/retry should raise a LocalJumpError exception.

89a18e4f22de80b836f9d6c3167d71b7078a31bb

raise C-API change

A new C-function with the name mrb_raisef() was introduced by Masaki Muranaka. It is basically the same as mrb_raise() but without being able to treat variable arguments.

6069a33089916d7059c2bd2aeddc02a3eb440520

Backtrace

Tomoyuki Sahara implemented a backtrace function.

5bae6459ff6649fdc622b0c4f2a8ee93865197e3

Fix (get|set) const variable for Singleton

Get and Set for const variables wasn’t working for singleton classes.

ec343a64217a4825a97d4ef469699445f86a30e7