www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - DMD 0.140 release

reply "Walter Bright" <newshound digitalmars.com> writes:
Template and complex number fixes. New name demangler!

http://www.digitalmars.com/d/changelog.html
Nov 24 2005
next sibling parent reply Sean Kelly <sean f4.ca> writes:
Walter Bright wrote:
 Template and complex number fixes. New name demangler!
Floating point and string template parameters? Awesome! And Happy Thanksgiving! Sean
Nov 24 2005
parent reply Sean Kelly <sean f4.ca> writes:
By the way... how did you get around the symbol length issue for 
template string parameters?  Is a checksum part of the name or some such?


Sean
Nov 24 2005
parent "Walter Bright" <newshound digitalmars.com> writes:
"Sean Kelly" <sean f4.ca> wrote in message
news:dm60ov$282h$1 digitaldaemon.com...
 By the way... how did you get around the symbol length issue for
 template string parameters?
I didn't. It's necessary to be conservative in how long a string you use.
 Is a checksum part of the name or some such?
No.
Nov 24 2005
prev sibling next sibling parent reply Georg Wrede <georg.wrede nospam.org> writes:
Walter Bright wrote:
 Template and complex number fixes. New name demangler!
 
 http://www.digitalmars.com/d/changelog.html
Just... wow! Bet the turkey tastes good after all this!
Nov 24 2005
parent "Walter Bright" <newshound digitalmars.com> writes:
"Georg Wrede" <georg.wrede nospam.org> wrote in message
news:43867C2F.6090907 nospam.org...
 Walter Bright wrote:
 Template and complex number fixes. New name demangler!

 http://www.digitalmars.com/d/changelog.html
Just... wow! Bet the turkey tastes good after all this!
I'm busy digesting at the moment. Happy T-Day to everyone!
Nov 24 2005
prev sibling next sibling parent reply Don Clugston <dac nospam.com.au> writes:
Walter Bright wrote:
 Template and complex number fixes. New name demangler!
 
 http://www.digitalmars.com/d/changelog.html
Truly awesome! I'm itching to have to a play with these. Sounds like I can have a 90% hack reduction in my metaprogramming code! BTW, in the changelog, the link to std.demangle doesn't work, and I couldn't find it on the phobos page, either.
Nov 24 2005
parent "Walter Bright" <newshound digitalmars.com> writes:
"Don Clugston" <dac nospam.com.au> wrote in message
news:dm6g3h$2mv2$1 digitaldaemon.com...
 BTW, in the changelog, the link to std.demangle doesn't work, and I
 couldn't find it on the phobos page, either.
Done.
Nov 25 2005
prev sibling next sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Walter Bright wrote:
 Template and complex number fixes. New name demangler!
"Added std.windows.charset (thanks to Stewart Gordon, D/28246)." Excellent! Only, I think you mean 28264 or 28426, not 28246. And you mistyped my name in the comment to fromMBSz. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Nov 25 2005
next sibling parent Stewart Gordon <smjg_1998 yahoo.com> writes:
Stewart Gordon wrote:
 Walter Bright wrote:
 Template and complex number fixes. New name demangler!
"Added std.windows.charset (thanks to Stewart Gordon, D/28246)." Excellent! Only, I think you mean 28264 or 28426, not 28246. And you mistyped my name in the comment to fromMBSz.
More observations while I'm at it: - The comment in std.file states that the toMBSz there is deprecated, but you haven't given it the deprecated attribute. - toUTF8(wchar*) is nowhere to be seen. OK, so it's a fairly trivial wrapper, but still.... Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Nov 25 2005
prev sibling parent "Walter Bright" <newshound digitalmars.com> writes:
"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message
news:dm6rdm$57i$1 digitaldaemon.com...
 Excellent!  Only, I think you mean 28264 or 28426, not 28246.

 And you mistyped my name in the comment to fromMBSz.
Sorry about that. I'll fix it.
Nov 25 2005
prev sibling parent reply Don Clugston <dac nospam.com.au> writes:
Walter Bright wrote:
 Template and complex number fixes. New name demangler!
 
 http://www.digitalmars.com/d/changelog.html
 
A question: When are the implicit template properties supposed to apply? There's a interesting corner case involving properties of built-in types. With the code template q() { const char [] q = "abc"; } const int a = q!().length; does not compile. Fair enough, it's looking for q!().length, not q!().q.length. Although potentially the rule for evaluating a!().b could be: look for a!().b, if not found, look for a!().a.b I don't think this recurses, even if a!().a was a template. So, I tried const int a = (q!()).length; This doesn't compile either. Based on the error message, it seems that parentheses suppress the implicit property feature. Is this behaviour intentional? (Maybe it could be useful). Anyway, const int a = (q!() ~ "").length works as expected, as does: template strlen(char [] str) { const int strlen = str.length; } const int a = strlen!(q!());
Nov 25 2005
next sibling parent "Walter Bright" <newshound digitalmars.com> writes:
It certainly seems it should work. I'll check into it.
Nov 25 2005
prev sibling parent reply "Walter Bright" <newshound digitalmars.com> writes:
"Don Clugston" <dac nospam.com.au> wrote in message
news:dm72ee$bvp$1 digitaldaemon.com...
 With the code

 template q()
 {
     const char [] q = "abc";
 }

 const int a = q!().length;

 does not compile.
I tried this with 0.140: template q() { const char [] q = "abc"; } const int a = q!().length; void main() { printf("a = %d\n", a); } and got: a = 3 as the output.
Nov 26 2005
parent Don Clugston <dac nospam.com.au> writes:
Sorry, I got that a bit wrong. Here's a minimal test case:

--------------
template cat(int n)
{
   const int dog = n;
}

const char [] q = "qqqq";

const int thisfails = cat!(q.length).dog;
--------------
bug.d(9): no property 'length' for type 'char[]'
----------------

But if you replace the last line with:

const int a = q.length;
const int thisworks = cat!(a).dog;

it works. So it seems to be a simple order-of-evaluation bug that 
doesn't have anything to do with implicit template properties. I'll post 
it to d.D.bugs.


Walter Bright wrote:
 "Don Clugston" <dac nospam.com.au> wrote in message
 news:dm72ee$bvp$1 digitaldaemon.com...
 
With the code

template q()
{
    const char [] q = "abc";
}

const int a = q!().length;

does not compile.
I tried this with 0.140: template q() { const char [] q = "abc"; } const int a = q!().length; void main() { printf("a = %d\n", a); } and got: a = 3 as the output.
Nov 28 2005