Jump to page: 1 27  
Page
Thread overview
DMD 0.77 release
Jan 03, 2004
Walter
Re: DMD 0.77 release - where is c.math ?
Jan 03, 2004
Ant
Jan 03, 2004
Walter
Jan 03, 2004
Lewis
Jan 03, 2004
Hauke Duden
Jan 03, 2004
Jeroen van Bemmel
Jan 03, 2004
J Anderson
Jan 03, 2004
Walter
Jan 03, 2004
Jeroen van Bemmel
Jan 03, 2004
davepermen
Jan 04, 2004
Jeroen van Bemmel
Jan 04, 2004
Ilya Minkov
Jan 04, 2004
Jeroen van Bemmel
Jan 04, 2004
Ilya Minkov
Jan 05, 2004
Walter
Jan 05, 2004
Jeroen van Bemmel
Jan 05, 2004
Jeroen van Bemmel
Jan 06, 2004
Walter
Jan 06, 2004
The Lone Haranguer
Jan 03, 2004
Walter
Jan 04, 2004
Matthew
Jan 04, 2004
Walter
Jan 04, 2004
Matthew
Jan 04, 2004
Walter
Jan 04, 2004
Sean L. Palmer
Jan 04, 2004
Walter
Jan 03, 2004
J Anderson
Jan 03, 2004
Walter
Jan 04, 2004
Luna Kid
Jan 03, 2004
Robert
Jan 03, 2004
Sean L. Palmer
Jan 03, 2004
Walter
Jan 04, 2004
Ben Hinkle
Jan 04, 2004
Andy Friesen
Re: DMD 0.77 release - implicit templated types trough typeof - suggestion for walter
Jan 04, 2004
davepermen
Jan 04, 2004
J Anderson
Re: DMD 0.77 release - implicit templated types trough typeof - suggestion
Jan 04, 2004
davepermen
Jan 04, 2004
Robert
Jan 04, 2004
davepermen
Jan 05, 2004
Matthias Becker
Jan 05, 2004
Sean L. Palmer
Re: DMD 0.77 release- Internal error e2ir.c 133
Jan 03, 2004
Sean L. Palmer
Jan 03, 2004
C
Jan 03, 2004
C
Jan 03, 2004
Sean L. Palmer
Jan 04, 2004
Walter
Jan 04, 2004
Sean L. Palmer
Re: DMD 0.77 release... templates
Jan 03, 2004
Sean L. Palmer
Jan 04, 2004
Walter
Re: DMD 0.77 release Template Promoting
Jan 03, 2004
davepermen
Jan 05, 2004
Brad Anderson
Jan 05, 2004
Matthew
Jan 07, 2004
Phill
Jan 07, 2004
Robert
Jan 07, 2004
J Anderson
Jan 07, 2004
Robert
Jan 07, 2004
Phill
OT clover Re: DMD 0.77 release
Jan 07, 2004
Ilya Minkov
Jan 08, 2004
Phill
Jan 08, 2004
J Anderson
Jan 08, 2004
davepermen
Jan 08, 2004
Phill
Jan 08, 2004
davepermen
Jan 08, 2004
Luke D
Jan 09, 2004
Phill
Jan 09, 2004
Ilya Minkov
Jan 08, 2004
Ilya Minkov
January 03, 2004
Lots of new additions. Didn't get to most of the bug reports; I wanted to get D to be 'feature complete' first, the next version will be bug polishing. I'm setting sights on releasing D 1.0 by March.

Lots of improvements to templates:

o    No more instance keyword (though still supported for the time being).
To instantiate template Foo with arguments a,b use:
    Foo!(a,b)
which is equivalent to the C++:
    Foo<a,b>
but doesn't have parsing problems.

o If there's only one declaration in a template, and its name matches the template name, it is 'promoted' to the enclosing scope:

    template Foo(T) { class Foo { T a,b; }}
    ...
    void func()
    {
        Foo(int) x;
        x.a = 3;
    }

o As a shortcut to the above, the template could have been written as:

    class Foo(T) { T a,b; }

There is no equivalent shortcut for function templates, the syntax would look too awful. But this works:

    template Max(T) { T Max(T a, T b) { return ... ; } }
    ...
        x = Max!(int)(5,7);

o Templates can now take 'alias' parameters where any non-local symbol can be substituted:

    template Foo(alias S) { int* x = &S; }

See the changelog for more cool stuff:

http://www.digitalmars.com/d/changelog.html



January 03, 2004
On Fri, 02 Jan 2004 20:00:56 -0800, Walter wrote:

> Lots of new additions.

:)

but where is std.c.math ?

Ant
January 03, 2004
Walter wrote:

> Lots of new additions. Didn't get to most of the bug reports; I wanted to
> get D to be 'feature complete' first, the next version will be bug
> polishing. I'm setting sights on releasing D 1.0 by March.
> 
> Lots of improvements to templates:
> 
> o    No more instance keyword (though still supported for the time being).
> To instantiate template Foo with arguments a,b use:
>     Foo!(a,b)
> which is equivalent to the C++:
>     Foo<a,b>
> but doesn't have parsing problems.
> 
> o If there's only one declaration in a template, and its name matches the
> template name, it is 'promoted' to the enclosing scope:
> 
>     template Foo(T) { class Foo { T a,b; }}
>     ...
>     void func()
>     {
>         Foo(int) x;
>         x.a = 3;
>     }
> 
> o As a shortcut to the above, the template could have been written as:
> 
>     class Foo(T) { T a,b; }
> 
> There is no equivalent shortcut for function templates, the syntax would
> look too awful. But this works:
> 
>     template Max(T) { T Max(T a, T b) { return ... ; } }
>     ...
>         x = Max!(int)(5,7);
> 
> o Templates can now take 'alias' parameters where any non-local symbol can
> be substituted:
> 
>     template Foo(alias S) { int* x = &S; }
> 
> See the changelog for more cool stuff:
> 
> http://www.digitalmars.com/d/changelog.html
> 
> 
> 


