Re: assert(0)

2015-11-08 Thread Idan Arye via Digitalmars-d
On Saturday, 7 November 2015 at 21:24:02 UTC, Fyodor Ustinov wrote: Colleagues, IMHO: If "assert" catch "fundamental programmers errors" - it should hang programm immediately with and without "-release". If "assert" catch not "too fundamental&quo

Re: assert(0)

2015-11-08 Thread Jonathan M Davis via Digitalmars-d
On Sunday, 8 November 2015 at 02:51:33 UTC, rsw0x wrote: Dumb question, does nothrow affect codegen? I'd be very surprised if it didn't. But even if it doesn't currently affect codegen, it likely will at some point in the future. - Jonathan M Davis

Re: assert(0)

2015-11-07 Thread Kapps via Digitalmars-d
On Sunday, 8 November 2015 at 02:51:33 UTC, rsw0x wrote: On Saturday, 7 November 2015 at 22:26:53 UTC, David Nadlinger wrote: On Saturday, 7 November 2015 at 21:00:58 UTC, Fyodor Ustinov wrote: We do not have way to in "scope(failure)" or "scope(exit)" detect - it's "assert" or "throw". Indee

Re: assert(0)

2015-11-07 Thread rsw0x via Digitalmars-d
On Saturday, 7 November 2015 at 22:26:53 UTC, David Nadlinger wrote: On Saturday, 7 November 2015 at 21:00:58 UTC, Fyodor Ustinov wrote: We do not have way to in "scope(failure)" or "scope(exit)" detect - it's "assert" or "throw". Indeed. But the point is that _all_ Errors (of which AssertErr

Re: assert(0)

2015-11-07 Thread David Nadlinger via Digitalmars-d
On Saturday, 7 November 2015 at 21:00:58 UTC, Fyodor Ustinov wrote: We do not have way to in "scope(failure)" or "scope(exit)" detect - it's "assert" or "throw". Indeed. But the point is that _all_ Errors (of which AssertError is one example) are throwable from `nothrow` functions, and as suc

Re: assert(0)

2015-11-07 Thread Fyodor Ustinov via Digitalmars-d
Colleagues, IMHO: If "assert" catch "fundamental programmers errors" - it should hang programm immediately with and without "-release". If "assert" catch not "too fundamental" errors - assert(0) should emit "Error" in both cases.

Re: assert(0)

2015-11-07 Thread anonymous via Digitalmars-d
On 07.11.2015 22:00, Fyodor Ustinov wrote: We do not have way to in "scope(failure)" or "scope(exit)" detect - it's "assert" or "throw". Ah, I get what you mean now. I think you have a point. Executing scope(failure/exit) code when an Error has been thrown may be bad. I'm not aware of the det

Re: assert(0)

2015-11-07 Thread Fyodor Ustinov via Digitalmars-d
On Saturday, 7 November 2015 at 20:50:02 UTC, Kapps wrote: Right. Errors indicate that something went fundamentally wrong in your program and no recovery is possible (indicates a programming error rather than an environmental error generally). So at this point the only thing to do is to close

Re: assert(0)

2015-11-07 Thread Fyodor Ustinov via Digitalmars-d
preffered weapon for it. :) 2. Without "-release" assert(0) launches scope(exit), scope(failure) and "finally" blocks. I.e. we get a completely different behavior in "-release" and not "-release" mode. Yeah, -release drastically changes how asserts beha

Re: assert(0)

2015-11-07 Thread anonymous via Digitalmars-d
On 07.11.2015 21:38, Fyodor Ustinov wrote: 1. I should generally _not_, but I _can_. D lets you to shoot your own foot, yes. You're encouraged not to do it, though. 2. Without "-release" assert(0) launches scope(exit), scope(failure) and "finally" blocks. I.e. we g

Re: assert(0)

2015-11-07 Thread Kapps via Digitalmars-d
On Saturday, 7 November 2015 at 20:48:24 UTC, Fyodor Ustinov wrote: "assert" not guaranteed caught by "scope(exit)/scope(failure)/finally" Where I can read about this in documentation? WBR, Fyodor. Right. Errors indicate that something went fundamentally wrong in your program and

Re: assert(0)

