Re: undefined identifier getch()

2010-12-08 Thread Christopher Nicholson-Sauls
On 12/08/10 08:53, Stewart Gordon wrote: > On 08/12/2010 11:06, Nrgyzer wrote: >> Hey guys, >> >> I'm writing a console based tool for windows. To receive the users >> input, I >> try to use getch() but the compiler always says "Error: undefined >> identifier >> getch". When I use getchar() it comp

Re: A CTFE Segfault (with explanation, but I'm not sure what the fix

2010-12-08 Thread Gareth Charnock
On 21/11/10 22:39, bearophile wrote: Gareth Charnock: struct LeafType { string Compile_not_ovloaded() { return "expression"; } }; Note that D structs don't require the ending semicolon, so in practice it is not used. And in D method names start with a lower ca

Re: use of Class Invariants

2010-12-08 Thread Trass3r
That is what I am missing, a stack trace. How do I see a stack trace? dmd1(win) Well tango includes stack traces if you import the right module. For D2/Win use http://3d.benjamin-thaut.de/?p=15

Re: use of Class Invariants

2010-12-08 Thread Jesse Phillips
%u Wrote: > That is what I am missing, a stack trace. > How do I see a stack trace? dmd1(win) I don't think the Windows stack trace is compete yet. Works in Linux.

Re: use of Class Invariants

2010-12-08 Thread %u
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article > On Wednesday 08 December 2010 00:22:23 %u wrote: > > At the moment most of my public member functions are littered with these > > kind of in-out clauses. > > > > in{ > > assert(wellformed, toString); > > } > > out{ > > assert(well

Re: undefined identifier getch()

2010-12-08 Thread Stewart Gordon
On 08/12/2010 13:25, Nrgyzer wrote: Okay, but what function can I use to get the pressed key? kbhit/_kbhit seems to do what I want, but hwo can I use it in D? I always get the error, that kbhit (or similar functions) are not available. kbhit just tests whether there's a keystroke waiting in th

Re: undefined identifier getch()

2010-12-08 Thread Stewart Gordon
On 08/12/2010 11:06, Nrgyzer wrote: Hey guys, I'm writing a console based tool for windows. To receive the users input, I try to use getch() but the compiler always says "Error: undefined identifier getch". When I use getchar() it compiles successfully, but getchar() doesn't returns after a sing

Re: undefined identifier getch()

2010-12-08 Thread Nrgyzer
Great, thanks :)

Re: undefined identifier getch()

2010-12-08 Thread Steven Schveighoffer
On Wed, 08 Dec 2010 08:57:40 -0500, Steven Schveighoffer wrote: extern(C) int kbhit(void); Um... sorry, D doesn't support void args (copy-paste problem): extern(C) int kbhit(); -Steve

Re: undefined identifier getch()

2010-12-08 Thread Steven Schveighoffer
On Wed, 08 Dec 2010 08:25:38 -0500, Nrgyzer wrote: Okay, but what function can I use to get the pressed key? kbhit/_kbhit seems to do what I want, but hwo can I use it in D? I always get the error, that kbhit (or similar functions) are not available. import std.stdio; import std.c.stdlib; impo

Re: undefined identifier getch()

2010-12-08 Thread Nrgyzer
Okay, but what function can I use to get the pressed key? kbhit/_kbhit seems to do what I want, but hwo can I use it in D? I always get the error, that kbhit (or similar functions) are not available. import std.stdio; import std.c.stdlib; import std.c.windows.windows; void main(string[] args) {

Re: undefined identifier getch()

2010-12-08 Thread Steven Schveighoffer
On Wed, 08 Dec 2010 06:06:18 -0500, Nrgyzer wrote: Hey guys, I'm writing a console based tool for windows. To receive the users input, I try to use getch() but the compiler always says "Error: undefined identifier getch". When I use getchar() it compiles successfully, but getchar() doesn

Re: use of Class Invariants

2010-12-08 Thread Jonathan M Davis
On Wednesday 08 December 2010 00:22:23 %u wrote: > At the moment most of my public member functions are littered with these > kind of in-out clauses. > > in{ > assert(wellformed, toString); > } > out{ > assert(wellformed, toString); > } > > They just beg for invariants, I though.. > But invar

undefined identifier getch()

2010-12-08 Thread Nrgyzer
Hey guys, I'm writing a console based tool for windows. To receive the users input, I try to use getch() but the compiler always says "Error: undefined identifier getch". When I use getchar() it compiles successfully, but getchar() doesn't returns after a single input. Is there any equivalent ver

use of Class Invariants

2010-12-08 Thread %u
At the moment most of my public member functions are littered with these kind of in-out clauses. in{ assert(wellformed, toString); } out{ assert(wellformed, toString); } They just beg for invariants, I though.. But invariants don't report the location of failure of contract, only the location

Re: C Bitfields in D

2010-12-08 Thread BLS
On 08/12/2010 02:23, Simen kjaeraas wrote: Andrej Mitrovic wrote: Cool! But, when is "ctod.exe" coming out? :p That should have been "cpptod". ;) As soon as you write it. See d.announce SWIG for D :)