From: Yehuda Katz Date: 2009-02-25T03:12:26+09:00 Subject: [ruby-core:22424] Re: YASNP (Yet Another Selector Namespace Proposal) --000e0cd32e3e4653f50463ae123f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I don't think it's important that it be at the top of the file, but it does need to be a keyword. -- Yehuda 2009/2/24 Charles Oliver Nutter > Yukihiro Matsumoto wrote: > >> +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. >> > > I think it's impossible to have per-file without making "use" a special > keyword, ideally at the top of the file. The block syntax made more sense to > me because I knew exactly when it started and ended, and a 'use' later in > the file did not affect code that came before it. Also, the example where I > have both a namespace and a 'use' in the same file would be impossible if > the use applied to the whole file. > > I'm willing to mock up anything else we want to try, including a whole-file > version. > > - Charlie > > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 --000e0cd32e3e4653f50463ae123f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I don't think it's important that it be at the top of the file, but= it does need to be a keyword.

-- Yehuda

2009/2/24 Charles Oliver Nutter <charles.nutter@sun.com>
Yukihiro Matsumoto wrote:
+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

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

I think it's impossible to have per-file without making "use"= a special keyword, ideally at the top of the file. The block syntax made m= ore sense to me because I knew exactly when it started and ended, and a = 9;use' later in the file did not affect code that came before it. Also,= the example where I have both a namespace and a 'use' in the same = file would be impossible if the use applied to the whole file.

I'm willing to mock up anything else we want to try, including a whole-= file version.

- Charlie




--
Yehuda Katz
Develope= r | Engine Yard
(ph) 718.877.1325
--000e0cd32e3e4653f50463ae123f--