[thelist] Assignment Question

Judah McAuley judah at wiredotter.com
Fri Sep 10 12:27:39 CDT 2010


For what it's worth, I don't believe that Javascript actually has this
operator (though Java does). Coldfusion (which I primarily work in)
also does not have that operator. Interesting, I've not run across it
before.

Cheers,
Judah

On Fri, Sep 10, 2010 at 9:32 AM, Jason Handby
<jason.handby at corestar.co.uk> wrote:
>> > I figured most languages(i'm not gonna say all) would be the same
> for
>> assignment ops.
>>
>> I've programmed in many languages, but not PERL, and:
>>
>> 1. Assignment ops do vary, depending upon language, more than you'd
>> think.
>> 2. I've never seen a "|=" operator.
>> 3. I'm guessing "a |= b" might mean "a = a | b", like C's "+="
>> operator.
>
> C, C++, C#, Java, Javascript and PHP all have the "|=" operator, and
> yes, that's what it means.
>
> I guess a use case would be if you were iterating through some bit
> patterns and combining them into a bitmask - you'd start with 0, and
> repeatedly bitwise-OR into it. Probably not the sort of thing web
> developers do a lot though!
>
>
> Jason
>
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


More information about the thelist mailing list