comma operator

F

Franken Sense

I'm reading up on perl today and find this in perldoc perlop:

Comma Operator

Binary "," is the comma operator. In scalar context it evaluates its
left argument, throws that value away, then evaluates its right
argument
and returns that value. This is just like C's comma operator.

// end excerpt

What is C's comma operator?
 
F

Franken Sense

In Dread Ink, the Grave Hand of Franken Sense Did Inscribe:

[misposted to clp.misc]
[x-posted to clc; f-up set to clc]
 
A

Andrew DeFaria

body { font: Helvetica, Arial, sans-serif; } p { font: Helvetica, Arial, sans-serif; } ..standout { font-family: verdana, arial, sans-serif; font-size: 12px; color: #993333; line-height: 13px; font-weight: bold; margin-bottom: 10px; } ..code { border-top: 1px solid #ddd; border-left: 1px solid #ddd; border-right: 2px solid #000; border-bottom: 2px solid #000; padding: 10px; margin-top: 5px; margin-left: 5%; margin-right: 5%; background: #ffffea; color: black; -moz-border-radius: 10px; } ..codedark { border-top: 10px solid #03f; border-left: 1px solid #ddd; border-right: 2px solid grey; border-bottom: 2px solid grey; padding: 10px; margin-top: 5px; margin-left: 5%; margin-right: 5%; background: black; color: yellow; -moz-border-radius: 10px; } #code { color: black; font-size: 14px; font-family: courier; padding-left: 5px; } #line-number { color: #804000; font-family: Arial; font-size: 14px; padding-right: 5px; border-right: 1px dotted #804000; } blockquote[type=cite] { padding: 0em .5em .5em .5em !important; border-right: 2px solid blue !important; border-left: 2px solid blue !important; } blockquote[type=cite] blockquote[type=cite] { border-right: 2px solid maroon !important; border-left: 2px solid maroon !important; } blockquote[type=cite] blockquote[type=cite] blockquote[type=cite] { border-right: 2px solid teal !important; border-left: 2px solid teal !important; } blockquote[type=cite] blockquote[type=cite] blockquote[type=cite] blockquote[type=cite] { border-right: 2px solid purple !important; border-left: 2px solid purple !important; } blockquote[type=cite] blockquote[type=cite] blockquote[type=cite] blockquote[type=cite] blockquote[type=cite] { border-right: 2px solid green !important; border-left: 2px solid green !important; } Franken Sense wrote:
I'm reading up on perl today and find this in perldoc perlop:

Comma Operator

Binary "," is the comma operator. In scalar context it evaluates its left argument, throws that value away, then evaluates its right argument and returns that value. This is just like C's comma operator.

// end excerpt

What is C's comma operator?
Hmmm... You bothered to "read up" on Perl today. Why did you not likewise "read up" on C? I mean a simple Google search of 0.0123 seconds of "c comma operator" gives the results you seek. And it probably would have taking 6.234 times less time than it took you to compose your post.
 
T

Tad J McClellan

Franken Sense said:
I'm reading up on perl today and find this in perldoc perlop:

Comma Operator

Binary "," is the comma operator. In scalar context it evaluates its
left argument, throws that value away, then evaluates its right
argument
and returns that value. This is just like C's comma operator.

// end excerpt

What is C's comma operator?


It is an operator that evaluates its left argument, throws that value
away, then evaluates its right argument and returns that value.

It is just like Perl's comma operator.
 
F

Franken Sense

In Dread Ink, the Grave Hand of Tad J McClellan Did Inscribe:
It is an operator that evaluates its left argument, throws that value
away, then evaluates its right argument and returns that value.

It is just like Perl's comma operator.

This is a footnote from n1336.pdf:

100) A comma operator does not yield an lvalue.

Is this also true in perl?
--
Frank

I think if you're going to do a movie about Reagan you do it about the fact
that he created the huge deficit, that he armed the mujahadeen, that he
armed Saddam, that he armed Iran, he armed 2/3s of the Axis of Evil, he
funded terrorists in Central America, he was in my mind a terrible
president.
~~ Al Franken, Book TV, on CBS's Reagan movie
 
R

RedGrittyBrick

Franken said:
In Dread Ink, the Grave Hand of Tad J McClellan Did Inscribe:


This is a footnote from n1336.pdf:

100) A comma operator does not yield an lvalue.

Is this also true in perl?

