From 8472fe0f133d2827f8245f512c36138698b33ab4 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 13 Mar 2025 22:46:23 +0900 Subject: [PATCH] doc/limitation.md: remove visibility note We have implemented visibility in mruby 3.4 --- doc/limitations.md | 69 ---------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/doc/limitations.md b/doc/limitations.md index 952136849..1b3eccbc9 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -72,75 +72,6 @@ p Liste.new "foobar" `ArgumentError` is raised. -## Method visibility - -For simplicity reasons no method visibility (public/private/protected) is -supported. Those methods are defined, but they are dummy methods. - -```ruby -class VisibleTest - - def public_method; end - - private - def private_method; end - -end - -p VisibleTest.new.respond_to?(:private_method, false) -p VisibleTest.new.respond_to?(:private_method, true) -``` - -#### Ruby [ruby 2.0.0p645 (2015-04-13 revision 50299)] - -``` -false -true -``` - -#### mruby [3.1.0 (2022-05-12)] - -``` -true -true -``` - -### Visibility Declaration - -The declaration form of following visibility methods are not implemented. - -- `public` -- `private` -- `protected` -- `module_function` - -Especially, `module_function` method is not dummy, but no declaration form. - -```ruby -module TestModule - module_function - def test_func - p 'test_func called' - end - - test_func -end - -p 'ok' -``` - -#### Ruby [ruby 2.5.5p157 (2019-03-15 revision 67260)] - -``` -ok -``` - -#### mruby [3.1.0 (2022-05-12)] - -``` -test.rb:8: undefined method 'test_func' (NoMethodError) -``` - ## `defined?` The `defined?` keyword is considered too complex to be fully