#perl - Thu 29 Mar 2007 between 16:36 and 16:40



Ani-_avar: GOTO won't work in his case.
LeoNerdleave 3; pop out 3 levels, wherever that takes us
leave "foo"; pop out of the innermost function called "foo"
actionrindolf is not too intelligent to hack the perl5 code.
rindolfis not too intelligent to hack the perl5 code.
actionavar licks Ani-_
avarlicks Ani-_
actionChris62vw kicks avar in the balls
Chris62vwkicks avar in the balls
LeoNerdPerl6's one is even more powereful than that but I don't know how much we could easily do in perl5
avarow Chris62vw !
Ani-_LeoNerd: are you sure the code you gave (the sub ref) as an example is legal?
cfeddebreaks in structure can be convenient. but they should be used with caution.
LeoNerdleave sub { prototype shift eq "($)" };
Chris62vwavar, sorry; I just experienced an "appendage malfunction"
LeoNerd^-- leave the innermost scalar operator :)
Ani-_LeoNerd: as in, what if: my $code; sub foo { $code = sub { leave &foo; }; } $code->(); # when leave is called it isn't in foo()
avarah, the hell?
LeoNerdAni-_: think of leave like a throw
Ani-_: leave is basically a throw, that gets caught by something...
PerlJamlooks like there are more people drinking the perl6 kool-aid :-)
avarcaller.leave(1..3);
LeoNerdThe difference being that you pre-declare you want to catch, whereas everything is a potentially-valid target to be left
rindolfHi PerlJam
avarmm, kool-aid
rindolfPerlJam: I got fired.
LeoNerdI imagine the behaviour for a non-matching leave would be similar to a non-matching throw
cfedderindolf: why's that?
PerlJamrindolf: ouch! What did you do or not do to make that happen?
LeoNerdI.e. fall out of the whole program
cfeddetoo much irc?
PerlJamcfedde: that would have been my first guess :)
cfedde: my second would have been "too much non-work perl"
rindolfPerlJam: well: http://shlomif.livejournal.com/39976.html
avarleave is just to return from stuff that isn't a sub
right?
LeoNerdAni-_: Thing is... there's more subtleness than that... consider in return EXPR; that EXPR knows the context of the calling sub...
avarso says s06
rindolfcfedde: http://shlomif.livejournal.com/39976.html
avarfor 1 .. 5 -> $i { leave if $i == 4 }
japhyif I have a process that spawns a handful of others, how do I make the parent of all of them wait for all of them to exit?
avarwaitpid?
LeoNerdAni-_: But a leave keyword would have to supply the right context to EXPR, which it could only know once it'd found the right callstack to exit from

Page: 3 10 17 24 31 38 45 52 59 66 73 80 87 94 101 108 

IrcArchive