2015-11-07 Thread Fyodor Ustinov via Digitalmars-d
On Saturday, 7 November 2015 at 20:40:49 UTC, David Nadlinger wrote: On Saturday, 7 November 2015 at 20:38:20 UTC, Fyodor Ustinov wrote: 2. Without "-release" assert(0) launches scope(exit), scope(failure) and "finally" blocks. I.e. we get a completely different behavior i

Re: assert(0)

2015-11-07 Thread David Nadlinger via Digitalmars-d
On Saturday, 7 November 2015 at 20:38:20 UTC, Fyodor Ustinov wrote: 2. Without "-release" assert(0) launches scope(exit), scope(failure) and "finally" blocks. I.e. we get a completely different behavior in "-release" and not "-release" mode. This is no

Re: assert(0)

2015-11-07 Thread Fyodor Ustinov via Digitalmars-d
On Saturday, 7 November 2015 at 18:48:40 UTC, anonymous wrote: Asserts throw Errors, not Exceptions. You should generally not catch Errors. That's just as dangerous without -release as with it. 1. I should generally _not_, but I _can_. 2. Without "-release" assert(0) laun

Re: assert(0)

2015-11-07 Thread anonymous via Digitalmars-d
On 07.11.2015 19:42, Fyodor Ustinov wrote: Well. assert(0) located in very-very dangerous place. If we suddenly got to this place - Program should die immediately, otherwise there will be something terrible. But without "-release" this place less dangerous? Why without "-relea

assert(0)

2015-11-07 Thread Fyodor Ustinov via Digitalmars-d
Hi! I carefully read the http://www.digitalmars.com/d/archives/digitalmars/D/assert_0_behavior_269336.html and still have question. Well. assert(0) located in very-very dangerous place. If we suddenly got to this place - Program should die immediately, otherwise there will be something

Re: assert(0) behavior

2015-08-05 Thread Steven Schveighoffer via Digitalmars-d
On 8/5/15 12:46 PM, Jonathan M Davis wrote: Well, then please comment on the PR: https://github.com/D-Programming-Language/druntime/pull/1337 It seems to me that the whole point of abort is to work around the fact that Walter doesn't want assert(0) to print messages before the HLT instru

Re: assert(0) behavior

2015-08-05 Thread Jonathan M Davis via Digitalmars-d
't see anything special about druntime or Phobos with regards to assertions except for the fact that not much beyond the unit tests is going to be using druntime/Phobos in debug mode, so assertions in non-templated code simply aren't going to be doing anything outside of the unit test

Re: assert(0) behavior

2015-08-05 Thread Iain Buclaw via Digitalmars-d
On 4 August 2015 at 00:54, Walter Bright via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On 8/3/2015 8:50 AM, Steven Schveighoffer wrote: > >> 1. They aren't removed, they are replaced with a nearly useless segfault. >> > > Not useless at all: > > 1. The program does not continue running

Re: assert(0) behavior

2015-08-05 Thread via Digitalmars-d
On Wednesday, 5 August 2015 at 06:37:21 UTC, Walter Bright wrote: On 8/4/2015 8:26 PM, deadalnix wrote: On Tuesday, 4 August 2015 at 20:40:47 UTC, deadalnix wrote: Would you be of the opinion that assert should be a statement rather than an expression ? unreadability in the middle of expression

Re: assert(0) behavior

2015-08-05 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, 5 August 2015 at 08:09:49 UTC, Joseph Rushton Wakeling wrote: On Monday, 3 August 2015 at 23:57:36 UTC, Steven Schveighoffer wrote: At the very least, assert(0, "message") should be a compiler error, the message is unused information. Only if you compile in -re

Re: assert(0) behavior

2015-08-05 Thread Joseph Rushton Wakeling via Digitalmars-d
On Monday, 3 August 2015 at 23:57:36 UTC, Steven Schveighoffer wrote: At the very least, assert(0, "message") should be a compiler error, the message is unused information. Only if you compile in -release mode. Without wanting to get into a bikeshedding debate, I think that flag n

Re: assert(0) behavior

2015-08-05 Thread via Digitalmars-d
On Wednesday, 5 August 2015 at 05:51:32 UTC, Ola Fosheim Grøstad wrote: specification to the code for validation/documentation purposes. Err... Verification, usually not validation.

Re: assert(0) behavior

