Jump to page: 1 24  
Page
Thread overview
Templates and the '!'
Jul 23, 2004
Sha Chancellor
Jul 23, 2004
Berin Loritsch
Jul 23, 2004
Daniel Horn
Jul 23, 2004
Arcane Jill
Jul 23, 2004
Sean Kelly
Jul 23, 2004
Andrew Edwards
Jul 24, 2004
Sha Chancellor
Jul 26, 2004
Walter
Jul 26, 2004
Stewart Gordon
Jul 26, 2004
C. Sauls
Jul 26, 2004
Arcane Jill
Jul 26, 2004
Stewart Gordon
Jul 24, 2004
J C Calvarese
Jul 26, 2004
Arcane Jill
Jul 26, 2004
Berin Loritsch
Re: OT - Templates and the '!'
Jul 26, 2004
h3r3tic
Jul 27, 2004
John Reimer
Jul 27, 2004
Berin Loritsch
Jul 27, 2004
John Reimer
Jul 24, 2004
Elephant
Jul 24, 2004
Sha Chancellor
Jul 26, 2004
Walter
Jul 26, 2004
h3r3tic
Jul 26, 2004
Mike Parker
Jul 26, 2004
h3r3tic
Jul 26, 2004
Berin Loritsch
Jul 26, 2004
Matthias Becker
Jul 24, 2004
David Medlock
Jul 24, 2004
C. Sauls
Jul 24, 2004
Derek
Jul 26, 2004
Charles Hixson
Jul 26, 2004
Matthias Becker
July 23, 2004
I just was looking at a piece of code.  And while this is largely my problem, I keep reading:

Foo!(int)

as Foo not int.

And thinking what on earth? And then remembering oh yeah templates...

Why are we using the ! symbol for templates?  Couldn't we use a | or something else?  # isn't used, neither is @ or $.
July 23, 2004
Sha Chancellor wrote:

> I just was looking at a piece of code.  And while this is largely my problem, I keep reading:
> 
> Foo!(int)
> 
> as Foo not int.
> 
> And thinking what on earth? And then remembering oh yeah templates...
> 
> Why are we using the ! symbol for templates?  Couldn't we use a | or something else?  # isn't used, neither is @ or $.

I agree.

Foo!(int)
Foo|(int)
Foo:(int)
Foo@(int)
Foo#(int)
Foo$(int)

Out of the options listed, I think I like the pipe or colon declarator
the best.

The "!" symbol just naturally maps to "not" in many people's minds.
July 23, 2004
you've corrupted me!(Human)
now i'll see func!(type) as a not...
never saw it before you said it, and I've been a C++ programmer for ages

Berin Loritsch wrote:
> Sha Chancellor wrote:
> 
>> I just was looking at a piece of code.  And while this is largely my problem, I keep reading:
>>
>> Foo!(int)
>>
>> as Foo not int.
>>
>> And thinking what on earth? And then remembering oh yeah templates...
>>
>> Why are we using the ! symbol for templates?  Couldn't we use a | or something else?  # isn't used, neither is @ or $.
> 
> 
> I agree.
> 
> Foo!(int)
> Foo|(int)
> Foo:(int)
> Foo@(int)
> Foo#(int)
> Foo$(int)
> 
> Out of the options listed, I think I like the pipe or colon declarator
> the best.
> 
> The "!" symbol just naturally maps to "not" in many people's minds.
July 23, 2004
In article <cdrvjf$2md5$1@digitaldaemon.com>, Berin Loritsch says...
>
>I agree.
>
>Foo!(int)
>Foo|(int)
>Foo:(int)
>Foo@(int)
>Foo#(int)
>Foo$(int)
>
>Out of the options listed, I think I like the pipe or colon declarator the best.

Well, would I be shot down in flames for suggesting this, rather obvious, alternative:

Foo<int>

Arcane Jill


July 23, 2004
In article <cds3re$2qcl$1@digitaldaemon.com>, Arcane Jill says...
>
>In article <cdrvjf$2md5$1@digitaldaemon.com>, Berin Loritsch says...
>>
>>I agree.
>>
>>Foo!(int)
>>Foo|(int)
>>Foo:(int)
>>Foo@(int)
>>Foo#(int)
>>Foo$(int)
>>
>>Out of the options listed, I think I like the pipe or colon declarator the best.
>
>Well, would I be shot down in flames for suggesting this, rather obvious, alternative:
>
>Foo<int>

hehe... As for the previous suggestions, the colon is used as a label specifier while pipe is not easily accessible on many international keyboards.  From a purely semantic standpoint, "!" correlates much more closely with something like template instantiation than with negation.  But then we're all victims of convention ;)  I like it how it is.  The only other one I sort of like from a visual standpoint is "$"


