ruby-changes:72045
From: Nobuyoshi <ko1@a...>
Date: Fri, 3 Jun 2022 14:13:35 +0900 (JST)
Subject: [ruby-changes:72045] 1b44fcf222 (master): [DOC] Mention the case to autoload already defined constant
https://git.ruby-lang.org/ruby.git/commit/?id=1b44fcf222 From 1b44fcf22205dd9f1c6beb5e83ab3c98374ad1e4 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 3 Jun 2022 14:10:30 +0900 Subject: [DOC] Mention the case to autoload already defined constant --- load.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/load.c b/load.c index b8d0da7fc2..2cdd64a163 100644 --- a/load.c +++ b/load.c @@ -1313,6 +1313,10 @@ ruby_init_ext(const char *name, void (*init)(void)) https://github.com/ruby/ruby/blob/trunk/load.c#L1313 * end * A.autoload(:B, "b") * A::B.doit # autoloads "b" + * + * If _const_ in _mod_ is defined as autoload, the file name to be + * loaded is replaced with _filename_. If _const_ is defined but not + * as autoload, does nothing. */ static VALUE @@ -1373,6 +1377,10 @@ rb_mod_autoload_p(int argc, VALUE *argv, VALUE mod) https://github.com/ruby/ruby/blob/trunk/load.c#L1377 * a symbol) is accessed. * * autoload(:MyModule, "/usr/local/lib/modules/my_module.rb") + * + * If _const_ is defined as autoload, the file name to be loaded is + * replaced with _filename_. If _const_ is defined but not as + * autoload, does nothing. */ static VALUE -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/