Re: D 2.0 Stacktrace - similar problems

2010-10-08 Thread Benjamin Thaut
Am 08.10.2010 03:16, schrieb Austin Hastings: On 10/6/2010 4:00 PM, Yao G. wrote: I forgot to mention. I'm compiling the file using: dmd test.d C:\dmd\src\stacktrace.d C:\dmd\src\dbghelp.d -g -w I have a similar problem as Yao. I've got XP SP3/x86 with dbghelp.dll version 5.1.2600.5512

Re: QtD is suspended

2010-10-08 Thread Bruno Medeiros
On 17/09/2010 17:44, Andrei Alexandrescu wrote: On 9/17/10 10:48 CDT, Michel Fortin wrote: In my mind it's simpler to just explain the notion that an uninitialized hash is null and detached from anything else until initialized. Objects works like this (minus the implicit initialization part),

Go vs D

2010-10-08 Thread Walter Bright
http://www.reddit.com/r/programming/comments/dohif/go_vs_d_interesting_thread_on_the_go_mailing_list/

Re: D 2.0 Stacktrace

2010-10-08 Thread Denis Koroskin
On Wed, 06 Oct 2010 15:50:25 +0400, Benjamin Thaut c...@benjamin-thaut.de wrote: I wrote a small piece of sourcecode that generates stacktraces in D 2.0 under windows. It works both with the pdb and cv debug symbol format. For Exceptions that are derived from the Error class the trace

Re: D 2.0 Stacktrace

2010-10-08 Thread Sean Kelly
Denis Koroskin Wrote: I modified druntime to support stack-tracing for all kind of exceptions. It's very simple: 1) In object_.d, change traceContext() function linkage to C: extern(C) Throwable.TraceInfo traceContext(void* ptr = null) { ... } 2) In rt\deh.c, declare Interface*

Re: D 2.0 Stacktrace - similar problems

2010-10-08 Thread Austin Hastings
On 10/8/2010 2:46 AM, Benjamin Thaut wrote: Hm I don't have a XP machine to test on. But as Symbol 04 is resolved, it seems to work. It just can not resolve symbols inside your application. There is no upper limit to dbghelp.dll. I'm on Windows 7 with dbghelp version 6.1.7600.16385. Most likely

Re: D 2.0 Stacktrace - similar problems

2010-10-08 Thread Denis Koroskin
On Sat, 09 Oct 2010 02:36:30 +0400, Austin Hastings ah0801...@yahoo.com wrote: On 10/8/2010 2:46 AM, Benjamin Thaut wrote: Hm I don't have a XP machine to test on. But as Symbol 04 is resolved, it seems to work. It just can not resolve symbols inside your application. There is no upper

Re: Tuple literal syntax

2010-10-08 Thread Lars T. Kyllingstad
On Wed, 06 Oct 2010 23:04:35 -0700, Walter Bright wrote: There have been a couple of looong threads about tuples: http://www.digitalmars.com/d/archives/digitalmars/D/ Reddit_why_aren_t_people_using_D_93528.html http://www.digitalmars.com/d/archives/digitalmars/D/

Re: in everywhere

2010-10-08 Thread Pelle
On 10/08/2010 03:18 AM, Juanjo Alvarez wrote: On Thu, 7 Oct 2010 15:53:13 -0700, Jonathan M Davis jmdavisp...@gmx.com wrote: Except that when you're dealing with generic code which has to deal with multiple container types (like std.algorithm), you _need_ certain complexity guarantees about

Re: On C/C++ undefined behaviours (there is no Eclipse)

2010-10-08 Thread Simen kjaeraas
On Fri, 08 Oct 2010 06:55:12 +0200, Walter Bright newshou...@digitalmars.com wrote: Russel Winder wrote: So the ability to improve performance of code by just waiting and buying new kit is over -- at least for now. If you do not turn your serial code into parallel code there will be no

Re: in everywhere

2010-10-08 Thread Stanislav Blinov
Jonathan M Davis wrote: On Thursday, October 07, 2010 14:44:50 Stanislav Blinov wrote: But that is not a matter of library interface isn't it? It's a matter of algorithm/container choice. It's not the push_back that was slow in the end, it was std::vector (yes, that's arguable, but the point

Re: in everywhere

