July 24, 2004 Re: !(null is hkey) ?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sha Chancellor | Sha Chancellor wrote: > In article <cdppih$1ab1$1@digitaldaemon.com>, > "Matthew" <admin.hat@stlsoft.dot.org> wrote: > > ... > Why don't i see === on the expressions page? What would be the difference between it and ==? Is null now meaning something other than 0 in D? The documentation is incomplete. Basically, "====" has the same purpose as "is". They test to see if two object references are identical (that they both point to the same object). So "==" you're comparing *values" and with "===" you're comparing *references*. It's a subtle difference, but it's an important one. I'm sure someone else can explain it better than I can. Anyways, here's code I found lying around on my computer that might help explain "===" and "is" do. void main() { Object o, p; /* o and p are instantiated as separate (different) objects. */ o = new Object(); p = new Object(); if(o is p) printf("o and p are references to the same object.\n"); else printf("o and p are different objects.\n"); if(!(o is p)) printf("They're not the same.\n"); else printf("Yes, o is the same reference as p!\n"); if(o === p) printf("o and p are references to the same object.\n"); else printf("o and p are different objects.\n"); if(!(o === p)) printf("They're not the same.\n"); else printf("Yes, o is the same reference as p!\n"); if(o !== p) printf("They're not the same.\n"); else printf("Yes, o is the same reference as p!\n"); printf("\nNow I'm gong to make them the same...\n"); delete p; o = p; /* Now they're the same. */ if(o is p) printf("o and p are references to the same object.\n"); else printf("o and p are different objects.\n"); if(!(o is p)) printf("They're not the same.\n"); else printf("Yes, o is the same referenceas p!\n"); if(o === p) printf("o and p are references to the same object.\n"); else printf("o and p are different objects.\n"); if(!(o === p)) printf("They're not the same.\n"); else printf("Yes, o is the same reference as p!\n"); if(o !== p) printf("They're not the same.\n"); else printf("Yes, o is the same reference as p!\n"); } > > Sorry for the stupid questions. They're not stupid questions. I hope I answered them. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/ |
July 24, 2004 Re: !(null is hkey) ?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kris | Kris wrote: > "J C Calvarese" wrote ... > >>Actually, "isnuttin" is the best! >> >>Hmmm, on second thought, it's a tad verbose. >> >>OK, "aint" it is! >> > > > James ought to get some kind of medal for that one ~ it's priceless <g> > > I'd lay a bet it's part of the Ebonics Computer Science curriculum in > Oakland ... (that's "Political Correctness Meets Lunacy" for those who ain't > familiar). I think in Ebonics it's either "benot" or "beaint", but I'm not certain. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/ |
July 24, 2004 Re: !(null is hkey) ?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to James McComb | On Sat, 24 Jul 2004 03:00:02 +1000, James McComb <alan@jamesmccomb.id.au> wrote: > Ben Hinkle wrote: > >> if a single keyword is chosen I propose "isnt" since "isn't" is the >> contraction of "is" and "not". The word "isnot" doesn't exist. > > The word "typedef" isn't a word either. I don't suppose you want Walter to introduce a "type definition" keyword. To be fair, you're commiting the "Strawman" here: http://www.intrepidsoftware.com/fallacy/straw.php The first argument for "isnt" is the stronger of the two, and you've completely ignored it. I do agree "isnot" shouldn't be ignored as an option just because it isn't a word. "isnt" gets my vote BTW. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
July 25, 2004 Re: !(null is hkey) ?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Regan Heath | In article <opsbm5hylk5a2sq9@digitalmars.com>, Regan Heath says... >I do agree "isnot" shouldn't be ignored as an option just because it isn't a word. So how come no-one's mentioned the possibility of "isNot" yet? From the style guide Naming Conventions section: "Names formed by joining multiple works should have each word other than the first capitalized." Arcane Jill |
July 25, 2004 Re: !(null is hkey) ?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Arcane Jill | Arcane Jill wrote: > In article <opsbm5hylk5a2sq9@digitalmars.com>, Regan Heath says... > > >>I do agree "isnot" shouldn't be ignored as an option just because it isn't a word. > > > So how come no-one's mentioned the possibility of "isNot" yet? > > From the style guide Naming Conventions section: "Names formed by joining > multiple works should have each word other than the first capitalized." > > Arcane Jill Capitalization of the second word never even occurred to me. It probably hasn't been brought up because the goal here is to get a new keyword. Since every other keyword is all lowercase (including typedef, typeof, ireal, ubyte, and ushort), "isNot" would stick out as a sore thumb as an addition to that list. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/ |
July 26, 2004 Re: !(null is hkey) ?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Arcane Jill | In article <ce0m8n$2d6f$1@digitaldaemon.com>, Arcane Jill says... >So how come no-one's mentioned the possibility of "isNot" yet? > >From the style guide Naming Conventions section: "Names formed by joining multiple works should have each word other than the first capitalized." > >Arcane Jill isnot is faster to type than isNot how about aint ? even faster and looks kewl ;) |
July 26, 2004 Re: !(null is hkey) ?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | J C Calvarese wrote:
> Kris wrote:
>
>> "J C Calvarese" wrote ...
>>
>>> Actually, "isnuttin" is the best!
>>>
>>> Hmmm, on second thought, it's a tad verbose.
>>>
>>> OK, "aint" it is!
>>>
>>
>>
>> James ought to get some kind of medal for that one ~ it's priceless <g>
>>
>> I'd lay a bet it's part of the Ebonics Computer Science curriculum in
>> Oakland ... (that's "Political Correctness Meets Lunacy" for those who ain't
>> familiar).
>
>
> I think in Ebonics it's either "benot" or "beaint", but I'm not certain.
You can't keep up with ebonics, it changes to fast. The last
approximately close way to express it I can recall is:
if ( null not_bout_it_bout_it hkey )
bout it == about it
|
Copyright © 1999-2021 by the D Language Foundation