[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

TrueClass === TrueClass

Bojan Mihelac

1/19/2007 8:00:00 PM

Hi all,
why is:

TrueClass === TrueClass # false
Object === Object # true

Documentation states that === method is used to provide meaningful
semantic in case statements. Can anyone explain me why some classes
returns false?

thnx,
Bojan Mihelac


--
Bojan Mihelac
Informatika Mihelac, Bojan Mihelac s.p. | www.informatikamihelac.com
-> tools, scripts, tricks from our code lab: http://source.m...

33 Answers

Vincent Fourmond

1/19/2007 8:04:00 PM

0

Bojan Mihelac wrote:
> Hi all,
> why is:
>
> TrueClass === TrueClass # false
> Object === Object # true
>
> Documentation states that === method is used to provide meaningful
> semantic in case statements. Can anyone explain me why some classes
> returns false?

=== returns true with one class if you 'compare' it to an instance of
the class:

irb(main):002:0> TrueClass == TrueClass
=> true
irb(main):003:0> TrueClass === TrueClass
=> false
irb(main):004:0> TrueClass === true
=> true

Cheers,

Vince

--
Vincent Fourmond, PhD student
http://vincent.fourmon...

David Chelimsky

1/19/2007 8:16:00 PM

0

On 1/19/07, Vincent Fourmond <vincent.fourmond@9online.fr> wrote:
> Bojan Mihelac wrote:
> > Hi all,
> > why is:
> >
> > TrueClass === TrueClass # false
> > Object === Object # true
> >
> > Documentation states that === method is used to provide meaningful
> > semantic in case statements. Can anyone explain me why some classes
> > returns false?
>
> === returns true with one class if you 'compare' it to an instance of
> the class:
>
> irb(main):002:0> TrueClass == TrueClass
> => true
> irb(main):003:0> TrueClass === TrueClass
> => false
> irb(main):004:0> TrueClass === true
> => true
>
> Cheers,

Ah - so Object === Object returns true because the second Object is an
instance of the first Object. How deceiving.

>
> Vince
>
> --
> Vincent Fourmond, PhD student
> http://vincent.fourmon...
>
>

Bojan Mihelac

1/19/2007 8:56:00 PM

0

Vincent Fourmond wrote:
> Bojan Mihelac wrote:
>> Hi all,
>> why is:
>>
>> TrueClass === TrueClass # false
>> Object === Object # true
>>
>> Documentation states that === method is used to provide meaningful
>> semantic in case statements. Can anyone explain me why some classes
>> returns false?
>
> === returns true with one class if you 'compare' it to an instance of
> the class:
>
> irb(main):002:0> TrueClass == TrueClass
> => true
> irb(main):003:0> TrueClass === TrueClass
> => false
> irb(main):004:0> TrueClass === true
> => true
>
> Cheers,
>
> Vince
>

Thanx Vince, just what I looked for.
Bojan


--
Bojan Mihelac
Informatika Mihelac, Bojan Mihelac s.p. | www.informatikamihelac.com
-> tools, scripts, tricks from our code lab: http://source.m...

David Chelimsky

1/20/2007 7:46:00 PM

0

On 1/20/07, Robert Dober <robert.dober@gmail.com> wrote:
> On 1/19/07, David Chelimsky <dchelimsky@gmail.com> wrote:
> >
> > On 1/19/07, Vincent Fourmond <vincent.fourmond@9online.fr> wrote:
> > > Bojan Mihelac wrote:
> > > > Hi all,
> > > > why is:
> > > >
> > > > TrueClass === TrueClass # false
> > > > Object === Object # true
> > > >
> > > > Documentation states that === method is used to provide meaningful
> > > > semantic in case statements. Can anyone explain me why some classes
> > > > returns false?
> > >
> > > === returns true with one class if you 'compare' it to an instance of
> > > the class:
> > >
> > > irb(main):002:0> TrueClass == TrueClass
> > > => true
> > > irb(main):003:0> TrueClass === TrueClass
> > > => false
> > > irb(main):004:0> TrueClass === true
> > > => true
> > >
> > > Cheers,
> >
> > Ah - so Object === Object returns true because the second Object is an
> > instance of the first Object. How deceiving.
>
>
> If you are looking for a language in which not everything is an object,
> there are plenty around ;)

Oh, you misunderstand. Let me rephrase:

"How deliciously deceiving."


>
> >
> > > Vince
> > >
> > > --
> > > Vincent Fourmond, PhD student
> > > http://vincent.fourmon...
> > >
> > >
> >
> > Robert
>
>
> --
> "The best way to predict the future is to invent it."
> - Alan Kay
>
>

