Re: DSFML2

2010-03-04 Thread Joel Christensen
Trass3r wrote: Btw, xfBuild is better. I've been trying xfBuild and have now found that I can't write to the command prompt, and there doesn't seem to be any flag to activate to do it. It seems faster though.

Re: DSFML2

2010-03-04 Thread Trass3r
I've been trying xfBuild and have now found that I can't write to the command prompt, and there doesn't seem to be any flag to activate to do it. Don't understand what you mean.

Re: DSFML2

2010-03-04 Thread Denis Koroskin
On Thu, 04 Mar 2010 15:48:19 +0300, Trass3r u...@known.com wrote: I've been trying xfBuild and have now found that I can't write to the command prompt, and there doesn't seem to be any flag to activate to do it. Don't understand what you mean. Maybe he is looking for a way to pass some

Re: DSFML2

2010-03-04 Thread Trass3r
Maybe he is looking for a way to pass some custom arguments to DMD and couldn't find a way to do so via xfBuild? compiler arguments are passed just as normal.

Stack tracing assert for linux/D2

2010-03-04 Thread BCS
I just created a module that generates stack traces on asserts (D2): http://www.dsource.org/projects/scrapple/browser/trunk/backtrace_assert/debugging.d Just compile and link it. It does have some not exactly ideal bits: -it won't work nicely unless you link with gcc and add the -rdynamic

Feature suggestion: in-place append to array

2010-03-04 Thread KF
I hope this is the right place to post it. In my work, I often need to add elements at the end of dynamic arrays and remove them from the end. This incremental changes would most conveniently be performed by a~=e for addition of e at the end of a, and say a=a[0..$-1]. Unfortunately, ~= always

Re: Good Contract programming idiom?

2010-03-04 Thread Norbert Nemec
Brad Roberts wrote: On Wed, 3 Mar 2010, Norbert Nemec wrote: The edited Wikipedia text for D is so far correct, even though the whole page is not quite as precise as it could be. The theoretical basis and the practical application are somewhat mixed. Fixing that, however, would be a major

Re: 64-bit and SSE

2010-03-04 Thread #ponce
Is SSE(2) inherently faster then (at least in real-world implementations) than x87, even when you don't vectorize? Would I be able to expect any speedup from going from x87 to SSE(2) for code that has a decent amount of implicit instruction level parallelism but wasn't explicitly

Misleading contract syntax

2010-03-04 Thread Norbert Nemec
Hi there, following the recent thread on contracts, I come to the conclusion that the current syntax is misleading and counterproductive. * The concept of a contract is an expression, not a statement. * A contract should *never* have side effects, otherwise debugging code may behave

Re: One minute to twelve: last chance to fix D2 ABI?

2010-03-04 Thread Lionello Lunesu
On 3-3-2010 23:51, Robert Jacques wrote: At the cost of forcing every single member function call to do an additional stack push? DMD doesn't pass args in ECX and EDX for a reason. Adapting free functions to delegates is a rare enough operation that making everything else slower to save one

Re: Good Contract programming idiom?

2010-03-04 Thread Norbert Nemec
That sounds pretty much like putting your application authors under tutelage (great word - just found it in the dictionary... :-) ) Writing a library that other can use, you should always assume that they are mature and responsible beings. The contracts explicitly tell the application author

Re: Good Contract programming idiom?

2010-03-04 Thread Steven Schveighoffer
On Wed, 03 Mar 2010 18:58:54 -0500, Lionello Lunesu l...@lunesu.remove.com wrote: You make a good point, but there's one problem I have with this. I'm looking at this as a library writer. I can write in-contracts with assertions, but I would not feel comfortable with only assertions, since I

Re: Feature suggestion: in-place append to array

2010-03-04 Thread Steven Schveighoffer
On Thu, 04 Mar 2010 04:02:46 -0500, KF kfles...@gmail.com wrote: I hope this is the right place to post it. In my work, I often need to add elements at the end of dynamic arrays and remove them from the end. This incremental changes would most conveniently be performed by a~=e for addition of

Re: Misleading contract syntax

