[svn:parrot-pdd] r33695 - in trunk: . compilers/imcc compilers/pct/src/PCT config/gen/makefiles docs docs/pdds include/parrot languages/WMLScript/src languages/lua languages/lua/src/lib languages/perl

2008-12-08 Thread allison
Author: allison
Date: Mon Dec  8 21:16:33 2008
New Revision: 33695

Modified:
   trunk/docs/pdds/pdd22_io.pod

Changes in other areas also in this revision:
Added:
   trunk/src/io/core.c
  - copied unchanged from r33691, /branches/pdd22io_part2/src/io/core.c
   trunk/src/io/socket_api.c
  - copied unchanged from r33691, 
/branches/pdd22io_part2/src/io/socket_api.c
   trunk/src/io/socket_unix.c
  - copied unchanged from r33691, 
/branches/pdd22io_part2/src/io/socket_unix.c
   trunk/src/io/socket_win32.c
  - copied unchanged from r33691, 
/branches/pdd22io_part2/src/io/socket_win32.c
   trunk/src/io/utf8.c
  - copied unchanged from r33691, /branches/pdd22io_part2/src/io/utf8.c
Removed:
   trunk/src/io/io.c
   trunk/src/io/io_buf.c
   trunk/src/io/io_layers.c
   trunk/src/io/io_passdown.c
   trunk/src/io/io_stdio.c
   trunk/src/io/io_unix.c
   trunk/src/io/io_utf8.c
   trunk/src/io/io_win32.c
   trunk/src/io/unix_socket.c
   trunk/src/io/win32_socket.c
   trunk/src/pmc/parrotio.pmc
Modified:
   trunk/MANIFEST
   trunk/compilers/imcc/instructions.c
   trunk/compilers/imcc/main.c
   trunk/compilers/imcc/parser_util.c
   trunk/compilers/imcc/pbc.c
   trunk/compilers/pct/src/PCT/HLLCompiler.pir
   trunk/config/gen/makefiles/root.in
   trunk/docs/tests.pod
   trunk/include/parrot/io.h
   trunk/include/parrot/string_funcs.h
   trunk/languages/WMLScript/src/wmlsstdlibs.pir
   trunk/languages/lua/luac2pir.pir
   trunk/languages/lua/luad.pir
   trunk/languages/lua/src/lib/luaaux.pir
   trunk/languages/lua/src/lib/luaperl.pir
   trunk/languages/perl6/src/classes/Object.pir
   trunk/src/debug.c
   trunk/src/dynoplibs/myops.ops
   trunk/src/embed.c
   trunk/src/events.c
   trunk/src/exceptions.c
   trunk/src/extend.c
   trunk/src/gc/dod.c
   trunk/src/gc/register.c
   trunk/src/global.c
   trunk/src/inter_create.c
   trunk/src/interpreter.c
   trunk/src/io.c
   trunk/src/io/api.c
   trunk/src/io/buffer.c
   trunk/src/io/io_private.h
   trunk/src/io/unix.c
   trunk/src/io/win32.c
   trunk/src/jit.c
   trunk/src/malloc.c
   trunk/src/multidispatch.c
   trunk/src/oo.c
   trunk/src/ops/io.ops
   trunk/src/ops/ops.num
   trunk/src/packdump.c
   trunk/src/packfile.c
   trunk/src/packfile/pf_items.c
   trunk/src/packout.c
   trunk/src/pbc_merge.c
   trunk/src/pdump.c
   trunk/src/pmc/coroutine.pmc
   trunk/src/pmc/filehandle.pmc
   trunk/src/pmc/pccmethod_test.pmc
   trunk/src/pmc/sub.pmc
   trunk/src/pmc/unmanagedstruct.pmc
   trunk/src/runops_cores.c
   trunk/src/spf_vtable.c
   trunk/src/stacks.c
   trunk/src/stm/backend.c
   trunk/src/string.c
   trunk/src/sub.c
   trunk/src/thread.c
   trunk/src/trace.c
   trunk/src/warnings.c
   trunk/t/compilers/imcc/syn/op.t
   trunk/t/op/interp.t
   trunk/t/op/string_cs.t
   trunk/t/op/stringu.t
   trunk/t/pmc/filehandle.t
   trunk/t/pmc/io.t
   trunk/t/pmc/parrotio.t
   trunk/t/src/basic.t
   trunk/t/src/compiler.t
   trunk/t/src/exit.t
   trunk/t/src/extend.t
   trunk/t/src/warnings.t
   trunk/t/steps/auto_pmc-01.t