2015-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2015 8:26 PM, deadalnix wrote: On Tuesday, 4 August 2015 at 20:40:47 UTC, deadalnix wrote: Would you be of the opinion that assert should be a statement rather than an expression ? unreadability in the middle of expressions, especially when evaluation order is not well defined, is close t

Re: assert(0) behavior

2015-08-04 Thread via Digitalmars-d
On Tuesday, 4 August 2015 at 23:06:44 UTC, John Colvin wrote: I'm 90% on Walter's side here as he's right for the majority of common cases, but on the other hand there are plenty of situations where the boundary between code error and environment error get blurred. Well, the principled differ

Re: assert(0) behavior

2015-08-04 Thread deadalnix via Digitalmars-d
On Tuesday, 4 August 2015 at 20:40:47 UTC, deadalnix wrote: Would you be of the opinion that assert should be a statement rather than an expression ? unreadability in the middle of expressions, especially when evaluation order is not well defined, is close to impossible to get right. Ping ? W

Re: assert(0) behavior

2015-08-04 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, 5 August 2015 at 02:52:40 UTC, Jonathan M Davis wrote: On Tuesday, 4 August 2015 at 22:13:40 UTC, Steven Schveighoffer wrote: On 8/4/15 5:39 PM, Jonathan M Davis wrote: I'm certainly not opposed to have a message be printed before the HLT instruction with assert(0), but I

Re: assert(0) behavior

2015-08-04 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, 4 August 2015 at 22:13:40 UTC, Steven Schveighoffer wrote: On 8/4/15 5:39 PM, Jonathan M Davis wrote: I'm certainly not opposed to have a message be printed before the HLT instruction with assert(0), but I don't at all agree that the fact that the message is not seen i

Re: assert(0) behavior

2015-08-04 Thread Steven Schveighoffer via Digitalmars-d
On 8/4/15 7:33 PM, Walter Bright wrote: On 8/4/2015 2:07 PM, Steven Schveighoffer wrote: With druntime it's difficult to actually print the message fprintf(stderr, "You left the headlights on."); assert(0); Going under the assumption that the program isn'

Re: assert(0) behavior

2015-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2015 4:56 PM, deadalnix wrote: It seems that on american car, you bip as annoyingly as possible instead of announcing what's wrong. Preferably for anything and its reverse. It turns out you can make quite understandable speech simply by connecting an on/off I/O port to a speaker. So the

Re: assert(0) behavior

2015-08-04 Thread deadalnix via Digitalmars-d
On Tuesday, 4 August 2015 at 23:33:17 UTC, Walter Bright wrote: On 8/4/2015 2:07 PM, Steven Schveighoffer wrote: With druntime it's difficult to actually print the message fprintf(stderr, "You left the headlights on."); assert(0); It seems that on american car, you bi

Re: assert(0) behavior

2015-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2015 4:37 PM, Walter Bright wrote: On 8/4/2015 3:13 PM, Steven Schveighoffer wrote: For instance: https://github.com/D-Programming-Language/druntime/blob/master/src/core/time.d#L2283 This makes it seem like a message will be printed in the case where ticksPerSecond was 0. but in reali

Re: assert(0) behavior

2015-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2015 3:13 PM, Steven Schveighoffer wrote: For instance: https://github.com/D-Programming-Language/druntime/blob/master/src/core/time.d#L2283 This makes it seem like a message will be printed in the case where ticksPerSecond was 0. but in reality it simply throws a segfault. That's a b

Re: assert(0) behavior

2015-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2015 2:07 PM, Steven Schveighoffer wrote: With druntime it's difficult to actually print the message fprintf(stderr, "You left the headlights on."); assert(0);

Re: assert(0) behavior

2015-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2015 1:56 PM, Jonathan M Davis wrote: I can definitely see an argument that we should be printing out something before the HLT instruction in -release mode, writeln("Somebody forgot to turn off the water."); assert(0);

Re: assert(0) behavior

2015-08-04 Thread John Colvin via Digitalmars-d
On Tuesday, 4 August 2015 at 22:06:06 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 4 August 2015 at 20:21:24 UTC, Walter Bright wrote: On 8/3/2015 8:37 PM, Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= wrote: The input/environment/code distinction does not work very well. Sure it does. If your user ev

Re: assert(0) behavior

