--20cf300face9cad8af04b2ef04e3
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Yehuda Katz
(ph) 718.877.1325


On Tue, Nov 29, 2011 at 10:04 PM, Yukihiro Matsumoto <matz / ruby-lang.org>wrote:

> Hi,
>
> In message "Re: [ruby-core:41404] [ruby-trunk - Bug #5690][Open]
> Module#qualified_const_get"
>     on Wed, 30 Nov 2011 12:10:02 +0900, Yehuda Katz <wycats / gmail.com>
> writes:
>
> |It would be great if there was a way to dynamically load a constant path:
> |
> |  module Foo
> |    module Bar
> |      module Baz
> |      end
> |    end
> |  end
> |
> |  Foo.qualified_const_get("Bar::Baz") => Foo::Bar::Baz
>
> Interesting.
>
> * is there any use-case for this method?
>

We use it often in Rails.


> * if Bar is not a class nor module, what kind error should be raised?
>

TypeError: "( is not a class/module"


> * is qualified_const_get an appropriate name for the function?
>

Unknown. It's what we call it in Rails ;)


>
>                                                        matz.
>
>

--20cf300face9cad8af04b2ef04e3
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

<br clear="all">Yehuda Katz<br>(ph) 718.877.1325<br>
<br><br><div class="gmail_quote">On Tue, Nov 29, 2011 at 10:04 PM, Yukihiro Matsumoto <span dir="ltr">&lt;matz / ruby-lang.org&gt;</span> wrote:<br><blockquote class="gmail_quote"tyle="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi,<br>
<br>
In message &quot;Re: [ruby-core:41404] [ruby-trunk - Bug #5690][Open] Module#qualified_const_get&quot;<br>
<div class="im">  ¨ΒΧεδ¬ ³° Ξο²°±± ±²Ί±°Ί°² «°Ή°°¬ Ωεθυδα Λατϊ ¦μτ»Όα θςεζ½ΆναιμτοΊχωγατσΐηναιμ®γονΆΎχωγατσΐηναιμ®γονΌ―αΎ¦ητχςιτεσΊΌβς<br>
|It would be great if there was a way to dynamically load a constant path:<br>
|<br>
|  ¨ΒοδυμΖοοΌβς|  ¨ΒοδυμΒαςΌβς|  ¨ΒοδυμΒαϊΌβς|  ¨ΒξδΌβςΎ
|  ¨ΒξδΌβςΎ
|  ¨ΒξδΌβςΎ
|<br>
|  ¨Βοο®ρυαμιζιεδίγοξστίηετ¨¦ρυοτ»ΒαςΊΊΒαϊ¦ρυοτ»© ½¦ητΖοοΊΊΒαςΊΊΒαϊΌβς<br>
</div>Interesting.<br>
<br>
* is there any use-case for this method?<br></blockquote><div><br></div><div>We use it often in Rails.</div><div>/div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


* if Bar is not a class nor module, what kind error should be raised?<br></blockquote><div><br></div><div>TypeError: &quot;( is not a class/module&quot;</div><div>/div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


* is qualified_const_get an appropriate name for the function?<br></blockquote><div><br></div><div>Unknown. It&#39;s what we call it in Rails ;)</div><div>/div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


<br>
  ¨Βατϊ®ΌβςΎ
<br>
</blockquote></div><br>

--20cf300face9cad8af04b2ef04e3--