May 24, 2005
In article <d6tfcc$221o$1@digitaldaemon.com>, Walter says...
>
>While I understand the desire for an isnot operator as the complement of 'is', I confess I always just hated 'isnot', both for it's BASICy look and the rude alternate way of pronouncing it.
>
>How about:
>    !is
>?

Looks great to me!

It was my 4th choice, but I'm not complaining. ;) http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/21210

jcc7
May 24, 2005
On Mon, 23 May 2005 22:47:51 -0600, Hasan Aljudy wrote:

> Derek Parnell wrote:
>> On Tue, 24 May 2005 03:47:31 +0000 (UTC), Nod wrote:
>> 
>>>In article <d6tfcc$221o$1@digitaldaemon.com>, Walter says...
>> 
>>>>How about:
>>>>   !is
>>>
>>>That !is very pretty. Neither do I like the idea of mixing letters and punctuation. I'd interpret that as two operators. Not that it matters in this context, but still :)
>> 
>> I think that this mixing punctuation and letters will be a parsing
>> nightmare, and not worth the effort.
>> 
> 
> I don't know how compilers work .. but isn't that the same as !== ?

No it's not.  By 'punctuation' I mean those characters that cannot appear in an identifier name.

 "!==" contains three punctuation characters '!', '=', and '='.
but
 "!is" contains one punctuation character and two identifier characters
'!', 'i', and 's'.

Why this makes it tricky for parsers is that the series of characters "!is" is of the same type as "=ab", and generally, parsers would see both series as two tokens - '!' and 'is', and '=' and 'ab'. That is, when a parser sees a punctuation character, it marks this as the start of a token and continues scanning until it gets a non-punctuation character (or white space) in order to find the end of the token.

Now it could be that D will actually see this initially as two tokens, but a special post-parser routine will recognize certain token combinations as really being a single token. So the adjacent '!' and 'is' tokens could be transformed into '!is' token.

-- 
Derek
Melbourne, Australia
24/05/2005 3:09:11 PM
May 24, 2005
"Derek Parnell" <derek@psych.ward> wrote in message news:193ee48yh511k.1cixoutbwq6i6.dlg@40tude.net...
> Which is exactly my point. I am fearful that you will decide that, for example only, "!in" is too much like trash while other just-as-knowledgeable people would regard it as art. How do we, as a community, decide on what to include/exclude? There needs to be some form of 'measurement' (yes - I use the term loosely) or criteria that can be used so that we can prevent seemingly arbitrary, or biased, or unreasonable, or whatever!, decisions being enacted without due justification.

I am asking for feedback on this, but at some point, somebody's just gotta decide.


May 24, 2005
In article <d6tfcc$221o$1@digitaldaemon.com>, Walter says...
>
>While I understand the desire for an isnot operator as the complement of 'is', I confess I always just hated 'isnot', both for it's BASICy look and the rude alternate way of pronouncing it.
>
>How about:
>    !is
>?
>
>

FWIW, I'd prefer "isnt".

The absence of the ' to "indicate the omission of a character"--Right. Replace a character with a character to indicate that the first character isn't there!--has always kinda bugged me in english anyway.

And 'isnot' sounds like Data, whereas Lore had learnt to say 'isnt' :)

Concise, unabiguous and no harder to learn for non-english speaking natives than '!is', thought I guess that gets closer to the French 'n'est pas'.

That said, I don;t really have a problem with '!=='. And come to that, I would probably have gone for '=!='.

anon.


May 24, 2005
In article <d6titm$25ll$1@digitaldaemon.com>, Walter says...
>
>
>
>Actually, the ! is pronounced as a tongue click:
>
>    !is => "(click)is"

I've been thinking the correct pronounciation for ! was 'Wahlookkah'.

Ciao

P.S.: !is for me is as good as !=, so is !in.




May 24, 2005
"Vathix" <vathix@dprogramming.com> wrote in message news:op.sq81oz1ykcck4r@esi...
> and !!x
> which means absolutely not!!

Actually, I use "!!" a lot when passing ints for a bool. It's nicer than x!=0 or x!=false :-)


May 24, 2005
> That said, I don;t really have a problem with '!=='. And come to that, I
> would
> probably have gone for '=!='.

I've been following this "isnot" discussion for quite a while, and this is
the first time I see "=!=" mentioned.
It's not prety, but neither is "!is", and probably because I'm not used to
it.

=!= solves the readability problem of !==, and doesn't mix punctuation with text, what I like.

I still prefer "isnot" though. It does sound better than "!is", so the pronunciation argument mentioned by Walter seems invalid to begin with.

Also, please, arguments of the type "<x> looks like <language y> and I don't like <language y>". That's a strawman argument. I wish we'd get rid of this kind of reasoning once and for all.

L.


May 24, 2005
Lionello Lunesu wrote:
> "Vathix" <vathix@dprogramming.com> wrote in message news:op.sq81oz1ykcck4r@esi...
> 
>>and !!x
>>which means absolutely not!!
> 
> 
> Actually, I use "!!" a lot when passing ints for a bool. It's nicer than x!=0 or x!=false :-) 
> 
> 
correct me if I'm wrong, but isn't "!!" uselessly redundant? you can just remove it and achieve the same effect.
May 24, 2005
At least with VC6 you get a warning, something like "converting to bool (performance warning)", which will dissappear with either a i!=0 or !!i (i being an integer, or anything but bool).

L.


May 24, 2005
"Derek Parnell" <derek@psych.ward> wrote in message news:vinoh9xvdorv$.1ok3o74ypkpo9.dlg@40tude.net...
> On Mon, 23 May 2005 13:44:50 -0700, Walter wrote:
>
> > While I understand the desire for an isnot operator as the complement of 'is', I confess I always just hated 'isnot', both for it's BASICy look
and
> > the rude alternate way of pronouncing it.
> >
> > How about:
> >     !is
> > ?
>
> I think your reasons are quite unsophisticated,

LOL. It does come down in the end to aesthetics. BASIC just doesn't look good on the printed page to me. I like !== and ===, but after a while it became obvious that wasn't going to fly.

> but it doesn't really
> matter what you choose Walter; anything is better than the current
> situation.

!is has some advantages - 'is' is already a keyword, so it won't conflict with anything, and there's some level of consistency with == and !=.

> I think this would be the first case in D, of an operator that mixes letters with punctuation characters. If your okay with that, then go with this hybrid.

Not exactly, the '!' and the 'is' would still be separate tokens. One could
write:
    (a !        is b)
for example.

> Do you also understand the desire for a '!in' operator?

I was unaware of that, I must have overlooked a thread here.