Re: Chained Modifiers

2008-09-17 Thread Larry Wall
On Mon, Sep 15, 2008 at 12:16:22PM +0200, Moritz Lenz wrote:
: Chris Davaz wrote:
:  I'm not sure if it's anywhere in the specs, but I was expecting to be able
:  to do this:
:  
:  .say for =$in unless $foo;
: 
: to quote http://perlcabal.org/syn/S04.html#Loop_statements
: 
: :Looping statement modifiers are the same as in Perl 5 except that, for
: :ease of writing list comprehensions, a looping statement modifier is
: :allowed to contain a single conditional statement modifier:
: :
: :@evens = ($_ * 2 if .odd for 0..100);
: 
: 
:  Where we have multiple modifiers, here for and unless. Is this in the
:  specs? If yes, is it supposed to work in pugs or rakudo? If it's not in the
:  specs can we add it? ;-)
: 
: The authoritative source to ask if a piece of text is valid Perl 6 is
: STD.pm. It parses your example, but not as you might expect. Output from
: STD5_dump_match
: 
: :Unknown routines:
: :unless called at 1
: :comp_unit:
: : statementlist:
: :  statement:
: :   EXPR:
: :noun:
: : dotty:
: :  .
: :  dottyop:
: :   methodop:
: :longname:
: : name:
: :  identifier:
: :   say
: :
: :   statement_mod_loop:
: :for
: :modifier_expr:
: : EXPR:
: :  pre:
: :   prefix:
: :=
: :  noun:
: :   variable:
: :sigil:
: : sigil:
: :  $
: :desigilname:
: : longname:
: :  name:
: :   identifier:
: :in
: :
: :  statement:
: :   EXPR:
: :noun:
: : term:
: :  unless
: :  args:
: :
: :   arglist:
: :EXPR:
: : noun:
: :  variable:
: :   sigil:
: :sigil:
: : $
: :   desigilname:
: :longname:
: : name:
: :  identifier:
: :   foo
: :  ;\n
: 
: So 'unless' is actually parsed as a sub call.

That's obviously a bogus parse, and I even know how it happened
(because unless is currently considered a terminator that doesn't
distinguish between expression termination and statement termination),
but I'm not sure how to fix it yet.  It's possible that statement
modifiers should be demoted to very-low-precedence operators, but there
are some problems with that that I don't have enough brain to think
through at the moment.

Larry


Chained Modifiers

-- Thread Chris Davaz
->









  
  Chained Modifiers
  
  
  
  
  
  








	

	perl6-language 

	
		
			-- Thread --
			-- Date --
			





			
		
	



	
	
	




 




<!--
google_ad_client = "pub-7266757337600734";
google_alternate_ad_url = "http://www.mail-archive.com/blank.png";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel = "8427791634";
google_color_border = "FF";
google_color_bg = "FF";
google_color_link = "006792";
google_color_url = "006792";
google_color_text = "00";
//-->








Chained Modifiers
Chris Davaz
 


Re: Chained Modifiers
Moritz Lenz





 






  
  





Reply via email to



  
  





 
 








 




<!--
google_ad_client = "pub-7266757337600734";
google_alternate_ad_url = "http://www.mail-archive.com/blank.png";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel = "8427791634";
google_color_border = "FF";
google_color_bg = "FF";
google_color_link = "006792";
google_color_url = "006792";
google_color_text = "00";
//-->








Chained Modifiers
Chris Davaz
 


Re: Chained Modifiers
Larry Wall





 






  
  





Reply via email to