2015-08-04 Thread Steven Schveighoffer via Digitalmars-d
On 8/4/15 5:39 PM, Jonathan M Davis wrote: I'm certainly not opposed to have a message be printed before the HLT instruction with assert(0), but I don't at all agree that the fact that the message is not seen in -release is a reason not to have a message. For instance: https://gi

Re: assert(0) behavior

2015-08-04 Thread via Digitalmars-d
On Tuesday, 4 August 2015 at 20:21:24 UTC, Walter Bright wrote: On 8/3/2015 8:37 PM, Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= wrote: The input/environment/code distinction does not work very well. Sure it does. If your user ever sees an assert failure message, your program has a bug in it. Yes

Re: assert(0) behavior

2015-08-04 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, 4 August 2015 at 21:07:20 UTC, Steven Schveighoffer wrote: On 8/4/15 4:56 PM, Jonathan M Davis wrote: On Tuesday, 4 August 2015 at 20:48:52 UTC, Steven Schveighoffer wrote: On 8/4/15 4:43 PM, Steven Schveighoffer wrote: I should say, any assert(0) with a message printed that is

Re: assert(0) behavior

2015-08-04 Thread Steven Schveighoffer via Digitalmars-d
On 8/4/15 4:56 PM, Jonathan M Davis wrote: On Tuesday, 4 August 2015 at 20:48:52 UTC, Steven Schveighoffer wrote: On 8/4/15 4:43 PM, Steven Schveighoffer wrote: I should say, any assert(0) with a message printed that is possible to trigger in release mode is an error. If you can ensure it&#

Re: assert(0) behavior

2015-08-04 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, 4 August 2015 at 20:48:52 UTC, Steven Schveighoffer wrote: On 8/4/15 4:43 PM, Steven Schveighoffer wrote: I should say, any assert(0) with a message printed that is possible to trigger in release mode is an error. If you can ensure it's only possible to trigger when compil

Re: assert(0) behavior

2015-08-04 Thread Steven Schveighoffer via Digitalmars-d
On 8/4/15 4:43 PM, Steven Schveighoffer wrote: I should say, any assert(0) with a message printed that is possible to trigger in release mode is an error. If you can ensure it's only possible to trigger when compiled in debug mode (or for unit tests), then assert(0, msg) is fine. In that

Re: assert(0) behavior

2015-08-04 Thread deadalnix via Digitalmars-d
On Tuesday, 4 August 2015 at 20:23:53 UTC, Walter Bright wrote: On 8/4/2015 4:53 AM, Steven Schveighoffer wrote: Any assert(0) in druntime or phobos with a message printed is an error. It's compiled in release mode. When you're debugging phobos, you aren't compiling in relea

Re: assert(0) behavior

2015-08-04 Thread Steven Schveighoffer via Digitalmars-d
On 8/4/15 4:23 PM, Walter Bright wrote: On 8/4/2015 4:53 AM, Steven Schveighoffer wrote: Any assert(0) in druntime or phobos with a message printed is an error. It's compiled in release mode. When you're debugging phobos, you aren't compiling in release mode. Unless you aren

Re: assert(0) behavior

2015-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2015 8:04 AM, Dicebot wrote: Recently we had quite a lengthy discussion at work regarding possible guidelines for using asserts, contracts and enforce (we have similar own implementation) that would actually allow using -release flag for release builds. And got to certain principles that I

Re: assert(0) behavior

2015-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2015 4:58 AM, Steven Schveighoffer wrote: The only answer I can think of is to write a message to stderr, and then assert(0) as meta suggested. Print an error message and exit via abort() or whatever. No need to generate a halt - the program hasn't entered an unknown state.

Re: assert(0) behavior

2015-08-04 Thread Walter Bright via Digitalmars-d
On 8/4/2015 4:53 AM, Steven Schveighoffer wrote: Any assert(0) in druntime or phobos with a message printed is an error. It's compiled in release mode. When you're debugging phobos, you aren't compiling in release mode. But I've also been of the opinion, not widely shared,

Re: assert(0) behavior

2015-08-04 Thread Walter Bright via Digitalmars-d
On 8/3/2015 8:37 PM, Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= wrote: The input/environment/code distinction does not work very well. Sure it does. If your user ever sees an assert failure message, your program has a bug in it. Keep that in mind when designing the code, and the distinction will b

