--001636e0a64a68cb3a04634ac638
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

2009/2/19 Florian Gilcher <flo / andersground.net>

>
> On Feb 19, 2009, at 8:15 AM, Charles Oliver Nutter wrote:
>
>  Charles Oliver Nutter wrote:
>>
>>> Caveats:
>>> * HACKHACKHACK
>>> * Only works for single-arg "call" in this case, but easy to generalize
>>> to all other calls
>>> * The namespace never gets turned off in this example. It wouldn't be
>>> hard to add with parser help, but there's no trigger I can use in this
>>> simple version.
>>> * Interpreter-only. Compilation would be a bit trickier, but not much.
>>>
>>
>> Another important one:
>>
>> * This version searches the namespace for the method *unconditionally*. It
>> would probably be desirable to identify whether it applies to the receiver
>> or not:
>>
>> use String Merb::String
>>
>> And then the namespace association only applies when the receiver is_a?
>> String.
>>
>> - Charlie
>>
>>
>
> That sounds a lot like the Objective-C method poseAs, discarding some of
> it's limitations.
>
> But what is the scope of use? AFAIK, there is no construct in Ruby that has
> a file-only scope (except the ones that need to be closed because of
> syntactical reasons). Granted, those are details.


I would be open to making it take a block, but I'm not aware of any use-case
where that would be helpful, so I left it out at the beginning to reduce the
need for extra ceremony.


>
>
> But what about this example in Yehudas gist:
>
> 
> # require "my_app3", :use Merb::String
>
> "hello_goodbye".camel_case #"HelloGoodbye"
> "hello_goodbye".camel_case(true) #ArgumentError
> 
>
> Making it externally controllable which class a file uses is at least
> discussable. I don't like it, especially because it is not really fitting in
> Rubys way of not seeing files as program units.


Again, I'm open to doing it a different way. I chose this initially because
it makes it easier to implement at parse-time (which is required for
performance) and because I can't think of any use-case where more granular
application of namespaces would actually be useful, but I'd be fine with
"use" taking a block if it moved the proposal forward.


> Also, only one parametrization can be in place at once, which smells like a
> source of conflicts.


"only one parametrization can be in place at once" -- I don't understand
what you mean by this.


>
>
> Regards,
> Florian Gilcher
>
> --
> Florian Gilcher
>
> smtp:   flo / andersground.net
> jabber: Skade / jabber.ccc.de
> gpg:    533148E2
>
>
>


-- 
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325

--001636e0a64a68cb3a04634ac638
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br><div class="gmail_quote">2009/2/19 Florian Gilcher <span dir="ltr">&lt;flo / andersground.net&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c"><br>
On Feb 19, 2009, at 8:15 AM, Charles Oliver Nutter wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Charles Oliver Nutter wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Caveats:<br>
* HACKHACKHACK<br>
* Only works for single-arg &quot;call&quot; in this case, but easy to generalize to all other calls<br>
* The namespace never gets turned off in this example. It wouldn&#39;t be hard to add with parser help, but there&#39;s no trigger I can use in this simple version.<br>
* Interpreter-only. Compilation would be a bit trickier, but not much.<br>
</blockquote>
<br>
Another important one:<br>
<br>
* This version searches the namespace for the method *unconditionally*. It would probably be desirable to identify whether it applies to the receiver or not:<br>
<br>
use String =&gt; Merb::String<br>
<br>
And then the namespace association only applies when the receiver is_a? String.<br>
<br>
- Charlie<br>
<br>
</blockquote>
<br>
<br></div></div>
That sounds a lot like the Objective-C method poseAs, discarding some of it&#39;s limitations.<br>
<br>
But what is the scope of use? AFAIK, there is no construct in Ruby that hasile-only scope (except the ones that need to be closed because of syntactical reasons). Granted, those are details.</blockquote><div><br>I would be open to making it take a block, but I&#39;m not aware of any use-case where that would be helpful, so I left it out at the beginning to reduce the need for extra ceremony.<br>
&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
But what about this example in Yehudas gist:<br>
<br>
===<br>
# require &quot;my_app3&quot;, :use =&gt; Merb::String<div class="Ih2E3d"><br>
<br>
&quot;hello_goodbye&quot;.camel_case #=&gt; &quot;HelloGoodbye&quot;<br></div>
&quot;hello_goodbye&quot;.camel_case(true) #=&gt; ArgumentError<br>
===<br>
<br>
Making it externally controllable which class a file uses is at least discussable. I don&#39;t like it, especially because it is not really fitting inubys way of not seeing files as program units. </blockquote><div><br>
Again, I&#39;m open to doing it a different way. I chose this initially because it makes it easier to implement at parse-time (which is required for performance) and because I can&#39;t think of any use-case where more granular application of namespaces would actually be useful, but I&#39;d be fine with &quot;use&quot; taking a block if it moved the proposal forward.<br>
&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Also,nly one parametrization can be in place at once, which smells like a source of conflicts.</blockquote>
<div><br>&quot;only one parametrization can be in place at once&quot; -- I don&#39;t understand what you mean by this.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
Regards,<br>
Florian Gilcher<br><font color="#888888">
<br>
--<br>
Florian Gilcher<br>
<br>
smtp: &nbsp; <a href="mailto:flo / andersground.net" target="_blank">flo / andersground.net</a><br>
jabber: <a href="mailto:Skade / jabber.ccc.de" target="_blank">Skade / jabber.ccc.de</a><br>
gpg: &nbsp; &nbsp;533148E2<br>
<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Yehuda Katz<br>Developer | Engine Yard<br>(ph) 718.877.1325<br>

--001636e0a64a68cb3a04634ac638--