C> perl -e "$x,$y = 42; print qq(x=$x, y=$y)"
x=, y=42
 
U

Uri Guttman

C> perl -e "$x,$y = 42; print qq(x=$x, y=$y)"
R> x=, y=42

there is no lvalue in that first statement. comma binds lower than = so
that was $x followed by $y = 42 which works. the problem is finding a
way to have a comma operator which binds tighter than =. using parens
won't work since that makes a list and it isn't a comma op anymore but a
list element separator.

and finally WTF is franken sense asking dumb sidebar questions and
getting answers. he needs to focus on learning perl and not obscure side
issues like comma ops and lvalues (i bet he doesn't even know what the term
lvalue means)

uri
 
F

Franken Sense

In Dread Ink, the Grave Hand of Uri Guttman Did Inscribe:
and finally WTF is franken sense asking dumb sidebar questions and
getting answers. he needs to focus on learning perl and not obscure side
issues like comma ops and lvalues (i bet he doesn't even know what the term
lvalue means)

**** off, Uri. I'll bet you're an asshole in every time zone.
--
Frank

When you encounter seemingly good advice that contradicts other seemingly
good advice, ignore them both.
~~ Al Franken,
 
J

Jürgen Exner

Franken Sense said:
In Dread Ink, the Grave Hand of Uri Guttman Did Inscribe:


**** off, Uri. I'll bet you're an asshole in every time zone.

Your request for entry into the killfile has been approved.

jue
 
Q

QoS

Andrew DeFaria said:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
body {
font: Helvetica, Arial, sans-serif;
}
p {
font: Helvetica, Arial, sans-serif;
}
.standout {
font-family: verdana,
arial,
sans-serif;
font-size: 12px;
color: #993333;
line-height: 13px;
font-weight: bold;
margin-bottom: 10px;
}
.code {
border-top: 1px solid #ddd;
border-left: 1px solid #ddd;
border-right: 2px solid #000;
border-bottom: 2px solid #000;
padding: 10px;
margin-top: 5px;
margin-left: 5%;
margin-right: 5%;
background: #ffffea;
color: black;
-moz-border-radius: 10px;
}
.codedark {
border-top: 10px solid #03f;
border-left: 1px solid #ddd;
border-right: 2px solid grey;
border-bottom: 2px solid grey;
padding: 10px;
margin-top: 5px;
margin-left: 5%;
margin-right: 5%;
background: black;
color: yellow;
-moz-border-radius: 10px;
}
#code {
color: black;
font-size: 14px;
font-family: courier;
padding-left: 5px;
}
#line-number {
color: #804000;
font-family: Arial;
font-size: 14px;
padding-right: 5px;
border-right: 1px dotted #804000;
}
blockquote[type=cite] {
padding: 0em .5em .5em .5em !important;
border-right: 2px solid blue !important;
border-left: 2px solid blue !important;
}
blockquote[type=cite]
blockquote[type=cite] {
border-right: 2px solid maroon !important;
border-left: 2px solid maroon !important;
}
blockquote[type=cite]
blockquote[type=cite]
blockquote[type=cite] {
border-right: 2px solid teal !important;
border-left: 2px solid teal !important;
}
blockquote[type=cite]
blockquote[type=cite]
blockquote[type=cite]
blockquote[type=cite] {
border-right: 2px solid purple !important;
border-left: 2px solid purple !important;
}
blockquote[type=cite]
blockquote[type=cite]
blockquote[type=cite]
blockquote[type=cite]
blockquote[type=cite] {
border-right: 2px solid green !important;
border-left: 2px solid green !important;
}
</style>
</head>
<body>
Franken Sense wrote:
<blockquote id="mid_n9xz6jtv6q9l__abdg4l179oq6__dlg_40tude_net"
cite="mid:[email protected]" type="cite">In
Dread Ink, the Grave Hand of Uri Guttman Did Inscribe:<br>
<blockquote id="StationeryCiteGenerated_1" type="cite">and finally
WTF is franken sense asking dumb sidebar questions and getting answers.
he needs to focus on learning perl and not obscure side issues like
comma ops and lvalues (i bet he doesn't even know what the term lvalue
means)<br>
</blockquote>
**** off, Uri. I'll bet you're an asshole in every time zone.<br>
</blockquote>
I'm shooting for that! Perhaps if I stood at the North Pole and spun
around... <span class="moz-smiley-s5"><span> :-D </span></span><br>
<div class="moz-signature">-- <br>
<a href="http://defaria.com">Andrew DeFaria</a><br>
<small><font color="#999999">Think honk if you're telepathic.</font></small>
</div>
</body>
</html>

