@@ -205,11 +205,11 @@ mruby's numeric type sizes depend on the boxing mode and platform.
205205
206206### Integer
207207
208- | Configuration | Range |
209- | ------------- | ----- |
208+ | Configuration | Range |
209+ | -------------------------------------- | ----------- ----- |
210210| 64-bit word boxing (default on 64-bit) | roughly +/- 2^62 |
211211| 32-bit word boxing (default on 32-bit) | roughly +/- 2^30 |
212- | NaN boxing (64-bit only) | -2^31 to 2^31-1 |
212+ | NaN boxing (64-bit only) | -2^31 to 2^31-1 |
213213
214214Integer overflow raises a ` RangeError ` unless the ` mruby-bigint ` gem
215215is included, in which case integers automatically promote to
@@ -235,32 +235,32 @@ With word boxing on 64-bit, many float values are stored inline
235235
236236These classes are always available in mruby (no gem required):
237237
238- | Class | Notes |
239- | ----- | ----- |
240- | Object | Base class for all objects |
241- | Module | Module definition and mixin |
242- | Class | Class definition and instantiation |
243- | NilClass | Singleton ` nil ` |
244- | TrueClass | Singleton ` true ` |
245- | FalseClass | Singleton ` false ` |
246- | Integer | Fixed-precision integer |
247- | Float | Floating-point (unless ` MRB_NO_FLOAT ` ) |
248- | Symbol | Interned identifier |
249- | String | Mutable byte string |
250- | Array | Ordered collection |
251- | Hash | Key-value mapping |
252- | Range | Interval representation |
253- | Proc | Closure / callable object |
254- | Exception | Exception hierarchy root |
255- | StandardError | Common error base |
238+ | Class | Notes |
239+ | ------------- | --------------------------------- ----- |
240+ | Object | Base class for all objects |
241+ | Module | Module definition and mixin |
242+ | Class | Class definition and instantiation |
243+ | NilClass | Singleton ` nil ` |
244+ | TrueClass | Singleton ` true ` |
245+ | FalseClass | Singleton ` false ` |
246+ | Integer | Fixed-precision integer |
247+ | Float | Floating-point (unless ` MRB_NO_FLOAT ` ) |
248+ | Symbol | Interned identifier |
249+ | String | Mutable byte string |
250+ | Array | Ordered collection |
251+ | Hash | Key-value mapping |
252+ | Range | Interval representation |
253+ | Proc | Closure / callable object |
254+ | Exception | Exception hierarchy root |
255+ | StandardError | Common error base |
256256
257257### Core Modules
258258
259- | Module | Notes |
260- | ------ | ----- |
261- | Kernel | Core methods (` puts ` , ` p ` , ` raise ` , etc.) |
262- | Comparable | Comparison operators via ` <=> ` |
263- | Enumerable | Collection iteration methods |
259+ | Module | Notes |
260+ | ---------- | ------------------------------------ ----- |
261+ | Kernel | Core methods (` puts ` , ` p ` , ` raise ` , etc.) |
262+ | Comparable | Comparison operators via ` <=> ` |
263+ | Enumerable | Collection iteration methods |
264264
265265## Standard Library (via gemboxes)
266266
@@ -270,70 +270,70 @@ gembox provides the class or feature you need:
270270
271271### Classes and Modules
272272
273- | Class/Module | Gembox | Gem |
274- | ------------ | ------ | --- |
275- | Fiber | stdlib | mruby-fiber |
276- | Enumerator | stdlib | mruby-enumerator |
277- | Enumerator::Lazy | stdlib | mruby-enum-lazy |
278- | Set | stdlib | mruby-set |
279- | ObjectSpace | stdlib | mruby-objectspace |
280- | Time | stdlib-ext | mruby-time |
281- | Struct | stdlib-ext | mruby-struct |
282- | Data | stdlib-ext | mruby-data |
283- | Random | stdlib-ext | mruby-random |
284- | IO, File | stdlib-io | mruby-io |
285- | Socket | stdlib-io | mruby-socket |
286- | Dir | stdlib-io | mruby-dir |
287- | Errno | stdlib-io | mruby-errno |
288- | Math | math | mruby-math |
289- | Rational | math | mruby-rational |
290- | Complex | math | mruby-complex |
291- | Bigint | math | mruby-bigint |
292- | Method, UnboundMethod | metaprog | mruby-method |
273+ | Class/Module | Gembox | Gem |
274+ | --------------------- | ---------- | -------------- --- |
275+ | Fiber | stdlib | mruby-fiber |
276+ | Enumerator | stdlib | mruby-enumerator |
277+ | Enumerator::Lazy | stdlib | mruby-enum-lazy |
278+ | Set | stdlib | mruby-set |
279+ | ObjectSpace | stdlib | mruby-objectspace |
280+ | Time | stdlib-ext | mruby-time |
281+ | Struct | stdlib-ext | mruby-struct |
282+ | Data | stdlib-ext | mruby-data |
283+ | Random | stdlib-ext | mruby-random |
284+ | IO, File | stdlib-io | mruby-io |
285+ | Socket | stdlib-io | mruby-socket |
286+ | Dir | stdlib-io | mruby-dir |
287+ | Errno | stdlib-io | mruby-errno |
288+ | Math | math | mruby-math |
289+ | Rational | math | mruby-rational |
290+ | Complex | math | mruby-complex |
291+ | Bigint | math | mruby-bigint |
292+ | Method, UnboundMethod | metaprog | mruby-method |
293293
294294### Methods and Features
295295
296- | Feature | Gembox | Gem |
297- | ------- | ------ | --- |
298- | ` catch ` /` throw ` | stdlib | mruby-catch |
299- | ` Kernel#sprintf ` , ` String#% ` | stdlib-ext | mruby-sprintf |
300- | ` Array#pack ` , ` String#unpack ` | stdlib-ext | mruby-pack |
301- | ` Kernel#rand ` | stdlib-ext | mruby-random |
302- | ` Kernel#eval ` | metaprog | mruby-eval |
303- | ` Kernel#binding ` | metaprog | mruby-binding |
304- | ` Proc#binding ` | metaprog | mruby-proc-binding |
305- | Runtime compiler | metaprog | mruby-compiler |
296+ | Feature | Gembox | Gem |
297+ | ----------------------------- | ---------- | --------------- --- |
298+ | ` catch ` /` throw ` | stdlib | mruby-catch |
299+ | ` Kernel#sprintf ` , ` String#% ` | stdlib-ext | mruby-sprintf |
300+ | ` Array#pack ` , ` String#unpack ` | stdlib-ext | mruby-pack |
301+ | ` Kernel#rand ` | stdlib-ext | mruby-random |
302+ | ` Kernel#eval ` | metaprog | mruby-eval |
303+ | ` Kernel#binding ` | metaprog | mruby-binding |
304+ | ` Proc#binding ` | metaprog | mruby-proc-binding |
305+ | Runtime compiler | metaprog | mruby-compiler |
306306
307307### Core Class Extensions
308308
309309The ` stdlib ` gembox also extends built-in classes with additional
310310methods. These are included by default:
311311
312- | Extension | Examples |
313- | --------- | -------- |
314- | Array extensions | ` #dig ` , ` #union ` , ` #difference ` |
315- | Hash extensions | ` #dig ` , ` #transform_keys ` , ` #transform_values ` |
316- | String extensions | ` #encode ` , ` #bytes ` , ` #chars ` |
317- | Numeric extensions | ` Integer#digits ` , ` Integer#pow ` |
318- | Comparable extensions | ` #clamp ` |
319- | Enumerable extensions | ` #sort_by ` , ` #min_by ` , ` #max_by ` , ` #tally ` |
320- | Range extensions | ` #size ` , ` #cover? ` |
321- | Proc extensions | ` #<< ` , ` #>> ` (composition) |
322- | Symbol extensions | ` #to_proc ` |
323- | Object extensions | ` #then ` , ` #yield_self ` |
324- | Kernel extensions | ` #__method__ ` |
325- | Class/Module extensions | ` Module#name ` |
312+ | Extension | Examples |
313+ | ----------------------- | -------------------------------------- -------- |
314+ | Array extensions | ` #dig ` , ` #union ` , ` #difference ` |
315+ | Hash extensions | ` #dig ` , ` #transform_keys ` , ` #transform_values ` |
316+ | String extensions | ` #encode ` , ` #bytes ` , ` #chars ` |
317+ | Numeric extensions | ` Integer#digits ` , ` Integer#pow ` |
318+ | Comparable extensions | ` #clamp ` |
319+ | Enumerable extensions | ` #sort_by ` , ` #min_by ` , ` #max_by ` , ` #tally ` |
320+ | Range extensions | ` #size ` , ` #cover? ` |
321+ | Proc extensions | ` #<< ` , ` #>> ` (composition) |
322+ | Symbol extensions | ` #to_proc ` |
323+ | Object extensions | ` #then ` , ` #yield_self ` |
324+ | Kernel extensions | ` #__method__ ` |
325+ | Class/Module extensions | ` Module#name ` |
326326
327327### Gembox Summary
328328
329- | Gembox | Contents | Notes |
330- | ------ | -------- | ----- |
331- | ` stdlib ` | Core class extensions, Fiber, Enumerator, Set | Works with ` MRB_NO_STDIO ` and ` MRB_NO_FLOAT ` |
332- | ` stdlib-ext ` | Time, Struct, Data, Random, sprintf, pack | Works with ` MRB_NO_STDIO ` and ` MRB_NO_FLOAT ` |
333- | ` stdlib-io ` | IO, File, Dir, Socket, Errno | Requires stdio |
334- | ` math ` | Math, Rational, Complex, Bigint | Works with ` MRB_NO_STDIO ` |
335- | ` metaprog ` | eval, binding, Method, compiler | Works with ` MRB_NO_STDIO ` and ` MRB_NO_FLOAT ` |
336- | ` default ` | All of the above + CLI tools | Full installation |
329+ | Gembox | Contents | Notes |
330+ | ------------ | --------------------------------------------- | --------------------------------------- ----- |
331+ | ` stdlib ` | Core class extensions, Fiber, Enumerator, Set | Works with ` MRB_NO_STDIO ` and ` MRB_NO_FLOAT ` |
332+ | ` stdlib-ext ` | Time, Struct, Data, Random, sprintf, pack | Works with ` MRB_NO_STDIO ` and ` MRB_NO_FLOAT ` |
333+ | ` stdlib-io ` | IO, File, Dir, Socket, Errno | Requires stdio |
334+ | ` math ` | Math, Rational, Complex, Bigint | Works with ` MRB_NO_STDIO ` |
335+ | ` metaprog ` | eval, binding, Method, compiler | Works with ` MRB_NO_STDIO ` and ` MRB_NO_FLOAT ` |
336+ | ` default ` | All of the above + CLI tools | Full installation |
337337
338338## Key Differences from CRuby
339339
@@ -416,15 +416,15 @@ differently on 32-bit or NaN boxing configurations.
416416
417417Key compile-time macros that affect language behavior:
418418
419- | Macro | Effect |
420- | ----- | ------ |
421- | ` MRB_NO_FLOAT ` | Remove all float support |
422- | ` MRB_USE_FLOAT32 ` | Use 32-bit float instead of double |
423- | ` MRB_UTF8_STRING ` | Enable UTF-8 string handling |
424- | ` MRB_INT32 ` | Force 32-bit integer |
425- | ` MRB_INT64 ` | Force 64-bit integer |
426- | ` MRB_STR_LENGTH_MAX ` | Max string length (default 1MB) |
427- | ` MRB_ARY_LENGTH_MAX ` | Max array length (default 2^17) |
419+ | Macro | Effect |
420+ | -------------------- | ---------------------------- ------ |
421+ | ` MRB_NO_FLOAT ` | Remove all float support |
422+ | ` MRB_USE_FLOAT32 ` | Use 32-bit float instead of double |
423+ | ` MRB_UTF8_STRING ` | Enable UTF-8 string handling |
424+ | ` MRB_INT32 ` | Force 32-bit integer |
425+ | ` MRB_INT64 ` | Force 64-bit integer |
426+ | ` MRB_STR_LENGTH_MAX ` | Max string length (default 1MB) |
427+ | ` MRB_ARY_LENGTH_MAX ` | Max array length (default 2^17) |
428428
429429See [ mrbconf.md] ( mrbconf.md ) for the complete list of configuration
430430macros.
0 commit comments