From f5a5bfcbf61166c3d574a67612f318e356dfa8f6 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 27 May 2026 08:49:07 +0900 Subject: [PATCH] limitations.md: replace binding note with general mrbgem pattern The Kernel#binding entry was treating "feature provided by mrbgem" as a per-method limitation, which does not scale. mruby implements much of Ruby's standard surface area through mrbgems, so listing each one would grow without bound. Replace it with a single top-level note explaining the general pattern: which features are available depends on the linked gems, and a NoMethodError on a familiar Ruby method usually points to a missing gem rather than a true mruby gap. Refs #6861. Co-authored-by: Claude --- doc/limitations.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/limitations.md b/doc/limitations.md index 4d8fc4708..b0908583a 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -15,6 +15,23 @@ This document is collecting these limitations. This document does not contain a complete list of limitations. Please help to improve it by submitting your findings. +## Features provided by mrbgems + +Many Ruby features that CRuby builds into its core are provided by +mrbgems in mruby. Which features are actually available depends on +which mrbgems are linked into the build. The `default.gembox` and +`stdlib.gembox` cover the common cases, but a minimal build can omit +familiar features such as `Kernel#binding` (provided by +`mruby-binding`), `Kernel#catch`/`throw` (by `mruby-catch`), +`Enumerable` extensions, `Comparable`, IO, regular expressions, and +many more. + +This is by design rather than a limitation per se. When porting Ruby +code to mruby, a `NoMethodError` or `NameError` often means "the gem +providing this feature is not linked in" rather than "mruby does not +support it." Adding the relevant gem to the build configuration is +usually enough. + ## `Kernel.raise` in rescue clause `Kernel.raise` without arguments does not raise the current exception within @@ -133,12 +150,6 @@ The re-defined `+` operator does not accept any arguments. `'ab'` Behavior of the operator wasn't changed. -## `Kernel#binding` is not supported without mruby-binding gem - -`Kernel#binding` method requires the `mruby-binding` gem (included -in the `metaprog` gembox). Without this gem, `binding` is not -available. - ## `nil?` redefinition in conditional expressions Redefinition of `nil?` is ignored in conditional expressions.