Log:
[pdd22io] Merging the pdd22io_part2 branch into trunk for r32922 to r33687.


Modified: trunk/docs/pdds/pdd22_io.pod
==
--- trunk/docs/pdds/pdd22_io.pod(original)
+++ trunk/docs/pdds/pdd22_io.podMon Dec  8 21:16:33 2008
@@ -250,6 +250,15 @@
 Accessor (get only) for the I/O stream's read mode. This returns the mode
 string used to open the I/O stream.
 
+=item C
+
+  $S0 = $P1.encoding()
+  $P0.encoding($S1)
+
+Accessor (get and set) for the I/O stream's encoding attribute. Currently,
+the only valid value to set is 'utf8' which turns on UTF-8 reading/writing
+mode for the stream. The default behavior is fixed-width 8-bit characters.
+
 =item C [RT #48312]
 
   $I0 = $P1.get_fd()


[svn:parrot-pdd] r33688 - trunk/docs/pdds

2008-12-08 Thread allison
Author: allison
Date: Mon Dec  8 19:45:45 2008
New Revision: 33688

Modified:
   trunk/docs/pdds/pdd15_objects.pod

Log:
[pdd] Caught documented name inconsistent with implemented name.


Modified: trunk/docs/pdds/pdd15_objects.pod
==
--- trunk/docs/pdds/pdd15_objects.pod   (original)
+++ trunk/docs/pdds/pdd15_objects.pod   Mon Dec  8 19:45:45 2008
@@ -297,7 +297,7 @@
 
 =over 4
 
-=item new()
+=item instantiate()
 
 Instantiate a new object from the class. Set the instantiated flag on the
 class.


Out of CONTROL...?

2008-12-08 Thread Patrick R. Michaud
A very interesting question came up on #perl today, so I'm
forwarding it to p6l for discussion/decision.

Given the following code:

sub foo() { return 1; }
sub bar() { warn "oops"; }

{
CONTROL { ... }
foo();
bar();
}

S04 seems to clearly indicate that the CONTROL block above would 
be invoked by the C exception thrown by bar().  The #perl6
question is, do the same semantics apply for C -- i.e., 
would the return exception thrown in foo() also invoke the 
CONTROL block in the caller?

Both interpretations have validity, which is why I'm bringing
it here for further reflection and guidance.

Pm


Re: Files, Directories, Resources, Operating Systems

2008-12-08 Thread Mark Overmeer
* Aristotle Pagaltzis ([EMAIL PROTECTED]) [081208 19:16]:
> * Mark Overmeer <[EMAIL PROTECTED]> [2008-12-07 14:20]:
> > So why are you all so hessitating in making each other's life
> > easier? There is no 100% solution, but 0% is even worse!
> 
> It looks like Python 3000 just tried that.
> People are not happy about it:
> http://utcc.utoronto.ca/~cks/space/blog/python/OsListdirProblem

I thought we were having a serious discussion.  We all know that
considering all names as Unicode is a stupid presumption.

It seems that some bright minds got stuck in a deep recursion about
codesets in file- and directory names.  A pitty that we do not
focus on the general concept of OS abstraction (knowing that some
problems are only partially solvable (on the moment)).
-- 
   MarkOv


   Mark Overmeer MScMARKOV Solutions
   [EMAIL PROTECTED]  [EMAIL PROTECTED]
http://Mark.Overmeer.net   http://solutions.overmeer.net



Re: Files, Directories, Resources, Operating Systems

2008-12-08 Thread Leon Timmermans
On Mon, Dec 8, 2008 at 8:16 PM, Aristotle Pagaltzis <[EMAIL PROTECTED]> wrote:
> It looks like Python 3000 just tried that.
>
> People are not happy about it:
> http://utcc.utoronto.ca/~cks/space/blog/python/OsListdirProblem
>

Yeeh, I also noted exactly that problem when reading the "What's New
In Python 3.0". What were they thinking?!

Leon


Re: Files, Directories, Resources, Operating Systems

2008-12-08 Thread Aristotle Pagaltzis
* Mark Overmeer <[EMAIL PROTECTED]> [2008-12-07 14:20]:
> So why are you all so hessitating in making each other's life
> easier? There is no 100% solution, but 0% is even worse!

It looks like Python 3000 just tried that.

People are not happy about it:
http://utcc.utoronto.ca/~cks/space/blog/python/OsListdirProblem

Regards,
-- 
Aristotle Pagaltzis // 


Re: [perl #61126] return should apply to the lexically enclosing routine, map is no exception

2008-12-08 Thread Carl Mäsak
Daniel (>), Carl (>>):
>> That is all good and well for exiting the map itself; but what I want
>> to achieve is to exit the surrounding sub or method block. Example:
>
> Er... I mean actually the opposite... it should always return from the
> surrounding sub or method, never only from "map", if you want to "end"
> the map loop, you should use "last"... meaning...
>
> sub foo {
>   map { last; }, 1, 2, 3; # executes the block only once
>   map { return; }, 1, 2, 3; # returns from &foo;
> }

Ok, I realize I've been misunderstanding both your bug report and your
stated opinion when we talked about this on #perl6 the other day. I
thought you wanted 'return' inside a map block to act as if it were
within an invisible sub body (making both snippets of code in the
ticket return 2 instead of 1). Your actual request makes much more
sense. :)

As a plus side, I now suddenly understand what you mean by 'return'
being lexically bound. That's both DWIMmy and cool.

// Carl


[Parrot] New comment on Episode 3: Squaak Details and First Steps.

2008-12-08 Thread kjs
kjs has left a new comment on your post "Episode 3: Squaak Details and
First Steps":

srottak: You should check the action method definitions in the
action.pm file. Please note that each {*} indicates an invocation to an
action method that has the same name as the rule in which the {*}
occurs. Please check the parameter lists of these methods; apparently,
there's a parameter/argument mismatch.



Posted by kjs to Parrot at December 8, 2008 2:42 AM

[perl #61154] [TODO] Compiler - compreg disabled/imcc_compile_pir() not exported

2008-12-08 Thread via RT
# New Ticket Created by  Ben Marsh 
# Please include the string:  [perl #61154]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=61154 >


The test in t/src/compiler.t is being skipped with comment 'compreg
disabled/imcc_compile_pir() not exported'.  I would suggest that the 
problem is more likely with imcc_compile_pir because the compreg thing 
is called in other tests that are not skipped.


Re: [perl #61130] :nth() does not work with :x() or :g in .subst in Rakudo

2008-12-08 Thread Patrick R. Michaud
On Sun, Dec 07, 2008 at 03:09:30PM -0800, Moritz Lenz via RT wrote:
> > ...but not :x() together with :nth()...
> > 
> > $ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :x(2),
> > :nth(2))' # expected foo1bar2foo3bar4
> > foo1bar2foo3foo4
> > 
> > The above are my personal expectations. The current version of S05 is
> > silent on how :nth() interacts with :x() and :g. There are spectests
> > for :g:nth but not (as far as I can see) for :x:nth.
> 
> Since your personal expectations are the same as mine, I took the liberty to
> turn our expectations into spec tests, in
> t/spec/S05-substitution/subst.t (pugs r24207).
> 
> The reasoning behind it is quite simple: I imagine :g to mean the same as
> :x(*). Now a :x($x) and :nth($n) interact like this:
> 
> for 1 .. $x {
> match here
> if ($x-1) % $n == 0 {
> do substitution
> }
> }
> 
> (CC'ing p6l, since it defines language semantics, albeit just a bit)

The problem with this reasoning is that :nth doesn't have to be an 
integer -- S05 also allows things like

:nth(1,2,3,5,8,13)
:nth({.is_fibonacci})

It's not immediately obvious how those forms of :nth would interact 
with :x or :g.

The way to do something like "replace every 3rd occurrence" would
seem to be to do things like:

:nth({ $_ % 3 == 0 })
:nth(3..*:by(3))

Another problem is that :x($n) specifies "perform $n substitutions",
such that if we say :x(4) and there aren't four things to substitute,
then none of the substitutions take place.

At the moment I think that :x specifies a constraint on the
total number of substitutions that are (must be) performed,
while :nth selects the candidate matches to be substituted.
Thus

.subst( $pat, $rep, :nth(1,4,9,16,25,36), :x(4) )

would perform substitutions on the 1st, 4th, 9th, and 16th matches,
and do nothing if at least sixteen matches were not found.

Pm


Re: [perl #41095] [BUG] Segfault in test.exe during Configuration

2008-12-08 Thread Nikolay Ananiev

Windows 2000 SP4
Visual Studio 2003 SP1

The hardware is:
Pentium MMX (586) with 128mb ram.

The problem with the test file is that it does not work reliably for the
processors that do not support the fcomip cpu instruction (586 and earlier). 
I tried to fix this myself by using
CPUID, but I don't have enough knowledge and also I don't know how to handle 
the non-x86 CPUs (because they

don't support CPUID).

- Original Message - 
From: "Will Coleda" <[EMAIL PROTECTED]>

To: "Nikolay Ananiev" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, December 07, 2008 6:57 PM
Subject: Re: [perl #41095] [BUG] Segfault in test.exe during Configuration



Thanks - can you also let us know the following:

What version of windows are you using?

Which compiler (including version)?

On Sat, Dec 6, 2008 at 11:47 AM, Nikolay Ananiev <[EMAIL PROTECTED]> 
wrote:

Tested with r33568. The bug is still there.

- Original Message - From: "Will Coleda via RT"
<[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 03, 2008 10:00 PM
Subject: [perl #41095] [BUG] Segfault in test.exe during Configuration


Can someone test this with a recent parrot?

Based on a recent conversation on list, we should probably start getting
OS / Compiler versions as well with bug reports.

On Wed Apr 16 14:58:24 2008, [EMAIL PROTECTED] wrote:


Confirmed. This bug is still there as of r27009

"Nikolay Ananiev" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'll be able to test Parrot in the next 48 hours
> on my pentium mmx and tell you what the result is.
>
> - Original Message - > From: "James Keenan via RT"
> <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 14, 2008 5:36 AM
> Subject: [perl #41095] [BUG] Segfault in test.exe during


Configuration


>
> Jonathan:  Do you know if we've overcome this problem?
>
> Thank you very much.
>
> kid51
>





--
Will "Coke" Coleda






--
Will "Coke" Coleda 




[Parrot] New comment on Episode 3: Squaak Details and First Steps.

2008-12-08 Thread ChrisDolan
ChrisDolan has left a new comment on your post "Episode 3: Squaak
Details and First Steps":

srottak: I'll bet that #57864: Calling a token "text", "null" or "ws"
in Rakudo makes matching fail is the cause.



Posted by ChrisDolan to Parrot at December 7, 2008 9:10 PM

[perl #61130] :nth() does not work with :x() or :g in .subst in Rakudo

2008-12-08 Thread Moritz Lenz via RT
On Sun Dec 07 07:24:07 2008, masak wrote:
> The .subst method in Rakudo r33599 can understand :x()...
> 
> $ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :x(2))' # yes
> bar1bar2foo3foo4
> 
> ...and :nth()...
> 
> $ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :nth(2))' # yes
> foo1bar2foo3foo4
> 
> ...and :g...
> 
> $ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :g)' # yes
> bar1bar2bar3bar4
> 
> ...but not :x() together with :nth()...
> 
> $ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :x(2),
> :nth(2))' # expected foo1bar2foo3bar4
> foo1bar2foo3foo4
> 
> ...and not :g together with :nth().
> 
> $ perl6 -e 'say "foo1foo2foo3foo4".subst("foo", "bar", :g, :nth(2))' #
> expected foo1bar2foo3bar4
> foo1bar2foo3foo4
> 
> The above are my personal expectations. The current version of S05 is
> silent on how :nth() interacts with :x() and :g. There are spectests
> for :g:nth but not (as far as I can see) for :x:nth.

Since your personal expectations are the same as mine, I took the liberty to
turn our expectations into spec tests, in
t/spec/S05-substitution/subst.t (pugs r24207).

The reasoning behind it is quite simple: I imagine :g to mean the same as
:x(*). Now a :x($x) and :nth($n) interact like this:

for 1 .. $x {
match here
if ($x-1) % $n == 0 {
do substitution
}
}

(CC'ing p6l, since it defines language semantics, albeit just a bit)



[perl #61136] [TODO] Implement .ACCEPT for Match class.

2008-12-08 Thread via RT
# New Ticket Created by  Vasily Chekalkin 
# Please include the string:  [perl #61136]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=61136 >


Hello.

Simple example

[EMAIL PROTECTED]:~/src/xquery$ cat m.pl
token a { 'a' };
token b { 'b' };
rule Foo {  |  };

'b' ~~ /  /;
given $/ {
when . { say "a"; };
when . { say "b"; };
};


[EMAIL PROTECTED]:~/src/xquery$ perl6 m.pl
Method 'ACCEPTS' not found for invocant of class 'PGE;Match'


 is it legal syntax?
 or I always should use if/elsif/else?
 bacek: yes, but until you match your regex you won't get any
meaningful result
 perl6: token a { 'a' }; token b { 'b' }; rule Foo {  |  };
'b'~~ /  /; given $/ { when . { say "a"; }; when . { say
"b"; }; };
 rakudo 33630: OUTPUT[Method 'ACCEPTS' not found for invocant of
class 'PGE;Match'␤current instr.: 'infix:~~' pc 14429
(src/builtins/match.pir:18)␤]
 ..pugs: OUTPUT[Error eval perl5: "if
(!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤unshift @INC,
'/home/evalenv/pugs/perl5/Pugs-Compiler-Rule/lib';␤unshift @INC,
'/home/evalenv/pugs/third-party/Parse-Yapp/lib';␤eval q[require
'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runti...
 ..elf 24206: OUTPUT[Can't locate object method "cb__RegexDef" via package
"EmitSimpleP5" at ./elf_f line 1612.␤]
 moritz_: thanks
 looks like another TODO ticket for rakudo.
 let me check the S03 smart match table first...
 yes, Any .foo - method truth



-- 
Best regards
Vasily Chekalkin



Parrot Bug Summary

2008-12-08 Thread Parrot Bug Summary
Parrot Bug Summary

http://rt.perl.org/rt3/NoAuth/parrot/Overview.html
Generated at Mon Dec 8 14:00:01 2008 GMT
---

  * Numbers
  * New Issues
  * Overview of Open Issues
  * Ticket Status By Version
  * Requestors with most open tickets

---

Numbers

Ticket Counts: 36 new + 548 open = 584
Created this week: 8
Closed this week: 32

---

New Issues

New issues that have not been responded to yet

1 - 2 weeks old
60940 Test failure: t/dynpmc/foo.t
60798 [BUG] [META] Lack of 'To:' header may impede deliverability of email
2 - 3 weeks old
60658 Broken links to Glossary and Patch & Bug Report Submission Information
60652 Lexicals and :outer not Thawed Properly from PBC
60650 Lexical Associations Not Thawed with Tailcalls
60640 Exception Handlers won't automatically be disabled
60632 [TODO] codingstd: No line splitting in CONST_STRING
3 - 4 weeks old
60608 [PATCH] Fix install when libdir is different from "$prefix/lib"
60590 Bytecode packfile segment will use subid not sub name
60578 parrot.org: add link for reporting problems to each page
4 - 5 weeks old
60338 [BUG] NCI segfaults with null pcc_params_signature
5 - 6 weeks old
60206 [BUG] [MMD] Segfault in Lua exception handler
6 - 7 weeks old
7 - 8 weeks old
59978 [TODO] Add SVN revision number of reports to Smolder front page
8 - 9 weeks old
59696 [TODO] Unimplemented Unicode Functions
9 - 10 weeks old
10 - 11 weeks old
11 - 12 weeks old
58990 [TODO] Design new spec coverage mechanism
12 - 13 weeks old
58740 [CAGE] t/configure/*.t and t/steps/*.t: Cleanup test setup/teardown code 
13 - 14 weeks old
58672 [TODO] implement method lookup iterators
58488 crashing parrot when calling create_lexinfo
14 - 15 weeks old
15 - 16 weeks old
58324 Build issues on WXP
58188 [TODO] Parrot_find_encoding_converter
58070 [RFC] Disallow .local declarations in long-style call statement
16 - 17 weeks old
58050 Segfault in "make testr" for t/compilers/imcc/syn/hll.t:2
17 - 18 weeks old
57680 [CAGE] Problems in find_write_record
57678 [CAGE] Poor Man's Deadlock Detection
57676 [CAGE] Check for shared status of STM handle
18 - 19 weeks old
19 - 20 weeks old
57236 [TODO] pbc_to_exe --install pbc1 [pbc2...]
20 - 21 weeks old
---

Overview of Open Issues

Platform   Severity   Tag   Lang
aix   0abandoned 05005threads   0   Amber   0
All   1fatal 1bounce0   BASIC   0
bsdos 0High  0Bug  96   bc  0
cygwin2low   1compiler  0   befunge 0
cygwin_nt 0medium1configure 3   bf  0
darwin8none  1core  2   cola0
dec_osf   0Normal1dailybuild0   forth   0
dgux  0unknown   0docs  3   jako0
dos   0Wishlist  3duplicate 0   Lisp0
dynixptx  0  install   2   lolcode 0
freebsd   5   library   0   m4  0
generic   0   notabug   0   ook 0
gnu   0   notok 0   perl6   1
HPUX  0   ok0   plot0
irix  0   Patch30   punie   0
irix640   regex 2   pynie   0
Linux 2   sendToCPAN0   python  0
lynxos0   Todo249   ruby0
mac   0   unknown   0   scheme  0
machten   0   utilities 0   tcl 0
macos 0   wontfix   0   urm 0
MacOS X   8Zcode   0
mswin32   2
netbsd1
next  0
openbsd   1
os2   0
os390 0
other 0
powerux   0
qnx   0
riscos0
sco   0
Solaris   6
sunos 1
svr4  0
svr5  0
sysv  0
unicos0
unicosmk  0
unix  0
unknown   0
uts   0
vms   0
VOS   0
Win32 8
---

Ticket Status By Version

New or OpenResolved

---

Requestors with most open tickets

Paul Cochrane 165
Will Coleda53
chromatic  33
Patrick R. Michaud 31
Jerry Gay  21
Klaas-Jan Stol 15
Mark Glines15
Reini Urban   

Re: [perl #61126] return should apply to the lexically enclosing routine, map is no exception

2008-12-08 Thread Daniel Ruoso
Em Seg, 2008-12-08 às 12:08 +0100, Carl Mäsak escreveu:
> Daniel (>), Carl (>>):
> That is all good and well for exiting the map itself; but what I want
> to achieve is to exit the surrounding sub or method block. Example:

Er... I mean actually the opposite... it should always return from the
surrounding sub or method, never only from "map", if you want to "end"
the map loop, you should use "last"... meaning...

sub foo {
   map { last; }, 1, 2, 3; # executes the block only once
   map { return; }, 1, 2, 3; # returns from &foo;
} 

daniel



Re: [perl #61126] return should apply to the lexically enclosing routine, map is no exception

2008-12-08 Thread Carl Mäsak
Daniel (>), Carl (>>):
>> The above reasoning raises the following question for me: how do I
>> return from a sub or a method from within a map block?
>
> I suppose what you want can be achieved with "last", it probably should
> work in "map" as well, since "map" and "for" are synonims...

That is all good and well for exiting the map itself; but what I want
to achieve is to exit the surrounding sub or method block. Example:

sub foo {
   ...
   my @a = map {
  ...
  return if $condition; # return from &foo
  ...
   }, @a;
   ...
}

Except that, as you explained, the above will not return from &foo,
but only from the map call. How would I return from &foo?

// Carl


Re: [perl #61126] return should apply to the lexically enclosing routine, map is no exception

2008-12-08 Thread Daniel Ruoso
Em Dom, 2008-12-07 às 18:10 +0100, Carl Mäsak escreveu:
> The above reasoning raises the following question for me: how do I
> return from a sub or a method from within a map block?

I suppose what you want can be achieved with "last", it probably should
work in "map" as well, since "map" and "for" are synonims...

daniel