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.

Advertisements

[misposted to clp.misc]
[x-posted to clc; f-up set to clc]
> 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?

--
Frank

My father grew up in the Great Depression - his mother's.
~~ Al Franken

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.

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?

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

In Dread Ink, the Grave Hand of Tad J McClellan Did Inscribe:
> 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?
>
>
> 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

Franken Sense wrote:
> In Dread Ink, the Grave Hand of Tad J McClellan Did Inscribe:
>
>> 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?
>>
>> 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?

R> Franken Sense wrote:
>>
>> 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)"
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)

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)

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:

[x-posted to clc]
> >>
> >> 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)"
> 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.

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,

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!