Sean


July 23, 2004
Sean Kelly wrote:
> In article <cds3re$2qcl$1@digitaldaemon.com>, Arcane Jill says...
> 
>>In article <cdrvjf$2md5$1@digitaldaemon.com>, Berin Loritsch says...
>>
>>>I agree.
>>>
>>>Foo!(int)
>>>Foo|(int)
>>>Foo:(int)
>>>Foo@(int)
>>>Foo#(int)
>>>Foo$(int)
>>>
>>>Out of the options listed, I think I like the pipe or colon declarator
>>>the best.
>>
>>Well, would I be shot down in flames for suggesting this, rather obvious,
>>alternative:
>>
>>Foo<int>
> 
> 
> hehe... As for the previous suggestions, the colon is used as a label specifier
> while pipe is not easily accessible on many international keyboards.  From a
> purely semantic standpoint, "!" correlates much more closely with something like
> template instantiation than with negation.  But then we're all victims of
> convention ;)  I like it how it is.  The only other one I sort of like from a
> visual standpoint is "$"
> 
> 
> Sean
> 

I have to agree with Sean here. ! seems completely natural to me. Then again, I'm a Neophyte "D" Programmer: naturally biased towards all things "D".
July 24, 2004
In article <cds80e$2u3d$1@digitaldaemon.com>, Andrew Edwards says...
>
>Sean Kelly wrote:
>> In article <cds3re$2qcl$1@digitaldaemon.com>, Arcane Jill says...
>> 
>>>In article <cdrvjf$2md5$1@digitaldaemon.com>, Berin Loritsch says...
>>>
>>>>I agree.
>>>>
>>>>Foo!(int)
>>>>Foo|(int)
>>>>Foo:(int)
>>>>Foo@(int)
>>>>Foo#(int)
>>>>Foo$(int)
>>>>
>>>>Out of the options listed, I think I like the pipe or colon declarator the best.
>>>
>>>Well, would I be shot down in flames for suggesting this, rather obvious, alternative:
>>>
>>>Foo<int>
>> 
>> 
>> hehe... As for the previous suggestions, the colon is used as a label specifier while pipe is not easily accessible on many international keyboards.  From a purely semantic standpoint, "!" correlates much more closely with something like template instantiation than with negation.  But then we're all victims of convention ;)  I like it how it is.  The only other one I sort of like from a visual standpoint is "$"
>> 
>> Sean
>
>I have to agree with Sean here. ! seems completely natural to me. Then again, I'm a Neophyte "D" Programmer: naturally biased towards all things "D".

I think I like the $ as the best alternative also. :P

Foo$(int) looks good to me.


July 24, 2004
Arcane Jill wrote:
> In article <cdrvjf$2md5$1@digitaldaemon.com>, Berin Loritsch says...
> 
>>I agree.
>>
>>Foo!(int)
>>Foo|(int)
>>Foo:(int)
>>Foo@(int)
>>Foo#(int)
>>Foo$(int)
>>
>>Out of the options listed, I think I like the pipe or colon declarator
>>the best.
> 
> 
> Well, would I be shot down in flames for suggesting this, rather obvious,
> alternative:
> 
> Foo<int>
> 
> Arcane Jill

No flames. But there's a good reason why D didn't go down this road. Using < and > for templates invites all kinds of parsing headaches (something about how < and > are already operators). It's Walter's compiler and he wanted to design it so that parsing is easy and fun.

By the way, don't you miss the instance keyword?
instance Foo(int) iFoo;

Ah, the good old days...

-- 
Justin (a/k/a jcc7)
http://jcc_7.tripod.com/d/
July 24, 2004
is there any reason it can't be just

Foo(int) a;

?

perhaps it has something to do with it looking a lot like a function.

personally i think Foo!(int) looks like Foo *factorial* int.  i was confused
as hell when i updated D from 0.74 to 0.94 (i forgot about D for a while)
when i saw all these List!(int) and what have you.


July 24, 2004
Jarrett Billingsley wrote:
> is there any reason it can't be just
> 
> Foo(int) a;
> 
> ?
> 
> perhaps it has something to do with it looking a lot like a function.
> 
> personally i think Foo!(int) looks like Foo *factorial* int.  i was confused
> as hell when i updated D from 0.74 to 0.94 (i forgot about D for a while)
> when i saw all these List!(int) and what have you.
> 
> 

Maybe the ! is an upside down i for instance? Hehe.

The colon looks natural but also looks like a label.
The string is unused so it would get my vote as an alternative.

Hmmmm arguing syntax and not semantics....flamewar approaching!
HEHEHE
« First   ‹ Prev
1 2 3 4