Re: assert(0) behavior

2015-08-04 Thread Steven Schveighoffer via Digitalmars-d
On 8/4/15 7:53 AM, Steven Schveighoffer wrote: Any assert(0) in druntime or phobos with a message printed is an error. It's compiled in release mode. I'll look through and find them, and rework them. First stab: https://github.com/D-Programming-Language/druntime/pull/1337 -Steve

Re: assert(0) behavior

2015-08-04 Thread Dicebot via Digitalmars-d
On Tuesday, 4 August 2015 at 14:40:16 UTC, Nick Sabalausky wrote: On 08/03/2015 11:59 AM, Dicebot wrote: General advice - simply don't ever use -release unless you are _very_ sure about program correctness (to the point of 100% test coverage and previous successful debug runs) This is very

Re: assert(0) behavior

2015-08-04 Thread Nick Sabalausky via Digitalmars-d
On 08/03/2015 11:59 AM, Dicebot wrote: General advice - simply don't ever use -release unless you are _very_ sure about program correctness (to the point of 100% test coverage and previous successful debug runs) This is very true. I never disable asserts or bounds checking for exactly that re

Re: assert(0) behavior

2015-08-04 Thread Steven Schveighoffer via Digitalmars-d
throw from core.time. Technically, usage of this unsupported clock will ALWAYS throw, or NEVER throw. That's difficult to encode into the system. The only answer I can think of is to write a message to stderr, and then assert(0) as meta suggested. -Steve

Re: assert(0) behavior

2015-08-04 Thread Steven Schveighoffer via Digitalmars-d
On 8/3/15 9:13 PM, Walter Bright wrote: On 8/3/2015 5:25 PM, Ali Çehreli wrote: On 08/03/2015 04:57 PM, Steven Schveighoffer wrote: > At the very least, assert(0, "message") should be a compiler error, the > message is unused information. Agreed. No. 1. If you want the

Re: assert(0) behavior

