From: Yehuda Katz Date: 2009-02-25T02:48:43+09:00 Subject: [ruby-core:22422] Re: YASNP (Yet Another Selector Namespace Proposal) --001636ed63f40f101a0463adbd30 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Matz, I'm fairly amused by your response. If you go back to my very first post on this topic, the OP was for file-based selector namespaces. Charlie had already hacked together a working implementation before the discussion on this list. I agree entirely that using a block is not ideal, because it's not *actually* a block (and might make people think there are block semantics involved when there aren't actually any). The alternative I proposed (using class/method/while syntax to lexically enclose the code to use the namespace) is acceptable to me, but more granular than I think will actually be used in real life. The salient part of my proposal is that the heavy lifting could be done at parse-time (a special call node that remembers the namespace or a special call instruction with the namespaces in it when compiled) and then cached, so that a namespaced call would be roughly the same speed (and cachability) as a regular method call. -- Yehuda 2009/2/24 Yukihiro Matsumoto > Hi, > > In message "Re: [ruby-core:22322] Re: YASNP (Yet Another Selector Namespace > Proposal)" > on Sun, 22 Feb 2009 11:35:41 +0900, Aaron Patterson < > aaron@tenderlovemaking.com> writes: > > |+1 as well, but I like the block. For me, it seems to be more clear as > |to what is going on. > | > | use Merb::String => String do > | "bla blah".some_special_merb_only_method > | end > | > | "bla blah".some_special_merb_only_method # => doh! doesn't exist > > +1 to have some kind of selector namespace (it's planned for 2.0 > anyway), but -1 for using block (or block-like syntax) to denote > namespace scope, because > > * it's not really a block > * too small granularity for namespace switching might bring confusion > > I'd prefer per file namespace switching. > > > matz. > > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 --001636ed63f40f101a0463adbd30 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Matz,

I'm fairly amused by your response. If you go back to my v= ery first post on this topic, the OP was for file-based selector namespaces= . Charlie had already hacked together a working implementation before the d= iscussion on this list.

I agree entirely that using a block is not ideal, because it's not = *actually* a block (and might make people think there are block semantics i= nvolved when there aren't actually any). The alternative I proposed (us= ing class/method/while syntax to lexically enclose the code to use the name= space) is acceptable to me, but more granular than I think will actually be= used in real life.

The salient part of my proposal is that the heavy lifting could be done= at parse-time (a special call node that remembers the namespace or a speci= al call instruction with the namespaces in it when compiled) and then cache= d, so that a namespaced call would be roughly the same speed (and cachabili= ty) as a regular method call.

-- Yehuda

2009/2/24 Yukihiro Matsumot= o <matz@ruby-lan= g.org>
Hi,

In message "Re: [ruby-core:22322] Re: YASNP (Yet Another Selector Name= space =A0 =A0 Proposal)"
=A0 =A0on Sun, 22 Feb 2009 11:35:41 +0900, Aaron Pat= terson <aaron@tenderlovema= king.com> writes:

|+1 as well, but I like the block. =A0For me, it seems to be more clear as<= br> |to what is going on.
|
| =A0use Merb::String =3D> String do
| =A0 =A0"bla blah".some_special_merb_only_method
| =A0end
|
| =A0"bla blah".some_special_merb_only_method # =3D> doh! =A0d= oesn't exist

+1 to have some kind of selector namespace (it's planned for 2.0<= br> anyway), but -1 for using block (or block-like syntax) to denote
namespace scope, because

=A0* it's not really a block
=A0* too small granularity for namespace switching might bring confusion
I'd prefer per file namespace switching.


=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0matz.




--
Yehuda Katz
Develope= r | Engine Yard
(ph) 718.877.1325
--001636ed63f40f101a0463adbd30--