Re: Truely temporary variables

2005-04-17 Thread Ashley Winters
On 4/15/05, Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]> wrote: > Aaron Sherman <[EMAIL PROTECTED]> wrote: > > What I'd really like to say is: > > > > throwawaytmpvar $sql = q{...}; > > throwawaytmpvar $sql = q{...}; > > Anything wrong with: > >my $sql = q{...}; >temp $sql

Re: Truely temporary variables

2005-04-17 Thread Darren Duncan
At least for the usage described in this thread, I don't see any need at all to add new syntax to Perl 6. The existing syntax provides for a much simpler solution yet, which also is in Perl 5. This is the format of what I do to solve the same problem right now in my Locale::KeyedText test suit

Re: Truely temporary variables

2005-04-17 Thread Juerd
Aaron Sherman skribis 2005-04-17 18:23 (-0400): > On Fri, 2005-04-15 at 18:04 +0200, Juerd wrote: > > > throwawaytmpvar $sql = q{...}; > > > throwawaytmpvar $sql = q{...}; > > I like the idea and propose "a", aliased "an" for this. > Too short. There is a rule of thumb, I don't know who came

Re: Truely temporary variables

2005-04-17 Thread Aaron Sherman
On Fri, 2005-04-15 at 18:04 +0200, Juerd wrote: > Aaron Sherman skribis 2005-04-15 11:45 (-0400): > > What I'd really like to say is: > > throwawaytmpvar $sql = q{...}; > > throwawaytmpvar $sql = q{...}; > > I like the idea and propose "a", aliased "an" for this. Too short. Having such a

Re: Truely temporary variables

2005-04-15 Thread Aaron Sherman
On Fri, 2005-04-15 at 13:10, Luke Palmer wrote: > Aaron Sherman writes: > > Among the various ways of declaring variables, will Perl 6 have a way to > > say, "this variable is highly temporary, and may be re-declared within > > the same scope, or in a nested scope without concern"? I often find > >

Re: Truely temporary variables

2005-04-15 Thread chromatic
On Fri, 2005-04-15 at 11:21 -0500, Patrick R. Michaud wrote: > On Fri, Apr 15, 2005 at 09:17:13AM -0700, Larry Wall wrote: > > Maybe we could define an "ok" operator that suppresses only the > > *first* warning produced by its argument(s). Then if you get multiple > > warnings, you at least get

Re: Truely temporary variables

2005-04-15 Thread Juerd
Brent 'Dax' Royal-Gordon skribis 2005-04-15 11:15 (-0700): > Anything wrong with: Yes, moving things around breaks it, as does removing the first. There is no real dependency on the first $sql and it'd be great if declaration wouldn't add one. temp $sql = q{...}; my $sql = q{...}; temp $

Re: Truely temporary variables

2005-04-15 Thread Brent 'Dax' Royal-Gordon
Aaron Sherman <[EMAIL PROTECTED]> wrote: > What I'd really like to say is: > > throwawaytmpvar $sql = q{...}; > throwawaytmpvar $sql = q{...}; Anything wrong with: my $sql = q{...}; temp $sql = q{...}; temp $sql = q{...}; (Assuming C is made to work on lexicals, of cours

Re: Truely temporary variables

2005-04-15 Thread Luke Palmer
Aaron Sherman writes: > Among the various ways of declaring variables, will Perl 6 have a way to > say, "this variable is highly temporary, and may be re-declared within > the same scope, or in a nested scope without concern"? I often find > myself doing: > > my $sql = q{...}; > ...do

Re: Truely temporary variables

2005-04-15 Thread Juerd
Rod Adams skribis 2005-04-15 11:53 (-0500): > Wouldn't some form of trait make more sense: >my $sql = '...' is ok; Depends. A unary ok operator would let you pinpoint very easily, *without* using parens: ok $fh.print($foo); # no warnings about print (closed fh?) #

Re: Truely temporary variables

2005-04-15 Thread Rod Adams
Larry Wall wrote: On Fri, Apr 15, 2005 at 06:04:32PM +0200, Juerd wrote: : No, Ucfirst it can't be, I think. And ALLCAPS is ugly. @ is taken (and : ugly). Suggestions? Maybe we could define an "ok" operator that suppresses only the *first* warning produced by its argument(s). Then if you get multi

Re: Truely temporary variables

2005-04-15 Thread Patrick R. Michaud
On Fri, Apr 15, 2005 at 09:17:13AM -0700, Larry Wall wrote: > On Fri, Apr 15, 2005 at 06:04:32PM +0200, Juerd wrote: > : No, Ucfirst it can't be, I think. And ALLCAPS is ugly. @ is taken (and > : ugly). Suggestions? > > Maybe we could define an "ok" operator that suppresses only the > *first* warn

Re: Truely temporary variables

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 06:04:32PM +0200, Juerd wrote: : No, Ucfirst it can't be, I think. And ALLCAPS is ugly. @ is taken (and : ugly). Suggestions? Maybe we could define an "ok" operator that suppresses only the *first* warning produced by its argument(s). Then if you get multiple warnings, you

Re: Truely temporary variables

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 11:45:16AM -0400, Aaron Sherman wrote: : Among the various ways of declaring variables, will Perl 6 have a way to : say, "this variable is highly temporary, and may be re-declared within : the same scope, or in a nested scope without concern"? I often find : myself doing: :

Re: Truely temporary variables

2005-04-15 Thread Juerd
Aaron Sherman skribis 2005-04-15 11:45 (-0400): > What I'd really like to say is: > throwawaytmpvar $sql = q{...}; > throwawaytmpvar $sql = q{...}; I like the idea and propose "a", aliased "an" for this. > It should probably be illegal to: > throwawaytmpvar $sql = q{...}; >

Truely temporary variables

2005-04-15 Thread Aaron Sherman
Among the various ways of declaring variables, will Perl 6 have a way to say, "this variable is highly temporary, and may be re-declared within the same scope, or in a nested scope without concern"? I often find myself doing: my $sql = q{...}; ...do some DB stuff... my $sql