2010-03-04 Thread bearophile
Norbert Nemec: No! No! No! Design-by-contract means that it is the application's duty to make sure that argument values are correct. If the program is correct, the library can trust that the argument values are correct and does not need to do checks. This is exactly the same situation that

Arguments and attributes with the same name

2010-03-04 Thread bearophile
This is correct D code, but I think it's a bad practice to write code like this, where method arguments have the same name as instance/static attributes of the class/struct. class Foo { int x; this(int x) { this.x = x; } void inc(int x) { this.x += x; } } struct Bar { static int

Is D a useful programming language for the web?

2010-03-04 Thread Justin Johansson
I throw this subject up for the D community's consideration. Admittedly the subject is quite broad in scope. However, in response to some of my posts of time ago, people on this NG have said things along lines of D is a Systems Programming Language so we want none of that, or words to that

Re: Misleading contract syntax

2010-03-04 Thread Ary Borenszweig
Norbert Nemec wrote: Hi there, following the recent thread on contracts, I come to the conclusion that the current syntax is misleading and counterproductive. * The concept of a contract is an expression, not a statement. * A contract should *never* have side effects, otherwise debugging

Re: Arguments and attributes with the same name

2010-03-04 Thread Ary Borenszweig
bearophile wrote: This is correct D code, but I think it's a bad practice to write code like this, where method arguments have the same name as instance/static attributes of the class/struct. class Foo { int x; this(int x) { this.x = x; } void inc(int x) { this.x += x; } } struct

Re: Arguments and attributes with the same name

2010-03-04 Thread Bane
This can be solved if the compiler warns when an assignment is from a variable to the same one. x = x; // error: assignment has no effect Nice and useful.

Re: Is D a useful programming language for the web?

2010-03-04 Thread Adam D. Ruppe
Yes, though it needs a little more work on the library side to be simple to use for it. Web programming is still programming, a field in which D excels. I don't really know what else to say, but I know having D's type system is something I long for whenever using other web languages. -- Adam

Re: Arguments and attributes with the same name

2010-03-04 Thread bearophile
Ary Borenszweig: This can be solved if the compiler warns when an assignment is from a variable to the same one. x = x; // error: assignment has no effect That's nice in general to have, but I think it's not enough, because if I want to assign to an attribute an incremented value: x =

Re: One minute to twelve: last chance to fix D2 ABI?

2010-03-04 Thread Robert Jacques
On Thu, 04 Mar 2010 05:00:46 -0500, Lionello Lunesu l...@lunesu.remove.com wrote: On 3-3-2010 23:51, Robert Jacques wrote: At the cost of forcing every single member function call to do an additional stack push? DMD doesn't pass args in ECX and EDX for a reason. Adapting free functions to

Re: Is D a useful programming language for the web?

2010-03-04 Thread Pelle Månsson
On 03/04/2010 02:04 PM, Justin Johansson wrote: I throw this subject up for the D community's consideration. Admittedly the subject is quite broad in scope. However, in response to some of my posts of time ago, people on this NG have said things along lines of D is a Systems Programming

Re: Is D a useful programming language for the web?

2010-03-04 Thread GiM
So I'll play devil's advocate for a while and see what transpires. I'm not sure if it's useful but I've managed to write simple web-server (I used tango since I'm used to it) that served simple minesweeper application :) async request were made using jquery, some request were responsed with

Re: Arguments and attributes with the same name

2010-03-04 Thread Ary Borenszweig
bearophile wrote: Ary Borenszweig: This can be solved if the compiler warns when an assignment is from a variable to the same one. x = x; // error: assignment has no effect That's nice in general to have, but I think it's not enough, because if I want to assign to an attribute an

Re: Arguments and attributes with the same name

2010-03-04 Thread Pelle Månsson
On 03/04/2010 02:44 PM, Bane wrote: This can be solved if the compiler warns when an assignment is from a variable to the same one. x = x; // error: assignment has no effect Nice and useful. struct A { int i; void opAssign(A a) { i = a.i + 1; } } why not?

Re: Misleading contract syntax

