From oleber at gmail.com Mon Apr 12 05:33:48 2010 From: oleber at gmail.com (marcos rebelo) Date: Mon, 12 Apr 2010 14:33:48 +0200 Subject: [Milan-pm] April Monthly Milan Perl Mongers Meeting Message-ID: Hy all It is time to do the April monthly meeting. Let's try to agree in a day: http://www.doodle.com/bsrksy53ys4m2quw Best Regards Marcos Rebelo -- Marcos Rebelo http://oleber.freehostia.com Milan Perl Mongers leader http://milan.pm.org From oleber at gmail.com Mon Apr 19 03:00:20 2010 From: oleber at gmail.com (marcos rebelo) Date: Mon, 19 Apr 2010 12:00:20 +0200 Subject: [Milan-pm] April Monthly Milan Perl Mongers Meeting In-Reply-To: References: Message-ID: Hi all the majority is voting in the 21 of April, so lets find ourself at 20h in la Fabbrica. Best Regards Marcos rebelo On Mon, Apr 12, 2010 at 2:33 PM, marcos rebelo wrote: > Hy all > > It is time to do the April monthly meeting. Let's try to agree in a day: > > http://www.doodle.com/bsrksy53ys4m2quw > > > Best Regards > Marcos Rebelo > > -- > Marcos Rebelo > http://oleber.freehostia.com > Milan Perl Mongers leader http://milan.pm.org > -- Marcos Rebelo http://oleber.freehostia.com Milan Perl Mongers leader http://milan.pm.org From gbjgiulio at gmail.com Tue Apr 20 06:06:58 2010 From: gbjgiulio at gmail.com (Giulio Bertani) Date: Tue, 20 Apr 2010 15:06:58 +0200 Subject: [Milan-pm] Riferimento al Politecnico di Milano Message-ID: Ciao a Tutti , stiamo cercando di organizzare l'evento IPW2010 presso il Politecnico di Milano . Per riuscirci sarebbe meglio che a "spingere" fossero pi? professori . Vi chiedo pertanto dei riferimenti al DEI o di altri dipartimenti che potrebbero essere interessati a "sollecitare" l'evento.( occorre solo il nome : i contatti avverranno via mail ) Per chi mi vuole fornire informazioni in privato pu? utilizzare la mail: gbjgiulio at gmail.com Grazie a tutti in anticipo Giulio -- Giulio Bertani www.perquelliche.it (In definizione ...) -------------- next part -------------- An HTML attachment was scrubbed... URL: From oleber at gmail.com Thu Apr 29 08:56:08 2010 From: oleber at gmail.com (marcos rebelo) Date: Thu, 29 Apr 2010 17:56:08 +0200 Subject: [Milan-pm] Is this a feature or a bug? Message-ID: the code: use v5.10; use Modern::Perl; use List::MoreUtils qw(any); say( (any { $_ eq 7 } (0..10) ) or 'false' ); given (5) { when (5) { say( (any { $_ eq 7 } (0..10) ) or 'false' ); say( join(", ", map { $_ eq 7 } (0..10) ) ); } } prints: 1 false , , , , , , , 1, , , the second 'any' should have returned a true value or not, and why??? Best Regards Marcos Rebelo -- Marcos Rebelo http://oleber.freehostia.com Milan Perl Mongers leader http://milan.pm.org From shlomif at iglu.org.il Thu Apr 29 09:28:50 2010 From: shlomif at iglu.org.il (Shlomi Fish) Date: Thu, 29 Apr 2010 19:28:50 +0300 Subject: [Milan-pm] Is this a feature or a bug? In-Reply-To: References: Message-ID: <201004291928.51152.shlomif@iglu.org.il> On Thursday 29 Apr 2010 18:56:08 marcos rebelo wrote: > the code: > > use v5.10; > use Modern::Perl; > use List::MoreUtils qw(any); > > say( (any { $_ eq 7 } (0..10) ) or 'false' ); > > given (5) { > when (5) { > say( (any { $_ eq 7 } (0..10) ) or 'false' ); > say( join(", ", map { $_ eq 7 } (0..10) ) ); > } > } > I've brought it over on #p5p on irc.perl.org and here is the log: [log] Apr 29 19:11:50 --- Topic for #p5p is <@acme> 5.13.0 has been released and the code mines are open again Apr 29 19:11:50 --- Topic for #p5p set by acme!~acme at braga.cuckoo.org at Tue Apr 20 23:32:50 2010 Apr 29 19:14:31 "rindolf" at 217.168.150.38 pasted "Possible perl-5.10.1 bug from beginners at perl.org ." (39 lines) at http://paste.scsys.co.uk/42909 Apr 29 19:14:32 [ magnet_web paste from "rindolf" at 217.168.150.38... ] Apr 29 19:14:53 Hi all. Is this a perl-5.10.1+ bug? http://paste.scsys.co.uk/42909 Apr 29 19:14:55 [ magnet_web paste from "rindolf" at 217.168.150.38... ] Apr 29 19:16:00 Could be in List::MoreUtils::any though... Apr 29 19:16:34 It's a known issue Apr 29 19:17:00 given() creates a lexical $_. In ' any { $_ }' the global $_ is used. Apr 29 19:17:12 Bram: ah. Apr 29 19:17:25 If I recall correct it is also mentioned in the perl5120delta Apr 29 19:17:52 so would $::_ work? Apr 29 19:18:02 I mean, I know it's fuck ugly, but. Apr 29 19:18:08 http://perldoc.perl.org/perldelta.html#Known-Problems Apr 29 19:18:09 [ perldelta - perldoc.perl.org ] Apr 29 19:18:11 No it wouldn't Apr 29 19:18:11 our $_ Apr 29 19:18:20 perl -e 'use v5.10; use List::MoreUtils qw(any); given(5) { say( (any { $::_ eq 7 } (0..10) ) or 'false' ); }' Apr 29 19:18:21 Bram: it does. Apr 29 19:18:22 if you say so... Apr 29 19:18:27 The merge base f7c69158501ed4705d71f069f23211f56bd55a2e is bad. Apr 29 19:18:27 This means the bug has been fixed between f7c69158501ed4705d71f069f23211f56bd55a2e and [5348debf9fd57fc15c26529386769684fab96e57]. Apr 29 19:18:30 bisect run failed: Apr 29 19:18:35 hneegh, what's the fix for this again? Apr 29 19:18:54 oops paste Apr 29 19:19:11 mst: it works with $::_ Apr 29 19:19:39 rindolf: and rgs is right that 'our $_' would work as well which is likely less fucked up to use Apr 29 19:19:40 Why does it work with $::_ ? Apr 29 19:19:53 Bram: because that's package var it looks it straight up from %main:: Apr 29 19:19:55 $::_ always refers to the global Apr 29 19:20:28 the problem was that in any { $_ eq 7 } ... the "$_" referred to the lexical $_, but the "any" function always presents the value to be tested in the global Apr 29 19:20:36 $'_ Apr 29 19:20:46 would be the shortest way to say it. Apr 29 19:20:55 * rgs gets his coat and goes home & Apr 29 19:20:56 rgs: heh. Apr 29 19:20:56 any { $::_ eq 7 } ... works regardless of lexical $_ existence Apr 29 19:21:00 rgs: bye Apr 29 19:21:37 mst: yes, but IIRC given () sets the lexical $_, not the global $_... Apr 29 19:21:54 precisely Apr 29 19:21:55 perl -wlE 'sub foo { my $code = shift; $code->(); } given (5) { print "lexical: $_, global: $::_"; foo( sub { print $::_ } ); }' Apr 29 19:22:13 given() doesn't just *set* the lexical $_, it *introduces* a lexical $_ Apr 29 19:22:15 That prints lexical: 5, global: + undef Apr 29 19:22:58 Bram: which is EXACTLY what fixes the problem. Apr 29 19:23:16 Oh right, ignore me. Apr 29 19:23:36 I was confused for a couple of minutes... (I thought the goal was to access the lexical $_ of the given) [/log] Hope it helps. Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Funny Anti-Terrorism Story - http://shlom.in/enemy God considered inflicting XSLT as the tenth plague of Egypt, but then decided against it because he thought it would be too evil. Please reply to list if it's a mailing list post - http://shlom.in/reply . From ema.zep at libero.it Thu Apr 29 11:50:31 2010 From: ema.zep at libero.it (Emanuele Zeppieri) Date: Thu, 29 Apr 2010 20:50:31 +0200 Subject: [Milan-pm] [mongers-it] Is this a feature or a bug? In-Reply-To: References: Message-ID: <4BD9D4F7.7080805@libero.it> On 29/04/2010 17.56, marcos rebelo wrote: > the code: > > use v5.10; > use Modern::Perl; > use List::MoreUtils qw(any); > > say( (any { $_ eq 7 } (0..10) ) or 'false' ); > > given (5) { > when (5) { > say( (any { $_ eq 7 } (0..10) ) or 'false' ); > say( join(", ", map { $_ eq 7 } (0..10) ) ); > } > } > > > prints: > > 1 > false > , , , , , , , 1, , , > > > > the second 'any' should have returned a true value or not, and why??? The diagnosis given by Flavio (Poletti from mongers at perl.it) is correct, so just declare "our $_" to restore the global $_: given (5) { when (5) { say( any { our $_ eq 7 } 0..10 or 'false' ); say( join ', ', map { $_ eq 7 } 0..10 ); } } prints: 1 , , , , , , , 1, , , as expected. Not that clear but, given the perlsyn fragment pointed out by Flavio, it works as advertised. Ciao -Emanuele From oleber at gmail.com Thu Apr 29 12:34:22 2010 From: oleber at gmail.com (marcos rebelo) Date: Thu, 29 Apr 2010 21:34:22 +0200 Subject: [Milan-pm] Is this a feature or a bug? In-Reply-To: References: Message-ID: With all this solutions, seems that I may use: 'our $_' or '$::_' But it is really crazy in designers of perl to make this. If this isn't a major bug, Damian needs to write some new rule in is book. Best Regards Marcos Rebelo On Thu, Apr 29, 2010 at 5:56 PM, marcos rebelo wrote: > the code: > > use v5.10; > use Modern::Perl; > use List::MoreUtils qw(any); > > say( (any { $_ eq 7 } (0..10) ) or 'false' ); > > given (5) { > ? ?when (5) { > ? ? ? ?say( (any { $_ eq 7 } (0..10) ) or 'false' ); > ? ? ? ?say( join(", ", map { $_ eq 7 } (0..10) ) ); > ? ?} > } > > > prints: > > 1 > false > , , , , , , , 1, , , > > > > the second 'any' should have returned a true value or not, and why??? > > > Best Regards > Marcos Rebelo > > -- > Marcos Rebelo > http://oleber.freehostia.com > Milan Perl Mongers leader http://milan.pm.org > -- Marcos Rebelo http://oleber.freehostia.com Milan Perl Mongers leader http://milan.pm.org From pmca.pm at clix.pt Thu Apr 29 11:30:31 2010 From: pmca.pm at clix.pt (Paulo) Date: Thu, 29 Apr 2010 19:30:31 +0100 Subject: [Milan-pm] [Lisbon.pm] Is this a feature or a bug? In-Reply-To: References: Message-ID: <1272565831.1216.22.camel@ideafix.office.sonaecom.pt> I think it's a bug in "any" ... Try this: my $_ = 5; say( (any { $_ eq 7 } (0..10) ) or 'false' ); given (5) { when (5) { say( (any { our $_ eq 7 } (0..10) ) or 'false' ); say( join(", ", map { $_ eq 7 } (0..10) ) ); } } and it prints: false 1 , , , , , , , 1, , , Best regards On Thu, 2010-04-29 at 17:56 +0200, marcos rebelo wrote: > the code: > > use v5.10; > use Modern::Perl; > use List::MoreUtils qw(any); > > say( (any { $_ eq 7 } (0..10) ) or 'false' ); > > given (5) { > when (5) { > say( (any { $_ eq 7 } (0..10) ) or 'false' ); > say( join(", ", map { $_ eq 7 } (0..10) ) ); > } > } > > > prints: > > 1 > false > , , , , , , , 1, , , > > > > the second 'any' should have returned a true value or not, and why??? > > > Best Regards > Marcos Rebelo >