2010-10-08 Thread Torarin
2010/10/7 Andrei Alexandrescu seewebsiteforem...@erdani.org: In the end I figured there was only _one_ quadratic operation - appending to a vectorsize_t that held document lengths. That wasn't even the bulk of the data and it was the last thing I looked at! Yet it made the run time impossible

Re: Tuple literal syntax

2010-10-08 Thread bearophile
Lars T. Kyllingstad: Personally, I don't think we should start adding a dedicated tuple syntax at this point. There are so many things that are more important, and besides, I think the library tuples are pretty cool. We should instead focus on making Tuple!(...) even better. Tuples are

Re: Tuple literal syntax

2010-10-08 Thread Jonathan M Davis
On Friday 08 October 2010 03:30:35 bearophile wrote: Lars T. Kyllingstad: Personally, I don't think we should start adding a dedicated tuple syntax at this point. There are so many things that are more important, and besides, I think the library tuples are pretty cool. We should instead

Re: in everywhere

2010-10-08 Thread Jonathan M Davis
On Friday 08 October 2010 03:06:01 Stanislav Blinov wrote: Yet still, generality ends at some point. You can't devise every possible algorithm for any possible types and have it have set-in-stone complexity independently of types. Take std.range.popFrontN(). It's generic, and it's used in

Re: Tuple literal syntax

2010-10-08 Thread Lars T. Kyllingstad
On Fri, 08 Oct 2010 06:30:35 -0400, bearophile wrote: Lars T. Kyllingstad: Personally, I don't think we should start adding a dedicated tuple syntax at this point. There are so many things that are more important, and besides, I think the library tuples are pretty cool. We should instead

Re: in everywhere

2010-10-08 Thread Steven Schveighoffer
On Thu, 07 Oct 2010 19:28:59 -0400, Michel Fortin michel.for...@michelf.com wrote: On 2010-10-07 18:53:51 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org said: Input == Input to the program i.e. not known during compilation of the program. Sorry, but my interpretation in this

Re: On C/C++ undefined behaviours (on the term undefined behaviours)

2010-10-08 Thread Bruno Medeiros
On 07/10/2010 12:47, Stanislav Blinov wrote: 07.10.2010 14:38, Bruno Medeiros wrote: On 06/10/2010 16:59, Stanislav Blinov wrote: I always thought that the term itself came from language specification, i.e. the paper that *defines* behavior of the language and states that there are cases when

Re: in everywhere

2010-10-08 Thread Juanjo Alvarez
Pelle Wrote: On 10/08/2010 03:18 AM, Juanjo Alvarez wrote: On Thu, 7 Oct 2010 15:53:13 -0700, Jonathan M Davis jmdavisp...@gmx.com wrote: Except that when you're dealing with generic code which has to deal with multiple container types (like std.algorithm), you _need_ certain

Re: in everywhere

2010-10-08 Thread Steven Schveighoffer
On Thu, 07 Oct 2010 21:18:56 -0400, Juanjo Alvarez f...@fakeemail.com wrote: On Thu, 7 Oct 2010 15:53:13 -0700, Jonathan M Davis jmdavisp...@gmx.com wrote: Except that when you're dealing with generic code which has to deal with multiple container types (like std.algorithm), you _need_

Re: in everywhere

2010-10-08 Thread Steven Schveighoffer
On Thu, 07 Oct 2010 19:07:55 -0400, Rainer Deyke rain...@eldwood.com wrote: On 10/7/2010 14:33, Steven Schveighoffer wrote: On Thu, 07 Oct 2010 16:23:47 -0400, Rainer Deyke rain...@eldwood.com wrote: I can't say I've ever cared about the big-O complexity of an operation. Then you don't

Re: Tuple literal syntax

2010-10-08 Thread Justin Johansson
On 8/10/2010 9:30 PM, bearophile wrote: Lars T. Kyllingstad: Personally, I don't think we should start adding a dedicated tuple syntax at this point. There are so many things that are more important, and besides, I think the library tuples are pretty cool. We should instead focus on making

Re: Open invitation for Kenji Hara

2010-10-08 Thread Peter Alexander
== Quote from Eric Poggel (dnewsgro...@yage3d.net)'s article Is this duck-typing for D? It looks more like something that would allow you to take a non- polymorphic class and make it polymorphic. e.g. you have a Square class and a Circle class, both with a draw() method, but with no common base

What is a tuple and why should one care?

