At 02:30 PM 8/31/00 -0500, Christopher J. Madsen wrote: >Peter Scott writes: > > I dunno, maybe a last in a do block whose value is used by > > something should be a syntax error. We're talking about code like > > > > $x += do { $y = get_num; last if $y == 99; $y } while defined $y; > > > > right? *Shudder* > >Yes, but we're also talking about code like > > sub foo { > do { > ... > last unless $x; > ... > } while ($x < 20); > } > >Here, the return value of do is used as the return value of foo, but >we may not actually care what foo returns. Do you want to make that a >syntax error? AFAICT we could make it a syntax error iff foo is not used in void context; Perl must be able to tell whether or not it is used in order to know what context the result is in, right? -- Peter Scott Pacific Systems Design Technologies
- Re: The distinction between "do BL... Jonathan Scott Duff
- Re: The distinction between "do BL... Christopher J. Madsen
- Re: The distinction between "do BL... Jonathan Scott Duff
- Re: The distinction between "do BL... Tom Christiansen
- Re: The distinction between "do BL... Christopher J. Madsen
- Re: The distinction between "do BL... Tom Christiansen
- Re: The distinction between "do BL... Christopher J. Madsen
- do BLOCK as inline sub? (was Re: "... Uri Guttman
- Re: The distinction between "do BLOCK while CON... Peter Scott
- Re: The distinction between "do BLOCK whil... Christopher J. Madsen
- Re: The distinction between "do BLOCK ... Peter Scott
- Re: The distinction between "do BL... Tom Christiansen
- Re: The distinction between "do BL... Chaim Frenkel
- Re: The distinction between "do BL... Tom Christiansen
- Re: The distinction between "do BL... Chaim Frenkel
- Re: The distinction between "do BL... Tom Christiansen
- Re: The distinction between "do BL... Chaim Frenkel
- Re: The distinction between "do BL... Tom Christiansen
- Re: The distinction between "do BL... Chaim Frenkel
- Re: The distinction between "do BL... Tom Christiansen
- Re: The distinction between "do BL... Chaim Frenkel