jt

3/31/2012 4:04:00 PM

0

On Sat, 31 Mar 2012 11:22:27 -0400, Mason Barge <masonbarge@gmail.com>
wrote:

>On Sat, 31 Mar 2012 05:47:01 -0400, Ubiquitous <weberm@polaris.net> wrote:
>
>>I watched:
>
>Movie night: THE HUNGER GAMES
>
>Solid - I had a great time. Hollywood only managed to screw up one or two
>little things having to do with the romantic angle -- they make it into
>more of a love story, but not enough to make it obnoxious. The book was
>better but, if the book is good, the movie's never better.
>
>They did manage to show the violence with going over the top. I'm
>actually just as happy it isn't an "R".
>
>After this and Winter's Bone, Jennifer Lawrence is an official big leaguer
>-- she was excellent. And just about time. I'm *really* getting tired of
>Kirstin Stewart who, from the previews, it looks like she was simply
>miscast in Snow White and the Huntsman.
>
>They could have done a lot more with the art direction, IMHO.
>
>Grade: A

I was thinking of going to see this. I liked Jennifer Lawrence a lot in
Winter's bone. Reading about The Hunger Games, I'm left with the sense
it's a movie for kids or younger audiences. Not that it's a bad thing but
I have no interest in the Twilight Saga for instance. Is that the case
with this movie?

Arthur Lipscomb

3/31/2012 4:15:00 PM

0

On 3/31/2012 8:22 AM, Mason Barge wrote:
> On Sat, 31 Mar 2012 05:47:01 -0400, Ubiquitous<weberm@polaris.net> wrote:
>
>> I watched:
>
> Movie night: THE HUNGER GAMES
>
> Solid - I had a great time. Hollywood only managed to screw up one or two
> little things having to do with the romantic angle -- they make it into
> more of a love story, but not enough to make it obnoxious. The book was
> better but, if the book is good, the movie's never better.
>
> They did manage to show the violence with going over the top. I'm
> actually just as happy it isn't an "R".
>
> After this and Winter's Bone, Jennifer Lawrence is an official big leaguer
> -- she was excellent. And just about time. I'm *really* getting tired of
> Kirstin Stewart who, from the previews, it looks like she was simply
> miscast in Snow White and the Huntsman.
>
> They could have done a lot more with the art direction, IMHO.
>
> Grade: A

I caught it last week. I thought it was OK but I'm not sure if I'd give
it an A. Still, I'm curious where the series goes from here.


This week's movie for me was Wrath of the Titans. It was better than
the first one (which wasn't hard) but the overall story was still weak
and for the most part miscast. Ares in particular should have been
played by a different actor. I was also left with a strong suspicion
that 15 to 30 minutes of (necessary) plot was left on the cutting room
floor. It was another case of the previews being better than the actual
movie (lately movies with bad previews have been good).


I also watched:


Nikita - While Amanda plots with Gogol, Percy keeps his eyes on the
prize and schemes to retake Division. I think Nikita and Alex had a
scene or two as well. :-) The players stay the same but their position
on the board are constantly in motion. Great episode. Best they've
done in a while.


Fringe - The werehedgehogs or whatever are back. Basically retelling
the same story from an earlier season with a few new twists. It was an
OK monster of the week story but it was lacking the usual chemistry and
wit the show often has.


30 Rock (On Demand) - Somewhat of a disappointment. The plot (what I
remember of it) was a bit muddled. The most interesting aspect was
probably the McBeth/burger sketch.


Todd and the Book of Pure Evil - "Daddy Tissues" - It took three
episodes but the show finally found it's grove again. In this episode
Jenny's father is better and wants to join Todd's gang (and use Todd and
the Book for his own gains). After being rebuffed by the gang,
primarily for being too old, he gets hold of the book and uses it to
steal the skin from other students so he can infiltrate Todd's gang.
The evil guidance counselor didn't get much screen time but made the
most of what he had.


(Recorded for later: Grimm, Spartacus and Supernatural)

Arthur Lipscomb

3/31/2012 4:29:00 PM

0

On 3/31/2012 9:10 AM, anim8rFSK wrote:

>>
>> I just wish they'd figured out a way to do it without all the shaky-cam.
>
> Hunger Games has shaky cam? We talked about going to it last night in a
> DBox theater where the seats move. 2:22 of seats moving to shaky cam?
> Barf!


I don't recall there being shaky cam. *Maybe* there was a scene or two
but I doubt more than that.

