June 19, 2008
Walter Bright pisze:
> aarti_pl wrote:
>> Walter Bright pisze:
>>> Some new stuff to make writing templates easier.
>>>
>>> http://www.digitalmars.com/d/1.0/changelog.html
>>> http://ftp.digitalmars.com/dmd.1.031.zip
>>>
>>> http://www.digitalmars.com/d/2.0/changelog.html
>>> http://ftp.digitalmars.com/dmd.2.015.zip
>>
>> Out of curiosity... Why have you implemented template constraints syntax using additional pair of parenthesis?
> 
> Because when we tried to stuff everything into the parameter list, it got kinda visually incomprehensible when the constraints got beyond the trivial.

Well, it might be a bit less readable in specific (complicated) cases, but in general it should be more readable, because it groups same functionality - type matching - in the same place. It's generally good thing.

Let's compare:
void foo(T if isString!(T))() {}

vs.:
void foo(T)() if(isString!(T)) {}

is really second version more readable?

or:
void foo(N : N=int if N & 1)() {}
or alternatively in shorter form e.g. :
void foo(int N if N & 1)() {}

vs.:
void foo(int N)() if (N & 1) {}

[I prefer first version of syntax, which although longer, would be exactly same for every case, so it is much easier to learn. Currently there is a lot of special cases e.g. for is().]

But even if second version is visually better, I can not understand how strictly aesthetic argument can outweigh arguments about consistency in language - same syntax for a few language constructs is IMHO strong argument, much stronger than visual appearance. It is much easier to learn such a language, because you can just apply same pattern for few different, but similar cases. And also arguments from my first posts (e.g. natural order of symbols declaration) are still valid...

But anyway thanks - this is rationale although I don't agree fully :-)

BR
Marcin Kuszczak
June 19, 2008
Walter Bright wrote:

> Some new stuff to make writing templates easier.
> 
> http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.031.zip
> 
> http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.015.zip

Why is "alias" required when specifying a template parameter?  It seems like the most accepting and general case.  Why wouldn't it be the default?
June 19, 2008
Frank Benoit wrote:
> What effect has -fPIC to code?
> When do i use -fPIC?

It makes the generated code position-independent.

> What is a situation, where the version D_PIC is useful in the source code?

Some inline ASM operation that doesn't work with position-independent code...?
June 19, 2008
Jason House wrote:
> Walter Bright wrote:
> 
>> Some new stuff to make writing templates easier.
>>
>> http://www.digitalmars.com/d/1.0/changelog.html
>> http://ftp.digitalmars.com/dmd.1.031.zip
>>
>> http://www.digitalmars.com/d/2.0/changelog.html
>> http://ftp.digitalmars.com/dmd.2.015.zip
> 
> Why is "alias" required when specifying a template parameter?  It seems like
> the most accepting and general case.  Why wouldn't it be the default?

The default is to interpret it as a type.

I have argued that actually we need a "type" keyword (or something like it) to declare that a template parameter is a type.  IMHO, a parameter without a limiter should accept *any* type of valid parameter: type, alias, or value.
June 19, 2008
Jason House wrote:
> Walter Bright wrote:
> 
>> Some new stuff to make writing templates easier.
>>
>> http://www.digitalmars.com/d/1.0/changelog.html
>> http://ftp.digitalmars.com/dmd.1.031.zip
>>
>> http://www.digitalmars.com/d/2.0/changelog.html
>> http://ftp.digitalmars.com/dmd.2.015.zip
> 
> Why is "alias" required when specifying a template parameter?  It seems like
> the most accepting and general case.  Why wouldn't it be the default?

Really? I have never had a use for an alias parameter (although I guess most types could work as alias parameters) except using an un-speced trick with regards to their name mangling. They seem way to permissive.
June 19, 2008
Frank Benoit wrote:
> Walter Bright schrieb:
>> Some new stuff to make writing templates easier.
>>
>> http://www.digitalmars.com/d/1.0/changelog.html
>> http://ftp.digitalmars.com/dmd.1.031.zip
>>
>> http://www.digitalmars.com/d/2.0/changelog.html
>> http://ftp.digitalmars.com/dmd.2.015.zip
> 
> What effect has -fPIC to code?
> When do i use -fPIC?
> What is a situation, where the version D_PIC is useful in the source code?

It was requested by me. When fPIC is enabled, if you are writing inline asm, you can't access any global values (including constants). So you need to do some slow, ugly workarounds. It's a big problem for SSE code  which doesn't have any immediate instructions. You can't even load the value 1 into a register!

June 19, 2008
On Wed, 18 Jun 2008 01:27:03 -0700, Walter Bright <newshound1@digitalmars.com> wrote:

>Some new stuff to make writing templates easier.
>
>http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.031.zip
>
>http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.015.zip

Nice release. Thanks!
June 19, 2008
Don schrieb:
> It was requested by me. When fPIC is enabled, if you are writing inline asm, you can't access any global values (including constants). So you need to do some slow, ugly workarounds. It's a big problem for SSE code  which doesn't have any immediate instructions. You can't even load the value 1 into a register!
> 

Oh, i see.
thanks
June 19, 2008
Frank Benoit wrote:
> What effect has -fPIC to code?
> When do i use -fPIC?
> What is a situation, where the version D_PIC is useful in the source code?

Don answered this, but I wish to add that -fPIC has the same effect that -fPIC has for gcc on linux.
June 19, 2008
Bill Baxter:
> For the first 10 years it's all Guido plus 2 or 3 others, but after 2000 the action really heats up.

It corresponds to about Python 1.5.x, probably V. 1.5 has stopped being a toy language and started to be something you can work with, you can download a fixed version of it still, some people today write Python that is compatible with that version interpreter still:
http://www.python.org/download/releases/1.5/

Even a blind like me can see that if D wants a chance of success, its development must become more open.

Bye,
bearophile