diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-05-02 09:06:28 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 16:20:48 +0900 |
| commit | 10b1a52bb88ac3a7443c91fd866f8724169a2586 (patch) | |
| tree | 333d8c7e79522e046c0c8037dea27fb5e224a0ae | |
| parent | dcfc2dbf148cd533ed5419efde31822c38bcdaf5 (diff) | |
| download | mruby-10b1a52bb88ac3a7443c91fd866f8724169a2586.tar.gz mruby-10b1a52bb88ac3a7443c91fd866f8724169a2586.zip | |
Small updates on documents:
- README.md
- CONTRIBUTING.md
- doc/limitations.md
| -rw-r--r-- | CONTRIBUTING.md | 5 | ||||
| -rw-r--r-- | README.md | 8 | ||||
| -rw-r--r-- | doc/limitations.md | 31 |
3 files changed, 23 insertions, 21 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0b632f51c..ec25f89b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,7 +56,7 @@ on-demand. Use C++ style comments only for temporary comment e.g. commenting out some code lines. -#### Insert a break after the method return value: +#### Insert a break after the function return value: int main(void) @@ -72,4 +72,5 @@ language itself. Please note the following hints for your Ruby code: #### Comply with the Ruby standard (ISO/IEC 30170:2012) mruby is currently targeting to execute Ruby code which complies to ISO/IEC -30170:2012 (http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579). +30170:2012 (http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579), +unless there's a clear reason, e.g. the latest Ruby has changed behavior from ISO. @@ -40,11 +40,13 @@ We don't have a mailing list, but you can use [GitHub issues](https://github.com See the [compile.md](https://github.com/mruby/mruby/blob/master/doc/guides/compile.md) file. -## Running Tests +## How to Build -To run the tests, execute the following from the project's root directory. +To build mruby, execute the following from the project's root directory. - $ rake test + $ rake TARGET=<target> test + +The default `TARGET` is `host`. `TARGET` will be loaded from `target` directory. Note: `bison` bundled with MacOS is too old to compile `mruby`. Try `brew install bison` and follow the instuction shown to update diff --git a/doc/limitations.md b/doc/limitations.md index 770daa7a4..79979fd5a 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -245,8 +245,7 @@ trace (most recent call last): ## Keyword arguments mruby keyword arguments behave slightly different from CRuby 2.5 -to make the behavior simpler and less confusing. Maybe in the -future, the simpler behavior will be adopted to CRuby as well. +to make the behavior simpler and less confusing. #### Ruby [ruby 2.5.1p57 (2018-03-29 revision 63029)] @@ -264,6 +263,20 @@ trace (most recent call last): -e:1: keyword argument hash with non symbol keys (ArgumentError) ``` +## `nil?` redefinition in conditional expressions + +Redefinition of `nil?` is ignored in conditional expressions. + +```ruby +a = "a" +def a.nil? + true +end +puts(a.nil? ? "truthy" : "falsy") +``` + +Ruby outputs `falsy`. mruby outputs `truthy`. + ## Argument Destructuring ```ruby @@ -283,17 +296,3 @@ f(1,[2,3]) ``` CRuby gives `[1,2,3,nil]`. mruby raises `NoMethodError` for `b`. - -## `nil?` redefinition in conditional expressions - -Redefinition of `nil?` is ignored in conditional expressions. - -```ruby -a = "a" -def a.nil? - true -end -puts(a.nil? ? "truthy" : "falsy") -``` - -Ruby outputs `falsy`. mruby outputs `truthy`. |