Obveeus

3/31/2012 7:14:00 PM

0


"Arthur Lipscomb" <arthur@alum.calberkeley.org> wrote in message
news:jl7bc1$r4r$1@dont-email.me...
> On 3/31/2012 9:10 AM, anim8rFSK wrote:
>
>>>
>>> I just wish they'd figured out a way to do it without all the shaky-cam.
>>
>> Hunger Games has shaky cam? We talked about going to it last night in a
>> DBox theater where the seats move. 2:22 of seats moving to shaky cam?
>> Barf!
>
>
> I don't recall there being shaky cam. *Maybe* there was a scene or two
> but I doubt more than that.

The film uses shaky-cam extensively. Every fight scene, for example,
replaces the cost to film action sequences well with simple shaky cam
footage instead. I commented in the current films newsgroup about the movie
looking like it was 'found footage' style filming or that they used the
shaky cam to avoid an R rating. Some people seem to have noticed it while
other seem to have not noticed it.


Mason Barge

3/31/2012 8:23:00 PM

0

On Sat, 31 Mar 2012 08:53:38 -0700, Thanatos <atropos@mac.com> wrote:

>In article <ab7en79v9uh7pc7sl6m3rit1cdeb759ehe@4ax.com>,
> Mason Barge <masonbarge@gmail.com> wrote:
>
>> On Sat, 31 Mar 2012 05:47:01 -0400, Ubiquitous <weberm@polaris.net> wrote:
>>
>> >I watched:
>>
>> Movie night: THE HUNGER GAMES
>>
>> Solid - I had a great time. Hollywood only managed to screw up one or two
>> little things having to do with the romantic angle -- they make it into
>> more of a love story, but not enough to make it obnoxious.
>
>Yeah, they made it seem like the girl was actually into the guy she was
>fighting with (until the last scene, at least), when the book made it
>clear she wanted no part of the 'romance' and was just playing for the
>cameras.

It's too bad, in a way, since they had an actress with enough talent to
play the ambiguity she felt in the book.

But I suspect the studio hacks just weren't comfortable without a canned
romance.

>> The book was better but, if the book is good, the movie's never better.
>
>I thought 'Jaws' was good, but Spielberg made a better movie out of it.

Well, "good" just has too many meanings. I thought they were both
entertaining and both crap.

>> They did manage to show the violence with going over the top.
>
>I just wish they'd figured out a way to do it without all the shaky-cam.

I would have said "They could have done a lot more with the art direction
and cinematography", but that last word is long and hard to type.

In fact, considering the budget, both were subpar. But the book was good
enough that all they had to do was put it on film without screwing it up
completely, which they did.

Another plus, though -- they didn't overdo the special effects.

Mason Barge

3/31/2012 8:30:00 PM

0

On Sat, 31 Mar 2012 12:04:15 -0400, EGK <me@privacy.net> wrote:

>On Sat, 31 Mar 2012 11:22:27 -0400, Mason Barge <masonbarge@gmail.com>
>wrote:
>
>>On Sat, 31 Mar 2012 05:47:01 -0400, Ubiquitous <weberm@polaris.net> wrote:
>>
>>>I watched:
>>
>>Movie night: THE HUNGER GAMES
>>
>>Solid - I had a great time. Hollywood only managed to screw up one or two
>>little things having to do with the romantic angle -- they make it into
>>more of a love story, but not enough to make it obnoxious. The book was
>>better but, if the book is good, the movie's never better.
>>
>>They did manage to show the violence with going over the top. I'm
>>actually just as happy it isn't an "R".
>>
>>After this and Winter's Bone, Jennifer Lawrence is an official big leaguer
>>-- she was excellent. And just about time. I'm *really* getting tired of
>>Kirstin Stewart who, from the previews, it looks like she was simply
>>miscast in Snow White and the Huntsman.
>>
>>They could have done a lot more with the art direction, IMHO.
>>
>>Grade: A
>
>I was thinking of going to see this. I liked Jennifer Lawrence a lot in
>Winter's bone.

You should read the book. It's freaking great.

>Reading about The Hunger Games, I'm left with the sense
>it's a movie for kids or younger audiences. Not that it's a bad thing but
>I have no interest in the Twilight Saga for instance. Is that the case
>with this movie?

We've been over this, LOL. It's a whole lot better for a general audience
than Twilight. It's good. And in fact, the more I think about it, the
more I think it actually benefitted from being PG-13.

Whereas "Twilight" would have been a whole lot better with a hard "R" :)