Re: Start of dmd 2.064 beta program

2013-10-18 Thread Jacob Carlborg
On 2013-10-17 22:35, Andrej Mitrovic wrote: - Walter is still not tagging the beta releases by the file name (it's always dmd2beta.zip). I've complained about this several times and IIRC someone else did as well at dconf (maybe I'm remembering wrong though). They should at least be named as

Re: code.dlang.org now supports categories and search

2013-10-18 Thread Suliman
code.dlang.org Does we should have cats? maybe the organization by tags is better?

Re: code.dlang.org now supports categories and search

2013-10-18 Thread Sönke Ludwig
Am 18.10.2013 08:47, schrieb Suliman: code.dlang.org Does we should have cats? maybe the organization by tags is better? You mean like a flat list of tags? Currently it's something like hierarchical tags. Each package can have multiple categories, and the specific categories, as well as the

Re: Start of dmd 2.064 beta program

2013-10-18 Thread eles
On Friday, 18 October 2013 at 06:36:43 UTC, Jacob Carlborg wrote: On 2013-10-17 22:35, Andrej Mitrovic wrote: - Walter is still not tagging the beta releases by the file name (it's always dmd2beta.zip). I've complained about this several times and IIRC someone else did as well at dconf (maybe

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Walter Bright
On 10/17/2013 11:45 PM, deadalnix wrote: Also, when NOT using the unittest flag, a lot of my code do not compile, symbol _D6object15__T7reserveTyaZ7reserveFNaNbNeKAyamZm is missing. See: http://d.puremagic.com/issues/show_bug.cgi?id=11284

Re: code.dlang.org now supports categories and search

2013-10-18 Thread Sönke Ludwig
Am 17.10.2013 20:25, schrieb Tourist: On Thursday, 17 October 2013 at 18:22:02 UTC, Sönke Ludwig wrote: Am 16.10.2013 21:01, schrieb Sönke Ludwig: The DUB package registry [1] has finally gained support for the text and category based search of packages. There is also a category for D standard

Re: code.dlang.org now supports categories and search

2013-10-18 Thread Tourist
On Friday, 18 October 2013 at 10:23:20 UTC, Sönke Ludwig wrote: Am 17.10.2013 20:25, schrieb Tourist: On Thursday, 17 October 2013 at 18:22:02 UTC, Sönke Ludwig wrote: Am 16.10.2013 21:01, schrieb Sönke Ludwig: The DUB package registry [1] has finally gained support for the text and category

Re: Mono-D 0.5.4.1 - Build, completion other fixes + Unittests via rdmd

2013-10-18 Thread Bruno Medeiros
On 16/10/2013 13:42, Dicebot wrote: On Wednesday, 16 October 2013 at 12:38:40 UTC, Bruno Medeiros wrote: On 08/10/2013 14:18, Alexander Bothe wrote: Are there any plans/tricks/hacks on how to get programs built with dmd debuggable with gdb? Then we also could release the addin for Windows as

Re: Mono-D 0.5.4.1 - Build, completion other fixes + Unittests via rdmd

2013-10-18 Thread Bruno Medeiros
On 16/10/2013 22:21, Andrei Alexandrescu wrote: On 10/16/13 5:38 AM, Bruno Medeiros wrote: On 08/10/2013 14:18, Alexander Bothe wrote: Are there any plans/tricks/hacks on how to get programs built with dmd debuggable with gdb? Then we also could release the addin for Windows as well! (Afaik I

Re: Mono-D 0.5.4.1 - Build, completion other fixes + Unittests via rdmd

2013-10-18 Thread Iain Buclaw
On 18 October 2013 12:43, Bruno Medeiros brunodomedeiros+...@gmail.com wrote: On 16/10/2013 22:21, Andrei Alexandrescu wrote: On 10/16/13 5:38 AM, Bruno Medeiros wrote: On 08/10/2013 14:18, Alexander Bothe wrote: Are there any plans/tricks/hacks on how to get programs built with dmd

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Andrej Mitrovic
On 10/18/13, eles e...@eles.com wrote: IIRC, Walter wanted that file to always be named dmd.zip or dmd2.zip or whatever, in order to allow a permanent download link, while guaranteeing the file to be the latest version of the tool. This is the wrong approach. There should be a latest_beta

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Andrei Alexandrescu
On 10/18/13 7:08 AM, Andrej Mitrovic wrote: On 10/18/13, eles e...@eles.com wrote: IIRC, Walter wanted that file to always be named dmd.zip or dmd2.zip or whatever, in order to allow a permanent download link, while guaranteeing the file to be the latest version of the tool. This is the wrong

DUB 0.9.19 has been released

2013-10-18 Thread Sönke Ludwig
Major changes since 0.9.18 - Added support for dub build package name and dub run package name to build/run a specific package instead of the root package in the current directory. This works for any installed packages, as well as for sub packages. - Added a --root=directory switch to

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Benjamin Thaut
Am 18.10.2013 09:33, schrieb deadalnix: On Friday, 18 October 2013 at 07:21:47 UTC, Walter Bright wrote: On 10/17/2013 11:45 PM, deadalnix wrote: Also, when NOT using the unittest flag, a lot of my code do not compile, symbol _D6object15__T7reserveTyaZ7reserveFNaNbNeKAyamZm is missing. See:

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Jonathan M Davis
On Friday, October 18, 2013 08:57:00 Andrei Alexandrescu wrote: Speaking of which, insisting on using .zip files is another beef I have with Walter. The whole everyone on Windows is stuck in the 90s mentality is plain wrong, especially for programmers. 7zip (or Peazip or whatever) should

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Andrej Mitrovic
On 10/18/13, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I don't think that makes a large difference. Probably the better thing to do is trimming the contents of the archive. Right, but this is more general. He also dislikes non-zip archives in bugzilla attachments.

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Rory McGuire
On 18 Oct 2013 19:45, Jonathan M Davis jmdavisp...@gmx.com wrote: On Friday, October 18, 2013 08:57:00 Andrei Alexandrescu wrote: Speaking of which, insisting on using .zip files is another beef I have with Walter. The whole everyone on Windows is stuck in the 90s mentality is plain

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Andrei Alexandrescu
This is a good list of things that we could and should improve. Getting all minded to perfection would be difficult, but definitely worth living into. I appreciate your enthusiasm for and involvement in D. At the top level a few simple realities need to be understood. First, there is no OSS

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Walter Bright
On 10/18/2013 12:33 AM, deadalnix wrote: I highly doubt that this fit into cases 1 to 4 as you mention. I'll however double check with that in mind. I want to know about any other cases, so please investigate. That also doesn't explain why I get a closure bug (frame pointer or frame content

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Walter Bright
On 10/18/2013 11:17 AM, Rory McGuire wrote: Does it even support executable permissions? Yes, it does.

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Rory McGuire
On 18 Oct 2013 21:00, Walter Bright newshou...@digitalmars.com wrote: On 10/18/2013 11:17 AM, Rory McGuire wrote: Does it even support executable permissions? Yes, it does. Nice. It's there any particular reason you prefer zip? I guess it's irrelevant what the current format is if we start

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Jason King
I get bitten by it locally too: if there's a test with an inaccurate sql query with time formatted as string, the sql server doesn't always compute it, because the default human-readable time format is taken from the current locale, and to parse it one first has to guess the format itself,

Re: DUB 0.9.19 has been released

2013-10-18 Thread notna
download link gives: 500 - Internal Server Error Internal Server Error Internal error information: core.exception.AssertError@../../../opt/vibe/source/vibe/http/client.d(252): Interleaved request detected! ./allsites(_d_assert_msg+0x45) [0x6f0d55] ./allsites(bool

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Walter Bright
On 10/18/2013 12:14 PM, Rory McGuire wrote: Nice. It's there any particular reason you prefer zip? It's easy and works on all platforms. I also point out that, for all platforms supported, when we do a release we also build a custom download package for each platform in that platform's

More reddit discussion on Facebook using D

2013-10-18 Thread Walter Bright
http://www.reddit.com/r/programming/comments/1opwa3/facebook_adopts_d_language/

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Andrej Mitrovic
On 10/18/13, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: nobody has the time and inclination to actually _be_ the build czar (which is entirely understandable). Building something should be a command on the command-line. The whole issue is about currently having a person in place

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Walter Bright
On 10/18/2013 1:29 PM, Andrej Mitrovic wrote: But I hope you understand this isn't really about you or Walter not doing these things yourself, but rather the fact that you didn't seem to recognize this as being a problem. I've mentioned the build/release issue many times, and now we finally have

Re: Start of dmd 2.064 beta program

2013-10-18 Thread Jonathan M Davis
On Friday, October 18, 2013 15:31:05 Walter Bright wrote: We do need a Build Czar, because the install builds break every time, due to things like failure to update the manifests, new build targets, new features, etc. Somebody has to be responsible for getting all the scripts tested and

Re: Safe mode in D?

2013-10-18 Thread Maxim Fomin
On Thursday, 17 October 2013 at 23:25:52 UTC, Meta wrote: On Thursday, 17 October 2013 at 23:18:21 UTC, DDD wrote: I tried this code and the compiler allowed it (runtime I get object.Error: Access Violation). What am I doing wrong? Thanks I didn't notice @safe import std.stdio; class A {

Re: Safe mode in D?

2013-10-18 Thread Maxim Fomin
On Thursday, 17 October 2013 at 22:56:04 UTC, DDD wrote: Hi I heard that you can pass a command line argument to make D safe. Like 0 chance of memory corruption and such. I tried looking here http://dlang.org/dmd-linux.html but I couldn't figure it out. If it matters I'm on windows using the

Re: Safe mode in D?

2013-10-18 Thread Maxim Fomin
On Thursday, 17 October 2013 at 23:18:21 UTC, DDD wrote: I tried this code and the compiler allowed it (runtime I get object.Error: Access Violation). What am I doing wrong? Thanks I didn't notice @safe import std.stdio; class A { int x = 1; } @safe void main() { A a;

Re: Help needed testing automatic win64 configuration

2013-10-18 Thread Rainer Schuetze
On 18.10.2013 05:03, Manu wrote: Even with VS2010, I don't like msbuild. I think msbuild has good dependency handling, see the Intel Compiler integration which is horrible. My impression is that MS subverts msbuild for C++ to make it acceptable. Fair enough. So property

Re: Help needed testing automatic win64 configuration

2013-10-18 Thread Walter Bright
On 10/16/2013 10:27 PM, Brad Anderson wrote: I agree. It's just a matter of getting Walter on board. He hasn't said yay or nay to lib64 but he's just put sc.ini in the repo now for hot steamy pull request action so I think he's probably down. I'll let you guys duke it out and it'll hopefully

add -allinst compiler switch

2013-10-18 Thread Walter Bright
Explained here: http://d.puremagic.com/issues/show_bug.cgi?id=11284 It's a bit complicated, and important. BTW, I hate the name of the switch, but haven't thought of anything better.

Re: Safe mode in D?

2013-10-18 Thread Maxim Fomin
On Friday, 18 October 2013 at 07:04:39 UTC, Maxim Fomin wrote: On Thursday, 17 October 2013 at 23:18:21 UTC, DDD wrote: I tried this code and the compiler allowed it (runtime I get object.Error: Access Violation). What am I doing wrong? Thanks I didn't notice @safe import std.stdio; class

Re: D and event-based programming

2013-10-18 Thread Netwalker
On Thursday, 17 October 2013 at 19:14:11 UTC, Dicebot wrote: vibed.org vibe.d fully event-based, but also want to learn how to do it with D

Re: D and event-based programming

2013-10-18 Thread simendsjo
On Friday, 18 October 2013 at 07:43:58 UTC, Netwalker wrote: On Thursday, 17 October 2013 at 19:14:11 UTC, Dicebot wrote: vibed.org vibe.d fully event-based, but also want to learn how to do it with D The full source is available here: https://github.com/rejectedsoftware/vibe.d?source=cc

Re: add -allinst compiler switch

2013-10-18 Thread Max Samukha
On Friday, 18 October 2013 at 07:17:12 UTC, Walter Bright wrote: Explained here: http://d.puremagic.com/issues/show_bug.cgi?id=11284 It's a bit complicated, and important. BTW, I hate the name of the switch, but haven't thought of anything better. A good start would be to have the issues

Re: Help needed testing automatic win64 configuration

2013-10-18 Thread Iain Buclaw
On 18 October 2013 04:03, Manu turkey...@gmail.com wrote: On 18 October 2013 07:20, Rainer Schuetze r.sagita...@gmx.de wrote: On 17.10.2013 10:41, Manu wrote: Hmmm, I tend to think that sc.ini should be ignored/overridden entirely under VisualD. Visual Studio has all its own places to

Re: Safe mode in D?

2013-10-18 Thread John Colvin
On Friday, 18 October 2013 at 06:26:51 UTC, Maxim Fomin wrote: On Thursday, 17 October 2013 at 23:25:52 UTC, Meta wrote: On Thursday, 17 October 2013 at 23:18:21 UTC, DDD wrote: I tried this code and the compiler allowed it (runtime I get object.Error: Access Violation). What am I doing wrong?

Re: Safe mode in D?

2013-10-18 Thread Maxim Fomin
On Friday, 18 October 2013 at 09:10:30 UTC, John Colvin wrote: On Friday, 18 October 2013 at 06:26:51 UTC, Maxim Fomin wrote: On Thursday, 17 October 2013 at 23:25:52 UTC, Meta wrote: On Thursday, 17 October 2013 at 23:18:21 UTC, DDD wrote: I tried this code and the compiler allowed it

Re: Eloquently sums up my feelings about the disadvantages of dynamic typing

2013-10-18 Thread Chris
On Friday, 18 October 2013 at 02:08:59 UTC, Nick Sabalausky wrote: On Wed, 16 Oct 2013 23:00:04 -0700 H. S. Teoh hst...@quickfur.ath.cx wrote: On Wed, Oct 16, 2013 at 11:07:20PM -0400, Jonathan M Davis wrote: In contrast, with a dynamically typed language, the type of a variable can

Missing compiler warning?

2013-10-18 Thread Chris
I had a stupid bug: class Base { SomeStruct someStruct; // ... } class BaseSub { // ... override { public void doThis() { auto someStruct = checkSomething(input); // Bug is here, of course, // a leftover from old code }

Re: Empty VS null array?

2013-10-18 Thread Regan Heath
On Fri, 18 Oct 2013 00:32:46 +0100, H. S. Teoh hst...@quickfur.ath.cx wrote: On Fri, Oct 18, 2013 at 01:27:33AM +0200, Adam D. Ruppe wrote: On Thursday, 17 October 2013 at 23:12:03 UTC, ProgrammingGhost wrote: is null still treats [] as null. blah, you're right. It will at least distinguish

Re: Eloquently sums up my feelings about the disadvantages of dynamic typing

2013-10-18 Thread Chris
On Friday, 18 October 2013 at 10:23:34 UTC, Chris wrote: On Friday, 18 October 2013 at 02:08:59 UTC, Nick Sabalausky wrote: On Wed, 16 Oct 2013 23:00:04 -0700 H. S. Teoh hst...@quickfur.ath.cx wrote: On Wed, Oct 16, 2013 at 11:07:20PM -0400, Jonathan M Davis wrote: In contrast, with a

Re: add -allinst compiler switch

2013-10-18 Thread Iain Buclaw
On 18 October 2013 08:17, Walter Bright newshou...@digitalmars.com wrote: Explained here: http://d.puremagic.com/issues/show_bug.cgi?id=11284 It's a bit complicated, and important. BTW, I hate the name of the switch, but haven't thought of anything better. GDC has -femit-templates which

Re: Help needed testing automatic win64 configuration

2013-10-18 Thread Jacob Carlborg
On 2013-10-18 09:54, Iain Buclaw wrote: Wishful thinking if you were to believe that one day VisualStudio and GCC will be ABI compatible (*cough*) It seems LLVM tries to be compatible with Visual Studio. -- /Jacob Carlborg

Re: Safe mode in D?

2013-10-18 Thread Wyatt
On Friday, 18 October 2013 at 10:03:03 UTC, Maxim Fomin wrote: portable), but you can enable treating nulls as exception in linux if you use etc.linux.memoryerrors. Oh. This exists. Don't suppose there were any plans to document it? -Wyatt

Re: Eloquently sums up my feelings about the disadvantages of dynamic typing

2013-10-18 Thread Nick Sabalausky
On Fri, 18 Oct 2013 12:44:59 +0200 Chris wend...@tcd.ie wrote: On Friday, 18 October 2013 at 10:23:34 UTC, Chris wrote: from bottleneck import runslow I like bottlenecks in Blues, not in programs. Heh. They're very satisfying to play. Such a rich bass. Also fun to annoy people with :)

Re: D and event-based programming

2013-10-18 Thread Dicebot
On Friday, 18 October 2013 at 07:43:58 UTC, Netwalker wrote: On Thursday, 17 October 2013 at 19:14:11 UTC, Dicebot wrote: vibed.org vibe.d fully event-based, but also want to learn how to do it with D vibe.d internally uses libevent win32 event drivers for actual event implementation

Re: Early review of std.logger

2013-10-18 Thread Dicebot
Can you please re-generate the documentation after all recent updates?

Re: Eloquently sums up my feelings about the disadvantages of dynamic typing

2013-10-18 Thread Chris
On Friday, 18 October 2013 at 12:22:16 UTC, Nick Sabalausky wrote: On Fri, 18 Oct 2013 12:44:59 +0200 Chris wend...@tcd.ie wrote: On Friday, 18 October 2013 at 10:23:34 UTC, Chris wrote: from bottleneck import runslow I like bottlenecks in Blues, not in programs. Heh. They're very

Re: Empty VS null array?

2013-10-18 Thread Timon Gehr
On 10/18/2013 12:50 AM, ProgrammingGhost wrote: How do I find out if null was passed in? As you can guess I wasn't happy with the current behavior. ... http://forum.dlang.org/thread/rkdzdxygpflpnaznx...@forum.dlang.org?page=5

Re: Early review of std.logger

2013-10-18 Thread Robert Schadek
On 10/18/2013 02:55 PM, Dicebot wrote: Can you please re-generate the documentation after all recent updates? I usually do that. The only documentation missing is for MultiLogger, as I'm not sure if the current implementation is done.

Re: I don't like slices in D

2013-10-18 Thread Vitali
On Thursday, 17 October 2013 at 22:30:52 UTC, Jonathan M Davis wrote: http://dlang.org/d-array-article.html It should be enlightening. Yes, now I understand this article, but only after I had this long discussion here. The relevant statement for me is The responsible party for managing a

Re: Missing compiler warning?

2013-10-18 Thread Chris
Ok. Here's a version to work with, if anyone wants to reproduce the behavior. import std.stdio; void main() { auto sub = new BaseSub(); sub.doSomething(); } class Base { SomeStruct someStruct; this() { } public void

Re: Early review of std.logger

2013-10-18 Thread Dicebot
On Friday, 18 October 2013 at 13:35:19 UTC, Robert Schadek wrote: On 10/18/2013 02:55 PM, Dicebot wrote: Can you please re-generate the documentation after all recent updates? I usually do that. The only documentation missing is for MultiLogger, as I'm not sure if the current implementation

Re: Early review of std.logger

2013-10-18 Thread Robert Schadek
On 10/18/2013 03:49 PM, Dicebot wrote: On Friday, 18 October 2013 at 13:35:19 UTC, Robert Schadek wrote: On 10/18/2013 02:55 PM, Dicebot wrote: Can you please re-generate the documentation after all recent updates? I usually do that. The only documentation missing is for MultiLogger, as I'm

Re: Safe mode in D?

2013-10-18 Thread Timon Gehr
On 10/18/2013 09:30 AM, Maxim Fomin wrote: ... Nice collection. // Case 12. Breaking immutable via pure // import std.stdio; import core.memory; class A { int *ptr; ~this() { (*ptr)++; } } pure foo() { A a = new A; int* ptr = new int; a.ptr =

Re: I don't like slices in D

2013-10-18 Thread Adam D. Ruppe
On Friday, 18 October 2013 at 13:38:01 UTC, Vitali wrote: My prevoius example of the function removeElement(ref int[], int) will not work. The right implementation would be: void removeElement(ref int[] arr, int index) { arr[index..$-1] = arr[index+1..$].dup; .dup allocates a copy. The

Re: I don't like slices in D

2013-10-18 Thread Dicebot
On Friday, 18 October 2013 at 14:27:36 UTC, Adam D. Ruppe wrote: for(size_t idx = index; idx arr.length - 1; idx++) arr[idx] = arr[idx + 1]; You can do it via slice element-wise assignment: arr[index..$-1][] = arr[index+1..$][]

Re: I don't like slices in D

2013-10-18 Thread Dicebot
On Friday, 18 October 2013 at 14:29:44 UTC, Dicebot wrote: On Friday, 18 October 2013 at 14:27:36 UTC, Adam D. Ruppe wrote: for(size_t idx = index; idx arr.length - 1; idx++) arr[idx] = arr[idx + 1]; You can do it via slice element-wise assignment: arr[index..$-1][] =

Re: I don't like slices in D

2013-10-18 Thread Adam D. Ruppe
On Friday, 18 October 2013 at 14:29:44 UTC, Dicebot wrote: You can do it via slice element-wise assignment: nope, run the copy syntax and get this: object.Error: overlapping array copy (unless this was changed recently too)

Re: I don't like slices in D

2013-10-18 Thread bearophile
Adam D. Ruppe: arr.length = arr.length - 1; // arr.length-- won't compile due to silliness This code now compiles, the bug was fixed: void foo(ref int[] arr) { arr.length--; } void main() {} Bye, bearophile

Re: I don't like slices in D

2013-10-18 Thread bearophile
Dicebot: You can do it via slice element-wise assignment: arr[index..$-1][] = arr[index+1..$][] Overlapping slices error. You have to copy with Phobos... Bye, bearophile

Re: add -allinst compiler switch

2013-10-18 Thread Jacob Carlborg
On 2013-10-18 13:47, Iain Buclaw wrote: GDC has -femit-templates which emits all templates as private, then the linker then removes unreferenced templates. This however is different from the behavior in 2.063, in that it generates code for *no really, all* instantiated templates. This is

Re: add -allinst compiler switch

2013-10-18 Thread Dicebot
On Friday, 18 October 2013 at 07:17:12 UTC, Walter Bright wrote: Explained here: http://d.puremagic.com/issues/show_bug.cgi?id=11284 It's a bit complicated, and important. BTW, I hate the name of the switch, but haven't thought of anything better. I'd suggest to also support

Re: I don't like slices in D

2013-10-18 Thread Andrei Alexandrescu
On 10/17/13 10:45 PM, Jesse Phillips wrote: I believe this was the behavior of D1, is not true in D2 and must not be true for immutable arrays such as string. Yes, there have been repeated discussions in this group about changing that behavior, it created pernicious long-distance dependencies

Re: Structured logging (was Early review of std.logger)

2013-10-18 Thread ilya-stromberg
On Tuesday, 15 October 2013 at 15:21:52 UTC, Johannes Pfau wrote: I think one increasingly important point for std.log is 'structured logging'. Structured logging is basically not simply logging textual messages, but also logging additional KEY/VALUE pairs of data. The idea is that logs

Re: C locale

2013-10-18 Thread Luís.Marques
http://d.puremagic.com/issues/show_bug.cgi?id=11293 https://github.com/D-Programming-Language/druntime/pull/641

Re: Safe mode in D?

2013-10-18 Thread Andrei Alexandrescu
On 10/17/13 11:53 PM, Maxim Fomin wrote: Root of the issue is that in D static type system and memory safity are separated from each other. Key idea is that having information about static type of object is not sufficient to know whether using it is memory safe or not. This is a common

Re: Empty VS null array?

2013-10-18 Thread Andrei Alexandrescu
On 10/18/13 3:44 AM, Regan Heath wrote: On Fri, 18 Oct 2013 00:32:46 +0100, H. S. Teoh hst...@quickfur.ath.cx wrote: On Fri, Oct 18, 2013 at 01:27:33AM +0200, Adam D. Ruppe wrote: On Thursday, 17 October 2013 at 23:12:03 UTC, ProgrammingGhost wrote: is null still treats [] as null. blah,

Re: Safe mode in D?

2013-10-18 Thread Dicebot
On Friday, 18 October 2013 at 15:39:35 UTC, Andrei Alexandrescu wrote: This is a common approach in many languages (actually all that I know about). Clearly stuff on the stack can be attached an invisible attribute it's on the stack! but that doesn't go well with separate compilation. As we

Re: Structured logging (was Early review of std.logger)

2013-10-18 Thread Dicebot
On Friday, 18 October 2013 at 15:29:09 UTC, ilya-stromberg wrote: About syntax - we can use something like this: log!(user, server, errorCode)(LOGIN_FAILED_UUID, Couldn't log in); That will be template instance bloat disaster for something used as commonly as log function (comparing to a

Re: Structured logging (was Early review of std.logger)

2013-10-18 Thread ilya-stromberg
On Friday, 18 October 2013 at 16:01:30 UTC, Dicebot wrote: On Friday, 18 October 2013 at 15:29:09 UTC, ilya-stromberg wrote: About syntax - we can use something like this: log!(user, server, errorCode)(LOGIN_FAILED_UUID, Couldn't log in); That will be template instance bloat disaster for

Re: Empty VS null array?

2013-10-18 Thread Max Samukha
On Friday, 18 October 2013 at 15:42:56 UTC, Andrei Alexandrescu wrote: On 10/18/13 3:44 AM, Regan Heath wrote: On Fri, 18 Oct 2013 00:32:46 +0100, H. S. Teoh hst...@quickfur.ath.cx wrote: On Fri, Oct 18, 2013 at 01:27:33AM +0200, Adam D. Ruppe wrote: On Thursday, 17 October 2013 at 23:12:03

Re: Missing compiler warning?

2013-10-18 Thread bearophile
Chris: I had a stupid bug: class Base { SomeStruct someStruct; // ... } class BaseSub { // ... override { public void doThis() { auto someStruct = checkSomething(input); // Bug is here, of course, // a leftover from old code

Re: Safe mode in D?

2013-10-18 Thread Paulo Pinto
Am 18.10.2013 17:40, schrieb Andrei Alexandrescu: On 10/17/13 11:53 PM, Maxim Fomin wrote: ... It's a given that safety will disallow constructs that are safe upon inspection but the type system is unable to prove correct. This is the case for all languages, C# included. Andrei Wouldn't

Re: Empty VS null array?

2013-10-18 Thread Dicebot
On Friday, 18 October 2013 at 15:42:56 UTC, Andrei Alexandrescu wrote: That's bad API design, pure and simple. The function should e.g. return the string including the line terminator, and only return an empty (or null) string upon EOF. I'd say it should throw upon EOF as it is pretty

Re: Empty VS null array?

2013-10-18 Thread Andrei Alexandrescu
On 10/18/13 9:26 AM, Max Samukha wrote: *That's* bad API design. readln should be symmetrical to writeln, not write. And about preserving the exact representation of new lines, readln/writeln shouldn't preserve that, pure and simple. Fair point. I just gave one possible alternative out of

Re: Safe mode in D?

2013-10-18 Thread H. S. Teoh
On Fri, Oct 18, 2013 at 06:34:07PM +0200, Paulo Pinto wrote: Am 18.10.2013 17:40, schrieb Andrei Alexandrescu: On 10/17/13 11:53 PM, Maxim Fomin wrote: ... It's a given that safety will disallow constructs that are safe upon inspection but the type system is unable to prove correct. This is

Re: Empty VS null array?

2013-10-18 Thread H. S. Teoh
On Fri, Oct 18, 2013 at 06:26:05PM +0200, Max Samukha wrote: On Friday, 18 October 2013 at 15:42:56 UTC, Andrei Alexandrescu wrote: On 10/18/13 3:44 AM, Regan Heath wrote: [...] Take this simple design: string readline(); This function would like to be able to: - return null for EOF

Re: Safe mode in D?

2013-10-18 Thread Dicebot
On Friday, 18 October 2013 at 17:19:17 UTC, Adam D. Ruppe wrote: On Friday, 18 October 2013 at 17:06:57 UTC, H. S. Teoh wrote: But if we're gonna do it, I say we should go all the way: And make scope the default parameter thingy, and implement it. God I want some kind of escaping check thing

Re: Safe mode in D?

2013-10-18 Thread H. S. Teoh
On Fri, Oct 18, 2013 at 07:19:16PM +0200, Adam D. Ruppe wrote: On Friday, 18 October 2013 at 17:06:57 UTC, H. S. Teoh wrote: But if we're gonna do it, I say we should go all the way: And make scope the default parameter thingy, and implement it. God I want some kind of escaping check thing

Re: Safe mode in D?

2013-10-18 Thread H. S. Teoh
On Fri, Oct 18, 2013 at 07:25:03PM +0200, Dicebot wrote: On Friday, 18 October 2013 at 17:19:17 UTC, Adam D. Ruppe wrote: On Friday, 18 October 2013 at 17:06:57 UTC, H. S. Teoh wrote: But if we're gonna do it, I say we should go all the way: And make scope the default parameter thingy, and

Re: Empty VS null array?

2013-10-18 Thread Jonathan M Davis
On Friday, October 18, 2013 09:55:46 Andrei Alexandrescu wrote: On 10/18/13 9:26 AM, Max Samukha wrote: *That's* bad API design. readln should be symmetrical to writeln, not write. And about preserving the exact representation of new lines, readln/writeln shouldn't preserve that, pure and

Re: Safe mode in D?

2013-10-18 Thread Adam D. Ruppe
On Friday, 18 October 2013 at 17:06:57 UTC, H. S. Teoh wrote: But if we're gonna do it, I say we should go all the way: And make scope the default parameter thingy, and implement it. God I want some kind of escaping check thing so badly, it is supposed to work already!

Re: Safe mode in D?

2013-10-18 Thread Jonathan M Davis
On Friday, October 18, 2013 10:31:55 H. S. Teoh wrote: On Fri, Oct 18, 2013 at 07:25:03PM +0200, Dicebot wrote: On Friday, 18 October 2013 at 17:19:17 UTC, Adam D. Ruppe wrote: On Friday, 18 October 2013 at 17:06:57 UTC, H. S. Teoh wrote: But if we're gonna do it, I say we should go all the

Re: Safe mode in D?

2013-10-18 Thread Jonathan M Davis
On Friday, October 18, 2013 10:05:39 H. S. Teoh wrote: It would break existing code. But if we're gonna do it, I say we should go all the way: make @safe, pure, and nothrow default, and require annotations only for @system, impure, throwing. If we advertise D as do the right thing by

Re: Empty VS null array?

2013-10-18 Thread H. S. Teoh
On Fri, Oct 18, 2013 at 01:32:58PM -0400, Jonathan M Davis wrote: On Friday, October 18, 2013 09:55:46 Andrei Alexandrescu wrote: On 10/18/13 9:26 AM, Max Samukha wrote: *That's* bad API design. readln should be symmetrical to writeln, not write. And about preserving the exact

Re: Missing compiler warning?

2013-10-18 Thread Jonathan M Davis
On Friday, October 18, 2013 18:32:32 bearophile wrote: Currently D doesn't give an error or warning if in a method you declare a local variable with the same name of a instance member. This is indeed a source of bugs and I have had similar problems. Generally D prefers to minimize the number

Re: Safe mode in D?

2013-10-18 Thread H. S. Teoh
On Fri, Oct 18, 2013 at 01:38:12PM -0400, Jonathan M Davis wrote: On Friday, October 18, 2013 10:31:55 H. S. Teoh wrote: On Fri, Oct 18, 2013 at 07:25:03PM +0200, Dicebot wrote: On Friday, 18 October 2013 at 17:19:17 UTC, Adam D. Ruppe wrote: On Friday, 18 October 2013 at 17:06:57 UTC, H.

Re: Safe mode in D?

2013-10-18 Thread Jonathan M Davis
On Friday, October 18, 2013 10:41:38 H. S. Teoh wrote: On Fri, Oct 18, 2013 at 01:38:12PM -0400, Jonathan M Davis wrote: What's the reason for refusing to implement flow analysis? Maybe I'm missing something obvious, but for the purposes of escape analysis, isn't it enough to just have a

Re: Empty VS null array?

2013-10-18 Thread deadalnix
On Friday, 18 October 2013 at 15:42:56 UTC, Andrei Alexandrescu wrote: This comes up time and again. The use of, and ability to distinguish empty from null is very useful. I disagree. That what if does by default.

Re: Empty VS null array?

2013-10-18 Thread Max Samukha
On Friday, 18 October 2013 at 16:55:19 UTC, Andrei Alexandrescu wrote: Fair point. I just gave one possible alternative out of many. Thing is, relying on client code to distinguish subtleties between empty and null strings is fraught with dangers. Andrei I agree. Thinking about your

Re: Empty VS null array?

2013-10-18 Thread Jonathan M Davis
On Friday, October 18, 2013 10:38:12 H. S. Teoh wrote: On Fri, Oct 18, 2013 at 01:32:58PM -0400, Jonathan M Davis wrote: On Friday, October 18, 2013 09:55:46 Andrei Alexandrescu wrote: On 10/18/13 9:26 AM, Max Samukha wrote: *That's* bad API design. readln should be symmetrical to

Re: Missing compiler warning?

2013-10-18 Thread bearophile
Jonathan M Davis: The prime example is constructors. this(int a, string b) { this.a = a; this.b = b; ... } That example of yours shows a possible intermediate rule: when in a method you define a local variable that has the same name as an instance member, then the instance member must

Re: Safe mode in D?

2013-10-18 Thread Andrei Alexandrescu
On 10/18/13 10:53 AM, Jonathan M Davis wrote: On Friday, October 18, 2013 10:41:38 H. S. Teoh wrote: On Fri, Oct 18, 2013 at 01:38:12PM -0400, Jonathan M Davis wrote: What's the reason for refusing to implement flow analysis? Maybe I'm missing something obvious, but for the purposes of escape

Re: Missing compiler warning?

2013-10-18 Thread Ali Çehreli
On 10/18/2013 10:42 AM, Jonathan M Davis wrote: If you want to avoid the problem, then just don't name your local variables the same as your member variables Like OP, when I was bitten by this before, I had not intended to define a local variable. It is too easy for the fingers to drop an

Re: Safe mode in D?

2013-10-18 Thread Maxim Fomin
On Friday, 18 October 2013 at 18:59:46 UTC, Andrei Alexandrescu wrote: I think one good compromise is to stick with the exact amount of flow control we currently have in constructors (which is primitive but quite adequate), and use that creatively. It's already implemented and works, so the

  1   2   >