Whats with all the html? This is nntp.

BTW to the OP please dont have thin skin here;
while the response may have seemed harsh,
the intentions were benevolent.
 
J

Jürgen Exner

Andrew DeFaria said:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
[...]
Whats with all the html? This is nntp.

You must be new here, everyone else has plonked him a loooooonnnng time
ago because of this.

jue
 
S

sln

It has been posting that way for years.

Please do not feed it.

What is 'it'?

It
From Wikipedia, the free encyclopedia
Jump to: navigation, search
Look up it in
Wiktionary, the free dictionary.
This article contains special characters. Without proper rendering support, you may see question marks, boxes, or other symbols.
It or IT may refer to:

It (pronoun), a third-person neuter pronoun in English.
As an abbreviation:

Information technology, a broad subject concerned with aspects of managing, editing and processing information
it, the ISO 639 alpha-2 short code for the Italian language
IT, the ISO 3166-1 alpha-2 and FIPS 10-4 country code for Italy
IT, Iran Time, the time zone used in Iran, UTC+3:30 (also IRST).
..it, the Internet country code top-level domain ccTLD for Italy.
The Irish Times
Income tax
The IATA code for Kingfisher Airlines and Irtysh Avia
Institute of Technology, in the educational system of Ireland
Impulse Tracker, music sequencer software for MS-DOS
IEEE Transactions on Information Theory, a scientific journal published by the Institute of Electrical and Electronic Engineers
Internet television, television distributed via the Internet
Internal Translator, an early compiler developed by Alan Perlis for the IBM 650 in 1956
Inclusive Tour, a package holiday that includes accommodation in addition to transportation
International Times, an underground newspaper in London
A type of electrical earthing system
A metalinguistic marker in the Sanskrit grammar of Panini
A series of enduro motorcycles from Yamaha (e.g. IT175, IT250, IT490)
Intercity Transit, a public transportation service for the cities of Lacey, Olympia, Tumwater, and Yelm, Washington.
IT, one of the code names by which the Segway personal transporter was known during its development
Invisibolt Technology, a version of set-through guitar neck join by B.C. Rich
Inferotemporal cortex, the highest-order cortical visual processing area of the brain.
(it), an abbreviation for intrathecal injection
IT (file format), an audio file format.
IT, the acronym-logo for heavy metal band Insidiöus Törment.
As a name:

Cousin Itt, a monster character in the TV series The Addams Family.
IT, the villain in Madeleine L'Engle's science fiction novel A Wrinkle in Time.
IT, the sand fairy known as Psammead in Edith Nesbit's book Five Children and It.
The name of a high-speed vehicle in the South Park episode The Entity.
IT, a superintelligence in the science fiction series Perry Rhodan.
It is the stage name of Tony Särkkä, the vocalist for the black metal band Abruptum.
It, a boss from the videogame Resident Evil 4.
IT, an malevolent evil force haunting a small town in Stephen King's horror novel It and its film by the same name
iT, a model of neighborhood electric vehicle also known as the Dynasty EV
As a title:

It (novel), a horror novel by Stephen King
It (1990 film), a film version of the Stephen King novel
It, the first album by British pop band Pulp.
It, a song by Prince from his 1987 album, Sign o' the Times.
It (1927 film), a 1927 romantic comedy film starring Clara Bow
It girl, a young woman famed for her good looks
It! (1966 film), a 1966 horror film
Es (film) (English title: It), a 1966 West German film directed by Ulrich Schamoni
It (Phish festival), a two-day festival by the jam band Phish, held in August 2003 in Limestone, Maine, and the subsequent DVD (It (video)) and concert download (Live Phish Downloads: It)
It., the final track on the Genesis album The Lamb Lies Down on Broadway
A Child Called "It", an autobiography by Dave Pelzer
It! The Terror from Beyond Space, a 1958 science fiction film
it Records, a record label
IT (XM), an annual special aired on XM Satellite Radio
It! (story) a story by Theodore Sturgeon featuring the earliest plant-based swamp monster in literature.
from It (pronoun):