2015-08-03 Thread via Digitalmars-d
On Tuesday, 4 August 2015 at 03:04:14 UTC, Dicebot wrote: indeed. I remember Iain complaining about presence of HLT (and saying he won't do that for gdc) for exactly this reason. Yes. I think a lot of this confusion could have been avoided by using "halt()" instead of

Re: assert(0) behavior

2015-08-03 Thread Dicebot via Digitalmars-d
On Tuesday, 4 August 2015 at 02:37:00 UTC, Ola Fosheim Grøstad wrote: On Monday, 3 August 2015 at 15:18:12 UTC, Dicebot wrote: On Monday, 3 August 2015 at 14:34:52 UTC, Steven Schveighoffer wrote: Why do we do this? Because all asserts must be completely removed in -release Yet assert(0

Re: assert(0) behavior

2015-08-03 Thread via Digitalmars-d
On Monday, 3 August 2015 at 15:18:12 UTC, Dicebot wrote: On Monday, 3 August 2015 at 14:34:52 UTC, Steven Schveighoffer wrote: Why do we do this? Because all asserts must be completely removed in -release Yet assert(0) effectively mean "unreachable code" (it is actually defined t

Re: assert(0) behavior

2015-08-03 Thread Walter Bright via Digitalmars-d
On 8/3/2015 5:25 PM, Ali Çehreli wrote: On 08/03/2015 04:57 PM, Steven Schveighoffer wrote: > At the very least, assert(0, "message") should be a compiler error, the > message is unused information. Agreed. No. 1. If you want the message, do not use -release. 2. Do no

Re: assert(0) behavior

2015-08-03 Thread Walter Bright via Digitalmars-d
that supports clock_gettime, which is immutable and can be read easily at startup. However, how we handled the case where a clock could not be fetched is to assert(0, "don't support clock " ~ clockname). The clear expectation was that the message will be printed (along with file/line

Re: assert(0) behavior

2015-08-03 Thread Meta via Digitalmars-d
On Monday, 3 August 2015 at 23:57:36 UTC, Steven Schveighoffer wrote: OK, this brings up another debate. The thing that triggered all this is an issue with core.time, see issue https://issues.dlang.org/show_bug.cgi?id=14863 [...] Why not just " stderr.writeln(errMsg); assert(0);"?

Re: assert(0) behavior

2015-08-03 Thread Ali Çehreli via Digitalmars-d
On 08/03/2015 04:57 PM, Steven Schveighoffer wrote: > At the very least, assert(0, "message") should be a compiler error, the > message is unused information. Agreed. How about dumping the message to stderr as a best effort if the message is a literal? Hm... On the other

Re: assert(0) behavior

2015-08-03 Thread Steven Schveighoffer via Digitalmars-d
At that point, I'd rather you spend as much resources telling me what went wrong as possible. More info the better. Now, if it's expensive to include the throw vs. not including it (I don't know), then that's a fair point. If it means an extra few instructions to set up the

Re: assert(0) behavior

2015-08-03 Thread Walter Bright via Digitalmars-d
On 8/3/2015 8:50 AM, Steven Schveighoffer wrote: 1. They aren't removed, they are replaced with a nearly useless segfault. Not useless at all: 1. The program does not continue running after it has failed. (Please, let's not restart that debate. 2. Running it under a debugger, the location of

Re: assert(0) behavior

2015-08-03 Thread Steven Schveighoffer via Digitalmars-d
On 8/3/15 11:59 AM, Dicebot wrote: General advice - simply don't ever use -release unless you are _very_ sure about program correctness (to the point of 100% test coverage and previous successful debug runs) So in other words, only release code that has no bugs. Got it ;) -Steve

Re: assert(0) behavior

2015-08-03 Thread Steven Schveighoffer via Digitalmars-d
. They aren't removed, they are replaced with a nearly useless segfault. 2. If we are going to put something in there instead of "assert", why not just throw an error? Effectively: assert(0, msg) becomes a fancy way of writing (in any mode, release or otherwise): throw new

Re: assert(0) behavior

2015-08-03 Thread Dicebot via Digitalmars-d
General advice - simply don't ever use -release unless you are _very_ sure about program correctness (to the point of 100% test coverage and previous successful debug runs)

Re: assert(0) behavior

2015-08-03 Thread Dicebot via Digitalmars-d
y are replaced with a nearly useless segfault. 2. If we are going to put something in there instead of "assert", why not just throw an error? Effectively: assert(0, msg) becomes a fancy way of writing (in any mode, release or otherwise): throw new AssertError(msg); This is actually th

Re: assert(0) behavior

2015-08-03 Thread Steven Schveighoffer via Digitalmars-d
o put something in there instead of "assert", why not just throw an error? Effectively: assert(0, msg) becomes a fancy way of writing (in any mode, release or otherwise): throw new AssertError(msg); This is actually the way I thought it was done. -Steve

Re: assert(0) behavior

2015-08-03 Thread Dicebot via Digitalmars-d
On Monday, 3 August 2015 at 14:34:52 UTC, Steven Schveighoffer wrote: Why do we do this? Because all asserts must be completely removed in -release Yet assert(0) effectively mean "unreachable code" (it is actually defined that way in spec) and thus it is possible to ensure extra

assert(0) behavior

2015-08-03 Thread Steven Schveighoffer via Digitalmars-d
If you compile and run the following code, what happens? void main() { assert(0, "error message"); } answer: it depends. On OSX, if you compile this like so: dmd testassert.d ./testassert You get this message + stack trace: core.exception.AssertError@testassert.d(3): error me

Re: std.utf: use throw UTFException instead of assert(0) in stride, etc

2013-12-10 Thread Timothee Cour
;t we throw UTFException instead of assert(0) in > stride, > > etc ? > > std.utf only uses assert(0) when that code should be unreachable. It's > used to > catch bugs in the implementation, not in a function's input. If anything in > std.utf ever hits an assert(0),

Re: std.utf: use throw UTFException instead of assert(0) in stride, etc

2013-12-10 Thread Jonathan M Davis
On Tuesday, December 10, 2013 15:52:06 Timothee Cour wrote: > in std.utf shouldn't we throw UTFException instead of assert(0) in stride, > etc ? std.utf only uses assert(0) when that code should be unreachable. It's used to catch bugs in the implementation, not in a function'

std.utf: use throw UTFException instead of assert(0) in stride, etc

2013-12-10 Thread Timothee Cour
in std.utf shouldn't we throw UTFException instead of assert(0) in stride, etc ?