Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Bart Lateur
I don't like the distinction between "anonymous" and other blocks. On Tue, 8 Aug 2000 17:44:56 +0100, Graham Barr wrote: >How usable is this ? > >I may be missing something, but if every variable mentioned in an anonymous >block is assumed to be declared with my, then how do you access or modify

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Nathan Wiger
> > Do you mean the whole thing, or just the `blocks' part? > > Any feature which subverts "use strict" by attempting to declare my > variables for me. In this case -- `blocks'. But also `subs' scope, > since that makes anonymous subs useless. As the RFC notes: =head2 Incompatibility with s

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Nathan Wiger
> while($x) > { > $y += foo($x); > $x = bar($x); > $big_global_variable = analyze($y,$x); > } > > This leaves you with three variables that may or may not be dependent > on the upper scope for resolution by default. As the RFC is written, only *anonymous* blocks are auto-

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Bryan C . Warnock
On Tue, 08 Aug 2000, Nathan Wiger wrote: > There's two ways I see it: > > 1) do {} block > >$val = do { > $x = 10; > # ... stuff happens ... > $y; >}; > > In which case $val = $y. > > 2) explicit our() scoping > >$x = 10; >our $y = 10; >{ > $

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread John Porter
Ariel Scolnicov wrote: > > I rarely use a `now' scope, Well, 'now' is a declaration; the scope is "temporal", aka "dynamic". > Variable declaration is good (except for some trivial programs)! I agree 1000%! -- John Porter

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Ariel Scolnicov
Nathan Wiger <[EMAIL PROTECTED]> writes: [...] > > I, for one, will *never* use such a construct. It provides the user > > with the dangers of `no strict' combined with the illusion of safety > > of `use strict'. > > Do you mean the whole thing, or just the `blocks' part? Any feature which su

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Nathan Wiger
> fluid-let should *really* be called `now'), Agreed (about the `now' part) > Will this also apply to `use scope 'subs''? No. Only subs are affected, which is a clear and easy dividing line I believe. > I, for one, will *never* use such a construct. It provides the user > with the dangers of

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Ariel Scolnicov
Nathan Wiger <[EMAIL PROTECTED]> writes: > > How usable is this ? > > > > I may be missing something, but if every variable mentioned in an anonymous > > block is assumed to be declared with my, then how do you access or modify > > the value of any variable outside the block ? > > > > Graham. >

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Michael Mathews
Graham Barr said: > > Would result in "25" being printed out. Here's why: > > > >1. The C<$x = 10> is automatically scoped with its own C. > > > >2. The C<$x = 5> inside the B block is automatically > > scoped with its own C. > > > >3. The C<$x = 25> code, however, inside the C s

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Nathan Wiger
> How usable is this ? > > I may be missing something, but if every variable mentioned in an anonymous > block is assumed to be declared with my, then how do you access or modify > the value of any variable outside the block ? > > Graham. I knew someone was going to ask this; after I sent it I r

Re: RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Graham Barr
On Tue, Aug 08, 2000 at 02:37:54PM -, Perl6 RFC Librarian wrote: > =head3 blocks > > The C scoping pragma automatically scopes variables to the > innermost B block. The key work here is anonymous. The main > program itself is seen as the outermost block. So, this code: > >$x = 10; >

RFC 64 (v1) New pragma 'scope' to change Perl's defa

2000-08-08 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE New pragma 'scope' to change Perl's default scoping =head1 VERSION Maintainer: Nathan Wiger <[EMAIL PROTECTED]> Date: 07 Aug 2000 Version: 1 Mailing List: [EMAIL PROTECTED] Number: 64 =head1 ABST