2010-10-08 Thread Justin Johansson
There's a lot of (imho, pointless) discussion going on about tuples in D. I've asked before and haven't any illumination, especially of Walter. In the context of D, can someone please enlighten me as to exactly what a tuple is supposed to be. The discussion so far appears to me to be focusing

Re: What is a tuple and why should one care?

2010-10-08 Thread Michel Fortin
On 2010-10-08 08:37:39 -0400, Justin Johansson n...@spam.com said: There's a lot of (imho, pointless) discussion going on about tuples in D. I've asked before and haven't any illumination, especially of Walter. In the context of D, can someone please enlighten me as to exactly what a tuple is

Uniform Function Call syntax for properties

2010-10-08 Thread Steven Schveighoffer
Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a function: @property int foo(int x) Is this a global setter or a getter on an int? i.e. int y = foo = 3; or int y = (3).foo; ??? I know arrays have an issue with

Re: in everywhere

2010-10-08 Thread Andrei Alexandrescu
On 10/8/10 5:24 CDT, Torarin wrote: 2010/10/7 Andrei Alexandrescuseewebsiteforem...@erdani.org: In the end I figured there was only _one_ quadratic operation - appending to a vectorsize_t that held document lengths. That wasn't even the bulk of the data and it was the last thing I looked at!

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Stanislav Blinov
08.10.2010 16:55, Steven Schveighoffer пишет: Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a function: @property int foo(int x) Is this a global setter or a getter on an int? i.e. int y = foo = 3; or int y = (3).foo;

Re: Why all the D hate?

2010-10-08 Thread Gour D.
On Tue, 24 Aug 2010 11:55:43 -0700 Walter == Walter Bright newshou...@digitalmars.com wrote: Walter What we may be seeing here is an effect I noticed decades ago Walter with the Zortech compiler. Let's say you have the Zortech Walter compiler, and BrandX compiler. Heh...I remember Zortech

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Denis Koroskin
On Fri, 08 Oct 2010 17:26:41 +0400, Stanislav Blinov bli...@loniir.ru wrote: 08.10.2010 16:55, Steven Schveighoffer пишет: Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a function: @property int foo(int x) Is this a

Re: What is a tuple and why should one care?

2010-10-08 Thread Lutger
Justin Johansson wrote: There's a lot of (imho, pointless) discussion going on about tuples in D. I've asked before and haven't any illumination, especially of Walter. In the context of D, can someone please enlighten me as to exactly what a tuple is supposed to be. The discussion so

Re: in everywhere

2010-10-08 Thread Juanjo Alvarez
Steven Schveighoffer Wrote: On Thu, 07 Oct 2010 21:18:56 -0400, Juanjo Alvarez f...@fakeemail.com wrote: On Thu, 7 Oct 2010 15:53:13 -0700, Jonathan M Davis jmdavisp...@gmx.com wrote: Except that when you're dealing with generic code which has to deal with multiple container

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Steven Schveighoffer
On Fri, 08 Oct 2010 09:30:59 -0400, Denis Koroskin 2kor...@gmail.com wrote: C# uses 'this' keyword for that purpose: @property int set(this int x, int y) { x = y; } @property int get(this const(int) x) { return x; } int a = 1; a.set(42); // a is 42 now 3.set(42); // fails to

Re: in everywhere

2010-10-08 Thread Simen kjaeraas
Juanjo Alvarez juan...@gmail.com wrote: True! And that's the only drawback I see on generalizing in, but there are many things in programming languages that doesn't feel right when you don't know the language well. That doesn't mean that D should be the programming for dummies on rails

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Andrei Alexandrescu
On 10/8/10 7:55 CDT, Steven Schveighoffer wrote: Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a function: @property int foo(int x) Is this a global setter or a getter on an int? Good question. Andrei

Re: in everywhere

2010-10-08 Thread Lutger
Juanjo Alvarez wrote: Steven Schveighoffer Wrote: On Thu, 07 Oct 2010 21:18:56 -0400, Juanjo Alvarez f...@fakeemail.com wrote: On Thu, 7 Oct 2010 15:53:13 -0700, Jonathan M Davis jmdavisp...@gmx.com wrote: Except that when you're dealing with generic code which has to deal with

Re: CMake for D2 ready for testers

