diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-08-28 22:13:52 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-08-28 22:13:52 +0900 |
| commit | 93bab387a71841fabe31ae3e0301417da543cbf8 (patch) | |
| tree | 591f23d1411380b090b6cedeeeda99a4151dae8d /doc/limitations.md | |
| parent | fe77272c25f3b6d91506a51d0621275074542890 (diff) | |
| parent | 471288f37d18e640f98029fabcdcb7ee16b95d93 (diff) | |
| download | mruby-93bab387a71841fabe31ae3e0301417da543cbf8.tar.gz mruby-93bab387a71841fabe31ae3e0301417da543cbf8.zip | |
Merge branch 'mruby2-draft'
Diffstat (limited to 'doc/limitations.md')
| -rw-r--r-- | doc/limitations.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/limitations.md b/doc/limitations.md index afcb7b56e..92858cb1f 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -205,3 +205,25 @@ trace (most recent call last): [0] -e:1 -e:1: undefined method 'binding' (NoMethodError) ``` + +## 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. + +#### Ruby [ruby 2.5.1p57 (2018-03-29 revision 63029)] + +``` +$ ruby -e 'def m(*r,**k) p [r,k] end; m("a"=>1,:b=>2)' +[[{"a"=>1}], {:b=>2}] +``` + +#### mruby [] + +``` +$ ./bin/mruby -e 'def m(*r,**k) p [r,k] end; m("a"=>1,:b=>2)' +trace (most recent call last): + [0] -e:1 +-e:1: keyword argument hash with non symbol keys (ArgumentError) +``` |
