Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Comma Operator
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joe Gottman  
View profile  
 More options Jan 20 2004, 9:48 pm
Newsgroups: perl.perl6.language
From: jgott...@carolina.rr.com (Joe Gottman)
Date: Tue, 20 Jan 2004 21:17:32 -0500
Local: Tues, Jan 20 2004 9:17 pm
Subject: Comma Operator
   About a month ago, a thread here suggested that we change the meaning of
the comma operator.  Currently, in scalar context the expression
    foo(), bar()
means "evaluate foo(), discard the result, then return the value of bar()".
It was suggested that this be changed to return the 2-element array (foo(),
bar()).  Has Larry ruled on this yet?

    By the way, even if we do make this change, I think that in void context
the expression
    foo(), bar()
should still simply evaluate its parameters in order for their side-effects.
This would allow comma expressions to remain as-is in loop statements
(formerly for statements), which is where most of them are found anyway.
For instance
    loop (my ($x = 0, $y = 10); $x < $y; ++$x, --$y) {...}

Joe Gottman


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.