digitalmars.D.learn - just stop program
- spir (11/11) Nov 05 2010 Hello,
- div0 (8/15) Nov 05 2010 import std.c.process
- Lars T. Kyllingstad (7/31) Nov 05 2010 In D2 it is generally preferable to import core.stdc.* to get at the C
- div0 (7/38) Nov 05 2010 Since when?
- div0 (6/45) Nov 05 2010 core.c. that is. not that it really makes much difference. though I
- Lars T. Kyllingstad (12/52) Nov 07 2010 I don't know, I just remember there was a discussion about it -- probabl...
- spir (15/36) Nov 05 2010 struction like exit, quit, end, halt, stop...
- Lars T. Kyllingstad (11/45) Nov 05 2010 core.stdc.* contains the entire C standard library, for which there are
Hello, Is there a way for a program to simply exit before end of main()? An instru= ction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking for, as (1) the compiler protests if = there is unreachable code (2) it throws in non-release mode. I just want th= e program to stop, basta! My use case is first debugging (avoid later debug= output to be written on terminal).] Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com
Nov 05 2010
On 05/11/2010 09:32, spir wrote:Hello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking for, as (1) the compiler protests if there is unreachable code (2) it throws in non-release mode. I just want the program to stop, basta! My use case is first debugging (avoid later debug output to be written on terminal).] Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.comimport std.c.process then you've exit(int) & abort() You can get access to most C library functions through std.c.*, so it's always worth a quick check in there for lower level stuff. -- My enormous talent is exceeded only by my outrageous laziness. http://www.ssTk.co.uk
Nov 05 2010
On Fri, 05 Nov 2010 09:47:37 +0000, div0 wrote:On 05/11/2010 09:32, spir wrote:In D2 it is generally preferable to import core.stdc.* to get at the C stuff. std.c.* is a relic from D1, and it is uncertain what will be kept in the library. In this case, import core.stdc.stdlib to gain access to exit(int) and abort(). -LarsHello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking for, as (1) the compiler protests if there is unreachable code (2) it throws in non-release mode. I just want the program to stop, basta! My use case is first debugging (avoid later debug output to be written on terminal).] Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.comimport std.c.process then you've exit(int) & abort() You can get access to most C library functions through std.c.*, so it's always worth a quick check in there for lower level stuff.
Nov 05 2010
On 05/11/2010 10:14, Lars T. Kyllingstad wrote:On Fri, 05 Nov 2010 09:47:37 +0000, div0 wrote:Since when? That's not mentioned anywhere in the phobos docs and none of the core.* modules are even listed. -- My enormous talent is exceeded only by my outrageous laziness. http://www.ssTk.co.ukOn 05/11/2010 09:32, spir wrote:In D2 it is generally preferable to import core.stdc.* to get at the C stuff. std.c.* is a relic from D1, and it is uncertain what will be kept in the library. In this case, import core.stdc.stdlib to gain access to exit(int) and abort(). -LarsHello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking for, as (1) the compiler protests if there is unreachable code (2) it throws in non-release mode. I just want the program to stop, basta! My use case is first debugging (avoid later debug output to be written on terminal).] Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.comimport std.c.process then you've exit(int)& abort() You can get access to most C library functions through std.c.*, so it's always worth a quick check in there for lower level stuff.
Nov 05 2010
On 05/11/2010 15:09, div0 wrote:On 05/11/2010 10:14, Lars T. Kyllingstad wrote:core.c. that is. not that it really makes much difference. though I think I prefer std.c.* -- My enormous talent is exceeded only by my outrageous laziness. http://www.ssTk.co.ukOn Fri, 05 Nov 2010 09:47:37 +0000, div0 wrote:Since when? That's not mentioned anywhere in the phobos docs and none of the core.* modules are even listed.On 05/11/2010 09:32, spir wrote:In D2 it is generally preferable to import core.stdc.* to get at the C stuff. std.c.* is a relic from D1, and it is uncertain what will be kept in the library. In this case, import core.stdc.stdlib to gain access to exit(int) and abort(). -LarsHello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking for, as (1) the compiler protests if there is unreachable code (2) it throws in non-release mode. I just want the program to stop, basta! My use case is first debugging (avoid later debug output to be written on terminal).] Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.comimport std.c.process then you've exit(int)& abort() You can get access to most C library functions through std.c.*, so it's always worth a quick check in there for lower level stuff.
Nov 05 2010
On Fri, 05 Nov 2010 15:09:05 +0000, div0 wrote:On 05/11/2010 10:14, Lars T. Kyllingstad wrote:I don't know, I just remember there was a discussion about it -- probably on the Phobos mailing list. Or it could be my own opinion seeping through, you never know. ;) The thing is, the C stdlib is needed in druntime, therefore the headers need to be in druntime. And it's pointless to have them in two places, therefore they should be removed from Phobos. (std.c could arguably be kept for non-standard functions.) In D1, the runtime and the standard library weren't separated, and it thus made sense to have the C headers in std as well.On Fri, 05 Nov 2010 09:47:37 +0000, div0 wrote:Since when?On 05/11/2010 09:32, spir wrote:In D2 it is generally preferable to import core.stdc.* to get at the C stuff. std.c.* is a relic from D1, and it is uncertain what will be kept in the library. In this case, import core.stdc.stdlib to gain access to exit(int) and abort(). -LarsHello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking for, as (1) the compiler protests if there is unreachable code (2) it throws in non-release mode. I just want the program to stop, basta! My use case is first debugging (avoid later debug output to be written on terminal).] Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.comimport std.c.process then you've exit(int)& abort() You can get access to most C library functions through std.c.*, so it's always worth a quick check in there for lower level stuff.That's not mentioned anywhere in the phobos docs and none of the core.* modules are even listed.No, and I agree they should at least be listed. -Lars
Nov 07 2010
On 07/11/2010 10:42, Lars T. Kyllingstad wrote:On Fri, 05 Nov 2010 15:09:05 +0000, div0 wrote:OIC, that makes sense. I guess people should be discourged from using the C bits anyway; there ought to be better D versions of everyting in the C standard lib. -- My enormous talent is exceeded only by my outrageous laziness. http://www.ssTk.co.ukOn 05/11/2010 10:14, Lars T. Kyllingstad wrote:I don't know, I just remember there was a discussion about it -- probably on the Phobos mailing list. Or it could be my own opinion seeping through, you never know. ;) The thing is, the C stdlib is needed in druntime, therefore the headers need to be in druntime. And it's pointless to have them in two places, therefore they should be removed from Phobos. (std.c could arguably be kept for non-standard functions.) In D1, the runtime and the standard library weren't separated, and it thus made sense to have the C headers in std as well.On Fri, 05 Nov 2010 09:47:37 +0000, div0 wrote:Since when?On 05/11/2010 09:32, spir wrote:In D2 it is generally preferable to import core.stdc.* to get at the C stuff. std.c.* is a relic from D1, and it is uncertain what will be kept in the library. In this case, import core.stdc.stdlib to gain access to exit(int) and abort(). -LarsHello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking for, as (1) the compiler protests if there is unreachable code (2) it throws in non-release mode. I just want the program to stop, basta! My use case is first debugging (avoid later debug output to be written on terminal).] Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.comimport std.c.process then you've exit(int)& abort() You can get access to most C library functions through std.c.*, so it's always worth a quick check in there for lower level stuff.
Nov 07 2010
On Sun, 07 Nov 2010 11:00:04 +0000 div0 <div0 sourceforge.net> wrote:OIC, that makes sense. I guess people should be discourged from using=20 the C bits anyway; there ought to be better D versions of everyting in=20 the C standard lib.That make sense; or at least have the ones that need no improvement transpa= rently accessed via symbols defined the D stdlib. Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com
Nov 07 2010
On Fri, 05 Nov 2010 09:47:37 +0000 div0 <div0 sourceforge.net> wrote:On 05/11/2010 09:32, spir wrote:struction like exit, quit, end, halt, stop...Hello, Is there a way for a program to simply exit before end of main()? An in=if there is unreachable code (2) it throws in non-release mode. I just wan= t the program to stop, basta! My use case is first debugging (avoid later d= ebug output to be written on terminal).][assert(false) is not why I'm looking for, as (1) the compiler protests=Thank you, that's what I was looking for. I don't know much about C libs. For me, such functionality belongs to plain= D libs, as not only people translating or interfacing with C code need it,= I guess. Thanks also to Lars for the precision about core.stdc... But I ca= nnot find its doc online. Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.comDenis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com=20 import std.c.process =20 then you've exit(int) & abort() =20 You can get access to most C library functions through std.c.*, so it's always worth a quick check in there for lower level stuff. =20
Nov 05 2010
On Fri, 05 Nov 2010 13:20:12 +0100, spir wrote:On Fri, 05 Nov 2010 09:47:37 +0000 div0 <div0 sourceforge.net> wrote:core.stdc.* contains the entire C standard library, for which there are plenty of references online. I guess people felt it a waste of time to write another one. :) Here's one, for instance: http://www.utas.edu.au/infosys/info/documentation/C/CStdLib.html (Each .h file corresponds to a module in core.stdc.) But I agree with you -- at the very least the function signatures should be listed in the D documentation, so it's easier to get the types right. Until that happens, you can look at them here: http://www.dsource.org/projects/druntime/browser/trunk/src/core/stdc -LarsOn 05/11/2010 09:32, spir wrote:Thank you, that's what I was looking for. I don't know much about C libs. For me, such functionality belongs to plain D libs, as not only people translating or interfacing with C code need it, I guess. Thanks also to Lars for the precision about core.stdc... But I cannot find its doc online.Hello, Is there a way for a program to simply exit before end of main()? An instruction like exit, quit, end, halt, stop... [assert(false) is not why I'm looking for, as (1) the compiler protests if there is unreachable code (2) it throws in non-release mode. I just want the program to stop, basta! My use case is first debugging (avoid later debug output to be written on terminal).] Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.comimport std.c.process then you've exit(int) & abort() You can get access to most C library functions through std.c.*, so it's always worth a quick check in there for lower level stuff.
Nov 05 2010