A euphemism for sexual intercourse
The distinguished player in tag and related chasing games
In other languages:

it, fire in the Charrúa language.

[edit] See also
Gender-neutral pronoun
ITT
Id

-sln
 
F

Franken Sense

In Dread Ink, the Grave Hand of Lawrence Statton Did Inscribe:

For the record, it is uri, the person half my size and halfway around the
world, who dropped the f-bomb, ungrammatically, first.

Lawrence is the type of person to killfile a person with whom he has had no
interaction.

Makes you wonder what his motive is, because it has nothing to do with me.
 
T

Tad J McClellan

Franken Sense said:
In Dread Ink, the Grave Hand of Lawrence Statton Did Inscribe:


For the record, it is uri, the person half my size and halfway around the
world, who dropped the f-bomb, ungrammatically, first.


For the accurate record, Uri's F referred to "asking dumb sidebar questions"
while Franken's F and A referred to Uri.

One of them cursed an action while the other cursed a person.

i.e. one was ad hominem and one wasn't.

Lawrence is the type of person to killfile a person with whom he has had no
interaction.


I think your implication is that that it is bad somehow?

Killfiling someone you've had an argument with might be simply "sour grapes".

Killfiling someone you've had no interaction with is _more_ objective.

Makes you wonder what his motive is,


No, it makes _you_ wonder.

It is fairly obvious to the rest of us.

His motive it to not waste time on foolishness.

because it has nothing to do with me.


Right.

It does not have to do with you.

It has to do with your actions.

You have _earned_ your plonking.
 
T

Tad J McClellan

Franken Sense said:
Uri Guttman responded to a post that I clearly marked as a mispost with a
sentence that included the words "dumb ****"


What post included those words?
 
F

Franken Sense

In Dread Ink, the Grave Hand of Uri Guttman Did Inscribe:
R> Franken Sense wrote:

[x-posted to clc]
C> perl -e "$x,$y = 42; print qq(x=$x, y=$y)"
R> x=, y=42

there is no lvalue in that first statement. comma binds lower than = so
that was $x followed by $y = 42 which works. the problem is finding a
way to have a comma operator which binds tighter than =. using parens
won't work since that makes a list and it isn't a comma op anymore but a
list element separator.

and finally WTF is franken sense asking dumb sidebar questions and
getting answers. he needs to focus on learning perl and not obscure side
issues like comma ops and lvalues (i bet he doesn't even know what the term
lvalue means)

uri

Uri Guttman responded to a post that I clearly marked as a mispost with a
sentence that included the words "dumb ****" and seems to think the problem
is that I get answers.

I learn what a comma operator is when I look into it, which is now. I'm
putting the finishing touches on a perl program that will stall now that
I've told your snippy, presumptuous self to consult the F standard.

I bet you don't know what F is. Tell you what, you change your modus
operandi and give me advice about code as opposed to advise about life, and
I'll move on.

Why doesn't this compile:

#!/usr/bin/perl
# perl bb8.pl
use warnings;
use strict;


my $filename3 = 'ot5.txt';
open(my $hh, '<', $filename3) or
die "cannot open $filename3 for reading: $!";

# open output file
my $filename2 = 'outfile16.txt';
open(my $gh, '>', $filename2) or
die "cannot open $filename2 for writing: $!";

my %Scripts;
my %comments;


local $/="";

while ( <$hh> )
{
my @s = split /\s+/, $_;
my $verse = $s[0];
my $counter = 0;

if ($s[0] =~ m/^\d/)
{
my $verse = $s[0];
my $script = join(' ', @s[1..$#s]);
$Scripts{$verse} = $script;

}
else
{
$counter++;
my $comment = join(' ', @s);
$comments($counter) = $comment;
print $_;
}

}


# close input and output files

close($hh) or die("Error closing $filename3: $!");
close($gh) or die("Error closing $filename2: $!");


C:\MinGW\source>perl bb8.pl
Global symbol "$comments" requires explicit package name at bb8.pl line 39.
syntax error at bb8.pl line 39, near "$comments("
Execution of bb8.pl aborted due to compilation errors.

C:\MinGW\source>
--
Frank

During the Reagan Administration, Bob Dole was present at a ceremony that
included each living ex-president. Looking at a tableau of Ford, Carter and
Nixon, Dole said, 'There they are: Hear No Evil, See No Evil and Evil.'
~~ Al Franken,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top