2010-10-08 Thread Gour D.
On Sun, 5 Sep 2010 22:28:41 -0700 SK == SK s...@metrokings.com wrote: SK Why labor over buggy Makefiles when you could be laboring over buggy SK CMake files at a much more productive level of abstraction? :o) Do you recommend to learn use CMake instead of using tools like Xfbuild (I'm

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Stanislav Blinov
08.10.2010 17:46, Steven Schveighoffer пишет: On Fri, 08 Oct 2010 09:30:59 -0400, Denis Koroskin 2kor...@gmail.com wrote: C# uses 'this' keyword for that purpose: @property int set(this int x, int y) { x = y; } @property int get(this const(int) x) { return x; } int a = 1;

Re: in everywhere

2010-10-08 Thread Pelle
On 10/08/2010 01:45 PM, Juanjo Alvarez wrote: Pelle Wrote: On 10/08/2010 03:18 AM, Juanjo Alvarez wrote: On Thu, 7 Oct 2010 15:53:13 -0700, Jonathan M Davis jmdavisp...@gmx.com wrote: Except that when you're dealing with generic code which has to deal with multiple container types (like

Re: CMake for D2 ready for testers

2010-10-08 Thread Russel Winder
On Fri, 2010-10-08 at 16:34 +0200, Gour D. wrote: Do you recommend to learn use CMake instead of using tools like Xfbuild (I'm interested for D project and, so far, was accustomed to Haskell's Cabal, so looking for similar experience.) For C, C++, Fortran, and hence D, I personally find

Re: is D too modern for Emacs?

2010-10-08 Thread Russel Winder
On Wed, 2010-10-06 at 19:39 +0200, Daniel Gibson wrote: http://prowiki.org/wiki4d/wiki.cgi?EditorSupport/EmacsDMode Seems to be a bit more up to date.. there is a patch from august 2009 Grrr (minor rant in next paragraph.) Why is it that programmers can even think that a wiki is a

Re: What is a tuple and why should one care?

2010-10-08 Thread Pelle
On 10/08/2010 02:37 PM, Justin Johansson wrote: There's a lot of (imho, pointless) discussion going on about tuples in D. I've asked before and haven't any illumination, especially of Walter. In the context of D, can someone please enlighten me as to exactly what a tuple is supposed to be.

Re: is D too modern for Emacs?

2010-10-08 Thread Simen kjaeraas
Russel Winder rus...@russel.org.uk wrote: On Wed, 2010-10-06 at 19:39 +0200, Daniel Gibson wrote: http://prowiki.org/wiki4d/wiki.cgi?EditorSupport/EmacsDMode Seems to be a bit more up to date.. there is a patch from august 2009 Grrr (minor rant in next paragraph.) Why is it that

Re: in everywhere

2010-10-08 Thread bearophile
Tomek S. But I got a feeling we're heading for an overkill :) Yes, that's overkill, and it's not a good solution. But sometimes it's useful to discuss even bad solutions to problems, because they may lead to different and more acceptable solutions. During brainstorming you need to lower the

Re: CMake for D2 ready for testers

2010-10-08 Thread Gour D.
On Fri, 08 Oct 2010 17:26:25 +0100 Russel == Russel Winder rus...@russel.org.uk wrote: Russel For C, C++, Fortran, and hence D, I personally find CMake Russel awkward and clumsy. Hmm...based on what I know, CMake is universe for itself...not the most readable syntax etc., but it looks robust,

Re: in everywhere

2010-10-08 Thread Jérôme M. Berger
Steven Schveighoffer wrote: On Thu, 07 Oct 2010 16:23:47 -0400, Rainer Deyke rain...@eldwood.com wrote: On 10/7/2010 13:57, Andrei Alexandrescu wrote: On 10/7/10 14:40 CDT, bearophile wrote: Another solution is just to accept O(n) as the worst complexity for the in operator. I don't

Re: Tuple assignment

2010-10-08 Thread Jérôme M. Berger
Juanjo Alvarez wrote: On Thu, 07 Oct 2010 15:14:12 -0400, bearophile bearophileh...@lycos.com wrote: This is false both in Python2 and Python3. What is exactly false on what I said? python Python 2.6.5 (r265:79063, Apr 1 2010, 05:28:39) [GCC 4.4.3 20100316 (prerelease)] on linux2 Type

Re: in everywhere

2010-10-08 Thread Seth Hoenig
2010/10/8 Jérôme M. Berger jeber...@free.fr Steven Schveighoffer wrote: On Thu, 07 Oct 2010 16:23:47 -0400, Rainer Deyke rain...@eldwood.com wrote: On 10/7/2010 13:57, Andrei Alexandrescu wrote: On 10/7/10 14:40 CDT, bearophile wrote: Another solution is just to accept O(n) as the

Re: CMake for D2 ready for testers

2010-10-08 Thread Jens Mueller
Do you recommend to learn use CMake instead of using tools like Xfbuild (I'm interested for D project and, so far, was accustomed to Haskell's Cabal, so looking for similar experience.) For C, C++, Fortran, and hence D, I personally find CMake awkward and clumsy. I also think CMake

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Nick Sabalausky
Steven Schveighoffer schvei...@yahoo.com wrote in message news:op.vj9cunrweav...@localhost.localdomain... Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a function: @property int foo(int x) Is this a global setter or a

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Jonathan M Davis
On Friday, October 08, 2010 13:56:14 Nick Sabalausky wrote: Steven Schveighoffer schvei...@yahoo.com wrote in message news:op.vj9cunrweav...@localhost.localdomain... Someone was asking about UFC syntax for properties on d.learn, and I realized, we have a huge ambiguity here. Given a

Re: [std.concurrency] prioritySend is 1000 times slower than send?

2010-10-08 Thread Sean Kelly
== Quote from Sean Kelly (s...@invisibleduck.org)'s article Sean Kelly Wrote: osa Wrote: I started using std.concurrency in some projects and overall it feels like a solid (albeit minimalistic) design. However, current implementation has some issues. For example, I've noticed that

Re: [std.concurrency] prioritySend is 1000 times slower than send?

2010-10-08 Thread osa
On 10/08/2010 04:29 PM, Sean Kelly wrote: I just made some functional changes to how priority messages are sent and added a few performance tweaks to messaging in general. The only visible difference should be that PriorityMessageException is no longer a template class but instead contains a

Re: Uniform Function Call syntax for properties

2010-10-08 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.483.1286572389.858.digitalmar...@puremagic.com... On Friday, October 08, 2010 13:56:14 Nick Sabalausky wrote: Additionally, with that understanding in place, this: @property void foo(int x) {...} (3).foo(); Is probably

Re: in everywhere

2010-10-08 Thread Stanislav Blinov
Jonathan M Davis wrote: On Friday 08 October 2010 03:06:01 Stanislav Blinov wrote: [...] What I mean is you'll always have algorithms that will perform differently for different containers, and you'll always have to choose containers that best fit your needs [...] All true. However, the

Re: Tuple literal syntax

2010-10-08 Thread bearophile
Lars T. Kyllingstad: I know, and I agree that *if* it is decided that tuples should be added to the language, it has to happen now. I just don't think it's necessary to do it at all. A better built-in support for tuples is a form of syntax sugar, this means it doesn't give you more power, it

Re: in everywhere

2010-10-08 Thread Lutger
Jérôme M. Berger wrote: Steven Schveighoffer wrote: On Thu, 07 Oct 2010 16:23:47 -0400, Rainer Deyke rain...@eldwood.com wrote: On 10/7/2010 13:57, Andrei Alexandrescu wrote: On 10/7/10 14:40 CDT, bearophile wrote: Another solution is just to accept O(n) as the worst complexity for the

Re: CMake for D2 ready for testers

2010-10-08 Thread Gour D.
On Fri, 8 Oct 2010 21:41:55 +0200 Jens == Jens Mueller jens.k.muel...@gmx.de wrote: Jens I also think CMake isn't that shiny. But you can get the job done Jens once you're familiar with it. And it has been adopted by some big Jens projects: Blender 3D, Boost, clang, KDE, LLVM, MiKTeX, MySQL (see

Go vs D on reddit

2010-10-08 Thread Andrei Alexandrescu
http://www.reddit.com/r/programming/comments/dohif/go_vs_d_interesting_thread_on_the_go_mailing_list/ Andrei

Re: Go vs D on reddit

2010-10-08 Thread bearophile
Andrei Alexandrescu: http://www.reddit.com/r/programming/comments/dohif/go_vs_d_interesting_thread_on_the_go_mailing_list/ Walter has just put the same link in the announce newsgroup. Few quotations and comments from/about that Reddit page: we need a compiler which is good at type inference

Re: Tuple assignment

2010-10-08 Thread Juanjo Alvarez
On Fri, 08 Oct 2010 16:11:53 -0400, bearophile bearophileh...@lycos.com wrote: This syntax you have explained doesn't do what you think it does: a, b, c, _ = ('tuple', 'of', 'three') That was a typo, I meant to write: a, b, _ = ('tuple', 'of', 'three')

Re: Go vs D on reddit

2010-10-08 Thread Walter Bright
bearophile wrote: Following a short trail of links I've found this page, about how C# tests its variable initialization, it's quite cute: http://en.wikipedia.org/wiki/Definite_assignment_analysis D is less smart and more rough here, but to invent and implement this you may need more than one

Re: Tuple assignment

2010-10-08 Thread Leandro Lucarella
Juanjo Alvarez, el 9 de octubre a las 04:02 me escribiste: On Fri, 08 Oct 2010 16:11:53 -0400, bearophile bearophileh...@lycos.com wrote: This syntax you have explained doesn't do what you think it does: a, b, c, _ = ('tuple', 'of', 'three') That was a typo, I meant to write: a, b, _ =

Re: Go vs D on reddit

2010-10-08 Thread Nick Sabalausky
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote in message news:i8ofc0$il...@digitalmars.com... http://www.reddit.com/r/programming/comments/dohif/go_vs_d_interesting_thread_on_the_go_mailing_list/ Andrei Hey, cool, someone (Netcob) over ther quoted me :) I'm a virus!

lvalue method

2010-10-08 Thread Benjamin Thaut
Hi, I'm writing a vec4 math struct and I have a method of which the return value has to be a lvalue so I wonder which is the correct way to do this: vec4 Normalize() const { ... } //won't work, not a lvalue ref vec4 Normalize() const { vec4 temp; ... return temp; } //will this lead to a

Re: Static problem

2010-10-08 Thread Bob Cowdery
On 07/10/2010 21:32, Stanislav Blinov wrote: Steven Schveighoffer wrote: What I'd propose is either: 1) Create your own lock-free associative array (yup, reinvent the wheel to introduce AA to the world of 'shared') 2) In this small case it may seem best (though mind that often such cases

Re: Static problem

2010-10-08 Thread Stanislav Blinov
Bob Cowdery wrote: On 07/10/2010 21:32, Stanislav Blinov wrote: Steven Schveighoffer wrote: What I'd propose is either: 1) Create your own lock-free associative array (yup, reinvent the wheel to introduce AA to the world of 'shared') 2) In this small case it may seem best (though mind that

Re: lvalue method

2010-10-08 Thread Stanislav Blinov
Benjamin Thaut wrote: Hi, I'm writing a vec4 math struct and I have a method of which the return value has to be a lvalue so I wonder which is the correct way to do this: vec4 Normalize() const { ... } //won't work, not a lvalue ref vec4 Normalize() const { vec4 temp; ... return temp;

Re: lvalue method

2010-10-08 Thread Simen kjaeraas
Benjamin Thaut c...@benjamin-thaut.de wrote: Hi, I'm writing a vec4 math struct and I have a method of which the return value has to be a lvalue so I wonder which is the correct way to do this: vec4 Normalize() const { ... } //won't work, not a lvalue ref vec4 Normalize() const { vec4

Re: lvalue method

2010-10-08 Thread Lars T. Kyllingstad
On Fri, 08 Oct 2010 09:33:22 +0200, Benjamin Thaut wrote: Hi, I'm writing a vec4 math struct and I have a method of which the return value has to be a lvalue so I wonder which is the correct way to do this: vec4 Normalize() const { ... } //won't work, not a lvalue ref vec4 Normalize()

question about property for built-in type

2010-10-08 Thread %u
Hi, I'm learning D right now and got a question about property. I tried to add a property for built-in type like the following @property bool equalZero(double a) { return a == 0.0; } void main() { ... double x = 4.4; bool isXZero = x.equalZero; ... } but got an error message main.d(75):

Re: question about property for built-in type

2010-10-08 Thread Denis Koroskin
On Fri, 08 Oct 2010 16:19:43 +0400, %u djvsr...@gmail.com wrote: Hi, I'm learning D right now and got a question about property. I tried to add a property for built-in type like the following @property bool equalZero(double a) { return a == 0.0; } void main() { ... double x = 4.4; bool

Re: question about property for built-in type

2010-10-08 Thread Stanislav Blinov
08.10.2010 16:19, %u wrote: Hi, I'm learning D right now and got a question about property. I tried to add a property for built-in type like the following @property bool equalZero(double a) { return a == 0.0; } void main() { ... double x = 4.4; bool isXZero = x.equalZero; ... }

Re: lvalue method

2010-10-08 Thread Steven Schveighoffer
On Fri, 08 Oct 2010 09:26:19 -0400, Benjamin Thaut c...@benjamin-thaut.de wrote: Am 08.10.2010 11:13, schrieb Lars T. Kyllingstad: On Fri, 08 Oct 2010 09:33:22 +0200, Benjamin Thaut wrote: Hi, I'm writing a vec4 math struct and I have a method of which the return value has to be a lvalue

Re: lvalue method

2010-10-08 Thread Simen kjaeraas
Steven Schveighoffer schvei...@yahoo.com wrote: The correct way is to use auto ref as the parameter: struct vec4 { ... vec4 Normalize(auto ref const(vec4) param) {...} } But AFAIK, this doesn't really work. It doesn't, no. I'm not even sure it's scheduled for inclusion. Also, with

Re: lvalue method

2010-10-08 Thread Steven Schveighoffer
On Fri, 08 Oct 2010 09:51:59 -0400, Simen kjaeraas simen.kja...@gmail.com wrote: Steven Schveighoffer schvei...@yahoo.com wrote: The correct way is to use auto ref as the parameter: struct vec4 { ... vec4 Normalize(auto ref const(vec4) param) {...} } But AFAIK, this doesn't really

[D1][expressions] Order Of Evaluation

2010-10-08 Thread %u
/The following binary expressions are evaluated in an implementation-defined order: AssignExpression/../AddExpression/ /It is an error to depend on order of evaluation when it is not specified./ That makes this an error!? y = x + 1; Am I being paranoid or should I be adding more brackets?

Re: Destruction Sequence: module and classes defined within

2010-10-08 Thread Lutger
Lars T. Kyllingstad wrote: On Tue, 05 Oct 2010 23:25:36 +0200, vano wrote: The code below: module used; import std.stdio; class ClassA { this() { writeln(A ctor); } ~this() { writeln(A dtor); } } static this() { writeln(used.sctor); }

Re: [D1][expressions] Order Of Evaluation

2010-10-08 Thread bearophile
%u: That makes this an error!? y = x + 1; Am I being paranoid or should I be adding more brackets? I presume this doesn't need other brackets. And Walter has two or three times stated that he wants to eventually define the order of evaluation in D (as C#/Java), I hope this will happen.

Re: [D1][expressions] Order Of Evaluation

2010-10-08 Thread Denis Koroskin
On Fri, 08 Oct 2010 18:49:36 +0400, %u e...@ee.com wrote: /The following binary expressions are evaluated in an implementation-defined order: AssignExpression/../AddExpression/ /It is an error to depend on order of evaluation when it is not specified./ That makes this an error!? y = x +

Re: [D1][expressions] Order Of Evaluation

2010-10-08 Thread %u
== Quote from Denis Koroskin (2kor...@gmail.com)'s article On Fri, 08 Oct 2010 18:49:36 +0400, %u e...@ee.com wrote: /The following binary expressions are evaluated in an implementation-defined order: AssignExpression/../AddExpression/ /It is an error to depend on order of evaluation

std.regex character consumption

2010-10-08 Thread petevik38
I've been running into a few problems with regular expressions in D. One of the issues I've had recently is matching strings with non ascii characters. As an example: auto re = regex( `(.*)\.txt`, i ); re.printProgram(); auto m = match( bà.txt, re ); writefln( '%s', m.captures[1]

ditto in DDoc

2010-10-08 Thread Tomek Sowiński
More of an English question... dunno - don't know ditto - ? -- Tomek

Re: std.regex character consumption

2010-10-08 Thread Jonathan M Davis
On Friday, October 08, 2010 14:13:36 petevi...@yahoo.com.au wrote: I've been running into a few problems with regular expressions in D. One of the issues I've had recently is matching strings with non ascii characters. As an example: auto re = regex( `(.*)\.txt`, i );

Re: ditto in DDoc

2010-10-08 Thread Yao G.
On Fri, 08 Oct 2010 16:22:33 -0500, Tomek Sowiński j...@ask.me wrote: More of an English question... dunno - don't know ditto - ? http://en.wiktionary.org/wiki/ditto ditto (plural dittos) 1. That which was stated before, the aforesaid, the above, the same. 2. (informal) A duplicate or copy

Re: ditto in DDoc

2010-10-08 Thread Jonathan M Davis
On Friday, October 08, 2010 14:22:33 Tomek Sowiński wrote: More of an English question... dunno - don't know ditto - ? It's a word in and of itself, not the shortening or butchering of another word. According to merriam-webster.com ( http://www.merriam- webster.com/dictionary/ditto ), it

Re: ditto in DDoc

2010-10-08 Thread bearophile
Jonathan M Davis: It's the past participle of the Italian word dire (to say) It was, a long time ago. Today it's detto. Bye, bearophile

Re: ditto in DDoc

2010-10-08 Thread Denis Koroskin
On Sat, 09 Oct 2010 01:22:33 +0400, Tomek Sowiński j...@ask.me wrote: More of an English question... dunno - don't know ditto - ? Ditto is used to indicate that something already said is applicable a second time. In documentation, ditto means that previous comment also applies here. Here

Re: ditto in DDoc

2010-10-08 Thread Jonathan M Davis
On Friday, October 08, 2010 15:17:13 bearophile wrote: Jonathan M Davis: It's the past participle of the Italian word dire (to say) It was, a long time ago. Today it's detto. Bye, bearophile Good to know. I was just going by what Merriam Webster had to say on that one. I know French

A question about DbC

2010-10-08 Thread bearophile
This is a simple D2 class that uses Contracts: import std.c.stdio: printf; class Car { int speed = 0; invariant() { printf(Car invariant: %d\n, speed); assert(speed = 0); } this() { printf(Car constructor: %d\n, speed); speed = 0; }

Re: A question about DbC

2010-10-08 Thread Jonathan M Davis
On Friday 08 October 2010 20:16:10 bearophile wrote: This is a simple D2 class that uses Contracts: import std.c.stdio: printf; class Car { int speed = 0; invariant() { printf(Car invariant: %d\n, speed); assert(speed = 0); } this() {

[Issue 5016] New: to!() can not convert from wide characters to char

2010-10-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5016 Summary: to!() can not convert from wide characters to char Product: D Version: D2 Platform: Other OS/Version: All Status: NEW Severity: major Priority: P2

[Issue 3613] enforce cannot be called with template parameters and compile.

2010-10-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3613 Shin Fujishiro rsi...@gmail.com changed: What|Removed |Added Keywords||rejects-valid

[Issue 4634] typo in levenshteinDistanceAndPath documentation

2010-10-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4634 Shin Fujishiro rsi...@gmail.com changed: What|Removed |Added Status|NEW |ASSIGNED

[Issue 4773] [PATCH] Rebindable should be castable to bool

2010-10-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4773 Shin Fujishiro rsi...@gmail.com changed: What|Removed |Added Status|NEW |ASSIGNED

[Issue 5017] New: Access Violation when calling a template function of outer class (from inner one)

2010-10-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5017 Summary: Access Violation when calling a template function of outer class (from inner one) Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW

[Issue 5018] New: segfault / stack overflow when calling overriden Stream.writeBlock

2010-10-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5018 Summary: segfault / stack overflow when calling overriden Stream.writeBlock Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity:

assertion failure '!vthis-csym' on line 698 in file 'glue.c'

2010-10-08 Thread Benjamin Thaut
Hi, when I compile the current state of my project, I get the following assertion failure: '!vthis-csym' on line 698 in file 'glue.c' I tried to reproduce this in a smaller scale, but it only appears in this very special case. The project currently contains 72 source files and it only

[Issue 5019] New: In std.regex, empty capture at end of string causes error

2010-10-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5019 Summary: In std.regex, empty capture at end of string causes error Product: D Version: D2 Platform: x86_64 OS/Version: Windows Status: NEW Severity:

[Issue 5020] New: Forward implicit bool conversions to alias this

2010-10-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5020 Summary: Forward implicit bool conversions to alias this Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal

  1   2   >