2010-03-04 Thread Pelle Månsson
On 03/04/2010 02:24 PM, Ary Borenszweig wrote: Norbert Nemec wrote: Hi there, following the recent thread on contracts, I come to the conclusion that the current syntax is misleading and counterproductive. * The concept of a contract is an expression, not a statement. * A contract should

Re: Arguments and attributes with the same name

2010-03-04 Thread Ary Borenszweig
bearophile wrote: Ary Borenszweig: This can be solved if the compiler warns when an assignment is from a variable to the same one. x = x; // error: assignment has no effect That's nice in general to have, but I think it's not enough, because if I want to assign to an attribute an

Re: Misleading contract syntax

2010-03-04 Thread Ary Borenszweig
Pelle Månsson wrote: On 03/04/2010 02:24 PM, Ary Borenszweig wrote: Norbert Nemec wrote: Hi there, following the recent thread on contracts, I come to the conclusion that the current syntax is misleading and counterproductive. * The concept of a contract is an expression, not a statement. *

Re: Arguments and attributes with the same name

2010-03-04 Thread bearophile
Ary Borenszweig: How is python safer than D in that sense? This is correct D code: class Foo { int x; this() { x = 5; } } void main() {} In Python self. is always needed to refer to the attribute, and x refers to the argument (or a global name, but then you need a global statement).

Re: Arguments and attributes with the same name