Looks very impressive walter, keep up the excellent work!

yay @ switch case expressionlist

January 03, 2004
"Ant" <duitoolkit@yahoo.ca> wrote in message news:pan.2004.01.03.04.53.11.207275@yahoo.ca...
> but where is std.c.math ?

It's there now.


January 03, 2004
Wow. You've been busy!

Frankly speaking, I think the new templates just plain rock! ;)

Especially the alias mechanism is something that looks minor at first but could turn out to be very useful. It is now possibly to rename namespaces and just about everything else!

Great work!

Btw: the "name promotion" feature is missing in the docs on the website.

Hauke


Walter wrote:

> Lots of new additions. Didn't get to most of the bug reports; I wanted to
> get D to be 'feature complete' first, the next version will be bug
> polishing. I'm setting sights on releasing D 1.0 by March.
> 
> Lots of improvements to templates:
> 
> o    No more instance keyword (though still supported for the time being).
> To instantiate template Foo with arguments a,b use:
>     Foo!(a,b)
> which is equivalent to the C++:
>     Foo<a,b>
> but doesn't have parsing problems.
> 
> o If there's only one declaration in a template, and its name matches the
> template name, it is 'promoted' to the enclosing scope:
> 
>     template Foo(T) { class Foo { T a,b; }}
>     ...
>     void func()
>     {
>         Foo(int) x;
>         x.a = 3;
>     }
> 
> o As a shortcut to the above, the template could have been written as:
> 
>     class Foo(T) { T a,b; }
> 
> There is no equivalent shortcut for function templates, the syntax would
> look too awful. But this works:
> 
>     template Max(T) { T Max(T a, T b) { return ... ; } }
>     ...
>         x = Max!(int)(5,7);
> 
> o Templates can now take 'alias' parameters where any non-local symbol can
> be substituted:
> 
>     template Foo(alias S) { int* x = &S; }
> 
> See the changelog for more cool stuff:
> 
> http://www.digitalmars.com/d/changelog.html
> 
> 
> 
January 03, 2004
About pragma's: couldn't these be implemented using versioning functionality instead?

Each compiler defines an identifier as its version already, and proprietary
extensions would then have to be enclosed in such version sections.
For example:

version (DigitalMars) {
    __some_proprietary_keyword__ int x;
} else {
    int x;
}

Reasoning behind this: I tend to prefer minimalistic feature sets


January 03, 2004
Walter wrote:

>o    No more instance keyword (though still supported for the time being).
>To instantiate template Foo with arguments a,b use:
>  
>
Does this imply that your going to remove the instance keyword some time in the future? 

If so, it might be a good idea, to remove it from the example documentation (such as on http://www.digitalmars.com/d/declaration.html#alias), to prevent new users from using it.

PS - Sorry if I'm stating the obvious.

January 03, 2004
Jeroen van Bemmel wrote:

>About pragma's: couldn't these be implemented using versioning functionality
>instead?
>
>Each compiler defines an identifier as its version already, and proprietary
>extensions would then have to be enclosed in such version sections.
>For example:
>
>version (DigitalMars) {
>    __some_proprietary_keyword__ int x;
>} else {
>    int x;
>}
>
>Reasoning behind this: I tend to prefer minimalistic feature sets
>
>
>  
>
I think version and pragma are quite different beasts.  One is like a compile-time "if statement" while the other is like a compile time enable/disable.  What may be useful is if you can use versioning to determine if a pragma is enabled or not (or if it's in a particular state).

pragma(ident);

version (ident)
{
	//ident is enabled
}

January 03, 2004
"J Anderson" <REMOVEanderson@badmama.com.au> wrote in message
news:bt6jc4$flc$1@digitaldaemon.com...
| Walter wrote:
|
| >o    No more instance keyword (though still supported for the time
being).
| >To instantiate template Foo with arguments a,b use:
| >
| >
| Does this imply that your going to remove the instance keyword some time
| in the future?
|
| If so, it might be a good idea, to remove it from the example
| documentation (such as on
| http://www.digitalmars.com/d/declaration.html#alias), to prevent new
| users from using it.
|
| PS - Sorry if I'm stating the obvious.
|

Also it should be removed from error messages. This code:

class A(T) { T b; this(T _b) { b=_b; } }
void main() {
        A!(int) a = new A!(3);
}

Produces this message: "instance A(3) does not match any template
declaration".

Also, if I change the assignment to "new A!;" (wrong, obviously), dmd
crashes.

-----------------------
Carlos Santander Bernal


January 03, 2004
How Great!
Typeof properties and new features of templates are what I've been waiting
for.


BTW, though class templates can be very easily declared,
function templates, alias templates, etc. are not.
I think that template declaration like C++ is useful for the sake.

template(T) T max(T a, T b) {
    return a > b ? a : b;
}

It also looks like an attribute.

« First   ‹ Prev
1 2 3 4 5 6 7