2010-03-04 Thread Ary Borenszweig
bearophile wrote: Ary Borenszweig: How is python safer than D in that sense? This is correct D code: class Foo { int x; this() { x = 5; } } void main() {} In Python self. is always needed to refer to the attribute, and x refers to the argument (or a global name, but then you need a

Re: Arguments and attributes with the same name

2010-03-04 Thread bearophile
Ary Borenszweig: So you suggest to forbid having an argument name that matches an attribute name? Or require this. for attribute access? I prefer the compiler to give an error when an argument has the same name of an attribute, it's tidier. If you think that solution is too much restricting,

Re: Arguments and attributes with the same name

2010-03-04 Thread Ary Borenszweig
bearophile wrote: Ary Borenszweig: So you suggest to forbid having an argument name that matches an attribute name? Or require this. for attribute access? I prefer the compiler to give an error when an argument has the same name of an attribute, it's tidier. But python doesn't do it

Re: Arguments and attributes with the same name

2010-03-04 Thread bearophile
Ary Borenszweig: But python doesn't do it either. Did you suggest the same thing to the python devs? :-) :-) Well, when I teach Python I give the advice of not using the same names for arguments and attributes. So it's a programming practice. Here the situation in D is worse, because in

Re: Arguments and attributes with the same name

2010-03-04 Thread Steven Schveighoffer
On Thu, 04 Mar 2010 11:06:15 -0500, bearophile bearophileh...@lycos.com wrote: Ary Borenszweig: But python doesn't do it either. Did you suggest the same thing to the python devs? :-) :-) Well, when I teach Python I give the advice of not using the same names for arguments and

Re: Feature suggestion: in-place append to array

2010-03-04 Thread grauzone
Steven Schveighoffer wrote: On Thu, 04 Mar 2010 04:02:46 -0500, KF kfles...@gmail.com wrote: I hope this is the right place to post it. In my work, I often need to add elements at the end of dynamic arrays and remove them from the end. This incremental changes would most conveniently be

Re: Arguments and attributes with the same name

2010-03-04 Thread bearophile
Steven Schveighoffer: I think the point is, the statement x = x + 1; isn't any more or less ambiguous in D than it is in python. There is a well-defined meaning (and in fact the same meaning). It's not the same meaning, this program prints 1: import std.c.stdio: printf; class Foo {

Re: Misleading contract syntax

2010-03-04 Thread Norbert Nemec
I think, this should be broken down into different issues: * Is real-life code ever stable enough to take deactivate assertion checks? I think that there is no simple yes/no question. The best solution would probably be to allow selectively deactivating assertions. It may indeed be advisable

Re: Arguments and attributes with the same name

2010-03-04 Thread Clemens
bearophile Wrote: Ary Borenszweig: So you suggest to forbid having an argument name that matches an attribute name? Or require this. for attribute access? I prefer the compiler to give an error when an argument has the same name of an attribute, it's tidier. I'd rather not have that,

Re: Feature suggestion: in-place append to array

2010-03-04 Thread Steven Schveighoffer
On Thu, 04 Mar 2010 11:43:27 -0500, grauzone n...@example.net wrote: Some sort of resetAndReuse function to clear an array, but enabling to reuse the old memory would be nice: int[] a = data; a = null; a ~= 1; //reallocates (of course) a.length = 0; a ~= 1; //will reallocate (for safety),

Re: Feature suggestion: in-place append to array

2010-03-04 Thread grauzone
Steven Schveighoffer wrote: On Thu, 04 Mar 2010 11:43:27 -0500, grauzone n...@example.net wrote: Some sort of resetAndReuse function to clear an array, but enabling to reuse the old memory would be nice: int[] a = data; a = null; a ~= 1; //reallocates (of course) a.length = 0; a ~= 1; //will

Re: Misleading contract syntax

2010-03-04 Thread Norbert Nemec
Ary Borenszweig wrote: Pelle Månsson wrote: On 03/04/2010 02:24 PM, Ary Borenszweig wrote: Norbert Nemec wrote: Hi there, following the recent thread on contracts, I come to the conclusion that the current syntax is misleading and counterproductive. * The concept of a contract is an

Re: Is D a useful programming language for the web?

2010-03-04 Thread Nick Sabalausky
Justin Johansson n...@spam.com wrote in message news:hmob4s$pa...@digitalmars.com... I throw this subject up for the D community's consideration. Admittedly the subject is quite broad in scope. However, in response to some of my posts of time ago, people on this NG have said things along

Re: Feature suggestion: in-place append to array

2010-03-04 Thread Steven Schveighoffer
On Thu, 04 Mar 2010 12:29:25 -0500, Clemens eriatark...@gmail.com wrote: Steven Schveighoffer Wrote: int[] a; a.setCapacity(1); // pre-allocate at least 1 elements. I would prefer the name reserve(). It has precedent in the STL, and the method doesn't actually always set the

Re: Feature suggestion: in-place append to array

2010-03-04 Thread Steven Schveighoffer
On Thu, 04 Mar 2010 12:43:32 -0500, grauzone n...@example.net wrote: Steven Schveighoffer wrote: On Thu, 04 Mar 2010 11:43:27 -0500, grauzone n...@example.net wrote: Some sort of resetAndReuse function to clear an array, but enabling to reuse the old memory would be nice: int[] a = data;

Re: Misleading contract syntax

2010-03-04 Thread Norbert Nemec
bearophile wrote: Complex enough different parts of the same program need user interfaces for each other, where the user is the programmer or another part of the program written by the programmer or another programmer. So libraries need to test all their inputs well anyway. I have programmed

Re: Feature suggestion: in-place append to array

2010-03-04 Thread grauzone
Steven Schveighoffer wrote: On Thu, 04 Mar 2010 12:43:32 -0500, grauzone n...@example.net wrote: Steven Schveighoffer wrote: On Thu, 04 Mar 2010 11:43:27 -0500, grauzone n...@example.net wrote: Some sort of resetAndReuse function to clear an array, but enabling to reuse the old memory would

Re: Is D a useful programming language for the web?

2010-03-04 Thread Steve Teale
I was working on a web application framework kind of like Tomcat (using AJP), but different. At one point I thought it was going quite well. I foundered on the inability to dynamically load things, which was an essential. I tried messing with DDL, but that seemed to be a dead end. Shared

An example of Clang error messages

2010-03-04 Thread bearophile
Found in Reddit: http://zi.fi/shots/clang.png It shows that there's some space for improvements in the error messages given by future D compilers (like a LDC-like compiler for D2 based on LLVM) too. Bye, bearophile

speed.pypy.org

2010-03-04 Thread bearophile
This site collects and shows graphs of performance of Python interpreters: http://morepypy.blogspot.com/2010/03/introducing-speedpypyorg.html They say: if other performance-oriented opensource projects are interested, I would be willing to see if we can set-up such a Speed Center for them. If

Re: Feature suggestion: in-place append to array

2010-03-04 Thread Steven Schveighoffer
On Thu, 04 Mar 2010 13:38:30 -0500, grauzone n...@example.net wrote: Steven Schveighoffer wrote: So it probably should be marked as unsafe. Doesn't it conform to Andrei's ideas about memory safety? It can stomp over other data, but it can't be used to subvert the type system. I think

Line number of Exception instantiation

2010-03-04 Thread bearophile
What do you think of the idea of the Exception to remember (so later it can be shown if uncaught) the line number and file name where it was instantiated? void foo() { auto e = new Exception(); // instantiation line number here throw e; } void main() { foo(); } Exceptions get

Re: An example of Clang error messages

2010-03-04 Thread Adam D. Ruppe
On Thu, Mar 04, 2010 at 01:50:10PM -0500, bearophile wrote: It shows that there's some space for improvements in the error messages given by future D compilers (like a LDC-like compiler for D2 based on LLVM) too. You should try Digital Mars C. Its error messages are similar to that, though I

Re: Misleading contract syntax

2010-03-04 Thread Michel Fortin
On 2010-03-04 13:19:25 -0500, Norbert Nemec norb...@nemec-online.de said: Exactly my point: contracts are not assertions. Still, contracts are not exceptions either. A broken contract is a BUG. A triggered exception is a run-time condition that can happen in a perfectly correct program. I

Re: An example of Clang error messages

2010-03-04 Thread bearophile
Walter Bright: Note that clang is a C compiler, not a C++ one. There's also Clang++ that has few days ago compiled itself for the first time :-) Bye, bearophile

Re: An example of Clang error messages

2010-03-04 Thread bearophile
Walter Bright: The spell checker idea is a good one. I have seen it used for the first time in Mathematica, even very old versions of it. It's handy. In Python I have written something similar that works at runtime. Bye, bearophile

Re: Line number of Exception instantiation

2010-03-04 Thread Nick Sabalausky
bearophile bearophileh...@lycos.com wrote in message news:hmovte$243...@digitalmars.com... What do you think of the idea of the Exception to remember (so later it can be shown if uncaught) the line number and file name where it was instantiated? void foo() { auto e = new Exception();

Re: speed.pypy.org

2010-03-04 Thread BCS
Hello bearophile, If they accept D compilers too, then it can be used to keep an eye on them, for example to spot regressions in performance, binary file produced, etc. sounds interesting, as long as it didn't become a distraction and an end unto it's self. -- ... IXOYE

Re: Line number of Exception instantiation

2010-03-04 Thread BCS
Hello bearophile, What do you think of the idea of the Exception to remember (so later it can be shown if uncaught) the line number and file name where it was instantiated? It shouldn't be hard, add default parameters to the constructor: this(string msg, string file = __FILE__, int line =

Re: Arguments and attributes with the same name

2010-03-04 Thread Jonathan M Davis
Clemens wrote: bearophile Wrote: Ary Borenszweig: So you suggest to forbid having an argument name that matches an attribute name? Or require this. for attribute access? I prefer the compiler to give an error when an argument has the same name of an attribute, it's tidier. I'd

Re: Line number of Exception instantiation

2010-03-04 Thread Fawzi Mohamed
On 2010-03-04 21:29:15 +0100, Nick Sabalausky a...@a.a said: bearophile bearophileh...@lycos.com wrote in message news:hmovte$243...@digitalmars.com... What do you think of the idea of the Exception to remember (so later it can be shown if uncaught) the line number and file name where it was

Re: Line number of Exception instantiation

2010-03-04 Thread Fawzi Mohamed
On 2010-03-04 21:38:09 +0100, BCS n...@anon.com said: Hello bearophile, What do you think of the idea of the Exception to remember (so later it can be shown if uncaught) the line number and file name where it was instantiated? It shouldn't be hard, add default parameters to the

Re: An example of Clang error messages

2010-03-04 Thread Walter Bright
bearophile wrote: Walter Bright: Note that clang is a C compiler, not a C++ one. There's also Clang++ that has few days ago compiled itself for the first time :-) Yeah, I wrote a C++ compiler back in 1987. It compiled itself, too! The hard work of implementing C++ correctly was just

Re: An example of Clang error messages

2010-03-04 Thread bearophile
Walter Bright: Yeah, I wrote a C++ compiler back in 1987. It compiled itself, too! The hard work of implementing C++ correctly was just beginning, though. C'mon Walter, give them some credit, wish them some luck, I think they will be able to compile a good percentage of Boost in less than 15

Re: An example of Clang error messages

2010-03-04 Thread Walter Bright
bearophile wrote: Walter Bright: Yeah, I wrote a C++ compiler back in 1987. It compiled itself, too! The hard work of implementing C++ correctly was just beginning, though. C'mon Walter, give them some credit, wish them some luck, I think they will be able to compile a good percentage of

Re: Arguments and attributes with the same name

2010-03-04 Thread bearophile
Clemens: As soon as you have an instance variable x and a function parameter x, there will *always* be ambiguity (unless you don't use the parameter). Requiring the use of this. amounts to disallowing access to the parameter x. Thank you for spotting my stupid idea :o) I will update the

Re: An example of Clang error messages

2010-03-04 Thread grauzone
Walter Bright wrote: bearophile wrote: Walter Bright: Yeah, I wrote a C++ compiler back in 1987. It compiled itself, too! The hard work of implementing C++ correctly was just beginning, though. C'mon Walter, give them some credit, wish them some luck, I think they will be able to compile a

Pantheios 1.0.1 (beta 193) released

2010-03-04 Thread Matt Wilson
Pantheios is an open source C/C++ Logging API library, offering an optimal combination of 100% type-safety, efficiency, genericity and extensibility. It is simple to use and extend, highly-portable (platform and compiler-independent) and, best of all, it upholds the C tradition of you only pay

Re: Pantheios 1.0.1 (beta 193) released

2010-03-04 Thread Gide Nwawudu
On Thu, 04 Mar 2010 17:37:55 -0500, Matt Wilson matthewwil...@acm.org wrote: Pantheios is an open source C/C++ Logging API library, offering an optimal combination of 100% type-safety, efficiency, genericity and extensibility. It is simple to use and extend, highly-portable (platform and

Container hierarchy vs. container types

2010-03-04 Thread Andrei Alexandrescu
Hi everyone, I'm on a trip to Romania visiting relatives. Being disconnected for a while, I thought some about container types and started writing some code. It didn't take long to figure that a classic class hierarchy with inheritance etc. would contain prohibitively many types (with

Re: Container hierarchy vs. container types

2010-03-04 Thread bearophile
Andrei Alexandrescu: As far as I can tell such changes of containers are a design-time decision, and extremely rarely (never as far as I remember) a runtime decision to hide behind a binary interface. In your post there's lot of stuff to think about. I can see you are trying to innovate, so

Re: Pantheios 1.0.1 (beta 193) released

2010-03-04 Thread Nick Sabalausky
Matt Wilson matthewwil...@acm.org wrote in message news:hmpco3$2ql...@digitalmars.com... Pantheios is an open source C/C++ Logging API library, offering an optimal combination of 100% type- Announcements belong in digitalmars.D.announce. Also, this is a D newsgroup. Does Pantheios have some

Re: Container hierarchy vs. container types

2010-03-04 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: As far as I can tell such changes of containers are a design-time decision, and extremely rarely (never as far as I remember) a runtime decision to hide behind a binary interface. In your post there's lot of stuff to think about. I can see you are

Re: An example of Clang error messages

2010-03-04 Thread Walter Bright
grauzone wrote: How many man years would you assume writing a full D compiler takes? (Frontend starting from scratch, using an existing backend.) I don't know. Somewhere in between. Remember that EDG reported that it took them 3 man-years just to implement one C++ feature - exported

Re: Line number of Exception instantiation

2010-03-04 Thread Robert Jacques
On Thu, 04 Mar 2010 13:58:54 -0500, bearophile bearophileh...@lycos.com wrote: What do you think of the idea of the Exception to remember (so later it can be shown if uncaught) the line number and file name where it was instantiated? void foo() { auto e = new Exception(); //

Re: Container hierarchy vs. container types

2010-03-04 Thread Robert Jacques
On Thu, 04 Mar 2010 18:22:55 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: [snip] I like this idea. I've gotten used to using template constraints and ranges when coding which matches this strategy naturally. A lot of the capabilities seem to match ranges, but why did you

Re: Container hierarchy vs. container types

2010-03-04 Thread Sandwich
/*Me ends lurking*/ As far as allocators go, you may want to take a look at how eastl handles them: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html#eastl_allocator /*Resumes Lurking*/ Andrei Alexandrescu Wrote: bearophile wrote: Andrei Alexandrescu: As far as I can

Re: Line number of Exception instantiation

2010-03-04 Thread Ellery Newcomer
On 03/04/2010 02:49 PM, Fawzi Mohamed wrote: Bye, bearophile Doesn't tango's exception tracing do that? sure it does, just import TraceExceptions... The exception will contain the stacktrace at the throwing point (adresses)... and with printOut you can get a symbolic trace (if possible).

Re: An example of Clang error messages

2010-03-04 Thread bearophile
Walter Bright: But there's little reason to implement a D compiler from scratch. I'm ignorant about this topic, but I think there are various ways to create a new D front-end: - Copy the C++ code of DMD and create a small middle-end to adapt it to something else, LDC and GDC have done this.

Re: An example of Clang error messages

2010-03-04 Thread Jerry Quinn
Walter Bright Wrote: grauzone wrote: How many man years would you assume writing a full D compiler takes? (Frontend starting from scratch, using an existing backend.) But there's little reason to implement a D compiler from scratch. For open source uses, you can just go ahead and use

Re: Container hierarchy vs. container types

2010-03-04 Thread Jerry Quinn
Andrei Alexandrescu Wrote: I decided to let no assumption unchallenged and got back to the question: do we really need a container _hierarchy_? How much joy and usefulness do people derive from dynamically changing an array with a list under the same interface? Or a rb-tree vs. a binary

Re: Container hierarchy vs. container types

2010-03-04 Thread Jonathan M Davis
I'd definitely go with the unconnected class solution. Sometimes it's useful to be able to have a class hierarchy where you don't have to care whether about things like whether a Map is a HashMap or a SortedMap, but it frequently comes back to bite you - especially when they require that

Re: Container hierarchy vs. container types

2010-03-04 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article Hi everyone, I'm on a trip to Romania visiting relatives. Being disconnected for a while, I thought some about container types and started writing some code. It didn't take long to figure that a classic class hierarchy

Re: Container hierarchy vs. container types

2010-03-04 Thread Walter Bright
Andrei Alexandrescu wrote: Apologies for the dense message. I wanted to concentrate as much info in as little time/space as possible. Actually, thank you for making a concentrated message.

Re: Container hierarchy vs. container types

2010-03-04 Thread Walter Bright
Andrei Alexandrescu wrote: I decided to let no assumption unchallenged and got back to the question: do we really need a container _hierarchy_? How much joy and usefulness do people derive from dynamically changing an array with a list under the same interface? Or a rb-tree vs. a binary tree

Re: Container hierarchy vs. container types

2010-03-04 Thread Andrei Alexandrescu
Robert Jacques wrote: On Thu, 04 Mar 2010 18:22:55 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: [snip] I like this idea. I've gotten used to using template constraints and ranges when coding which matches this strategy naturally. A lot of the capabilities seem to match

Re: Container hierarchy vs. container types

2010-03-04 Thread Andrei Alexandrescu
Sandwich wrote: /*Me ends lurking*/ As far as allocators go, you may want to take a look at how eastl handles them: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html#eastl_allocator /*Resumes Lurking*/ Thanks. Wonder how many other knowledgeable lurkers are out there :o).

D2: std.algorithm.find, but get part before what you were searching for

2010-03-04 Thread Jonathan M Davis
std.algorithm.find() returns the rest of the range starting at what you were searching for (or an empty range if it wasn't in the given range). Is there a function in phobos which does a find but returns everything _before_ what you're searching for? I can't find one that will do that, and I

Re: D2: std.algorithm.find, but get part before what you were searching for

2010-03-04 Thread Lars T. Kyllingstad
Jonathan M Davis wrote: std.algorithm.find() returns the rest of the range starting at what you were searching for (or an empty range if it wasn't in the given range). Is there a function in phobos which does a find but returns everything _before_ what you're searching for? I can't find one

Re: D2: std.algorithm.find, but get part before what you were searching for

2010-03-04 Thread Jonathan M Davis
Lars T. Kyllingstad wrote: Jonathan M Davis wrote: std.algorithm.find() returns the rest of the range starting at what you were searching for (or an empty range if it wasn't in the given range). Is there a function in phobos which does a find but returns everything _before_ what you're

Re: D2: std.algorithm.find, but get part before what you were searching for

2010-03-04 Thread Lars T. Kyllingstad
Jonathan M Davis wrote: Lars T. Kyllingstad wrote: Jonathan M Davis wrote: std.algorithm.find() returns the rest of the range starting at what you were searching for (or an empty range if it wasn't in the given range). Is there a function in phobos which does a find but returns everything

Re: D2: std.algorithm.find, but get part before what you were searching for

2010-03-04 Thread Steven Schveighoffer
On Thu, 04 Mar 2010 03:55:40 -0500, Jonathan M Davis jmdavisp...@gmail.com wrote: On a side note, it would be great if we could figure out a way to make the docs more user-friendly - especially in std.algorithm. The functions are great, and they're really versatile, but that seems to come

Re: D2: std.algorithm.find, but get part before what you were searching for

2010-03-04 Thread Philippe Sigaud
On Thu, Mar 4, 2010 at 13:12, Steven Schveighoffer schvei...@yahoo.comwrote: It is an issue with DDoc. I think the signatures are not that nasty if you look at the actual code. I think DDoc expands all aliases so you get the full template-expanded signature. The problem also is that when

Re: std.file vs std.stream

2010-03-04 Thread Ali Çehreli
Lars T. Kyllingstad wrote: What you're seeing here is actually a consequence of Phobos very much being a work-in-progress. std.stdio was completely rewritten about a year ago, and it most likely contains what you're looking for. std.stream, on the other hand, hasn't seen major updates

Re: D2: std.algorithm.find, but get part before what you were searching for

2010-03-04 Thread Jonathan M Davis
Jesse Phillips wrote: Jonathan M Davis wrote: Hmm. I'd thought that I'd looked at that one and determined that it didn't do what I was looking for, but on another inspection of it, it does look like until() will do the job. It has the potential downside that unlike find, it cannot take

Re: std.file vs std.stream

2010-03-04 Thread Lars T. Kyllingstad
Ludovic A. wrote: Hej, thanks! First I want to underline that I use Digital Mars D Compiler v2.040, and my 2 examples are _working_ examples with this compiler. So I really mean that std.file is working on the last D compiler :) I felt that those examples didn't 'smell' like D, and I also got

Re: std.file vs std.stream

2010-03-04 Thread Lars T. Kyllingstad
Ali Çehreli wrote: Lars T. Kyllingstad wrote: What you're seeing here is actually a consequence of Phobos very much being a work-in-progress. std.stdio was completely rewritten about a year ago, and it most likely contains what you're looking for. std.stream, on the other hand,

Re: line counting tool that detects D comments etc?

2010-03-04 Thread Kagamin
Trass3r Wrote: e.g. what's the significance of being able to detect nested comments? so they aren't counted as lines of code. Just a simple tool that counts actual LoC, empty lines, comments, maybe ddoc comments... don't know ready solution, but Scintilla's D lexer may be of some use.

[Issue 3869] Unreasonable error without line number: recursive template expansion

2010-03-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3869 Stewart Gordon s...@iname.com changed: What|Removed |Added Keywords||rejects-valid, spec

[Issue 3378] [tdpl] ++x should be an lvalue

2010-03-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3378 --- Comment #5 from Walter Bright bugzi...@digitalmars.com 2010-03-04 02:40:29 PST --- C99 says this about ++x: ---6.5.3.1- The operand of the prefix increment or decrement operator shall have qualified or unqualified real or

  1   2   >