Re: Linker errors after updating to DMD 2.060

2012-08-13 Thread Bernard Helyer
Make sure you completely wipe out your old installation. Several modules were _removed_ that may be still hanging around. On top of that, ensure that you're not linking any object files from 2.059 with new object files from 2.060 (i.e. do a complete rebuild).

Re: float.nan is not itself ?

2012-02-14 Thread Bernard Helyer
On Tuesday, 14 February 2012 at 15:39:37 UTC, Joshua Reusch wrote: Hello, why does this assertion fail: > assert(float.nan == float.nan); there is the std.math.isNaN function which works correctly, but why can I not just use the comparison ? Thanks, Joshua Use `float.nan is float.nan`; al

Re: xml Bible for conversion for D

2011-10-19 Thread Bernard Helyer
On Wed, 19 Oct 2011 21:45:29 +1300, Joel Christensen wrote: > I don't care to learn xml at this stage. What do you mean by "learn xml"? I'm saying std.xml is a terrible library, and furthermore will be deprecated sooner or later. Use another library. There is already a suggestion in this threa

Re: xml Bible for conversion for D

2011-10-19 Thread Bernard Helyer
On Wed, 19 Oct 2011 07:04:53 +, Bernard Helyer wrote: > meen Just not my day, is it?

Re: xml Bible for conversion for D

2011-10-19 Thread Bernard Helyer
On Wed, 19 Oct 2011 07:03:05 +, Bernard Helyer wrote: > and the power of Satan* Err, I can see how that could be construed as in poor taste, considering the subject matter of the XML document. I meen no offense. >_<

Re: xml Bible for conversion for D

2011-10-19 Thread Bernard Helyer
On Wed, 19 Oct 2011 18:21:22 +1300, Joel Christensen wrote: > I think I want to stick with the current std xml library for now. No, you don't. It's a terrible library, held together by lashings of hate and the power of Satan* *only half kidding

Re: clear bug?

2011-09-05 Thread Bernard Helyer
clear() nulls out the vtable.

Re: DMD Backend: Deciding instructions to use/avoid?

2011-06-04 Thread Bernard Helyer
If you run the program in GDB, can you disassemble when the error is given? That may give you the instruction the kernel is assasinating your process for.

Re: Anyone know why system change directory calls don't work?

2011-05-28 Thread Bernard Helyer
On Sun, 29 May 2011 00:54:10 -0400, Andrej Mitrovic wrote: > E.g.: > > import std.process; > system(r"cd C:\newfolder"); // no effect > > It just stays in the same folder as the exe. I can use > SetCurrentDirectoryA as an alternative, but why doesn't it work via the > system call? Because syst

Re: implib

2011-04-13 Thread Bernard Helyer
implib is for working with Windows libraries. Why on earth do you need it on OS X?

Re: Else clauses for loops

2011-04-13 Thread Bernard Helyer
You could wrap the loop in an if clause: if (condition) while (true) { // ... } else { // ... }

Re: Input handling? (newbie alert!)

2010-09-09 Thread Bernard Helyer
On Thu, 09 Sep 2010 18:07:43 -0700, Jonathan M Davis wrote: > Yes std.stdio.readln() would be a much better way to go. However, I'd > suggest using std.conv.parse() rather than std.conv.to(). It's less > picky about whitespace, and it allows you to deal with the case where > you have multiple value

Re: Input handling? (newbie alert!)

2010-09-09 Thread Bernard Helyer
I've not time for a more full answer now (I'll try later), but please, for the love of God, don't use scanf! As a general hint, use std.stdio.readln to get input as a string, then use the `to` function found in std.conv to convert it into what you want: auto input = readln(); auto asInteg

Re: Cannot initialize associative array.

2010-06-23 Thread Bernard Helyer
On Wed, 23 Jun 2010 00:41:45 -0700, Ali Çehreli wrote: > Ali Çehreli wrote: >> dcoder wrote: >> >> > So, I moved the initialization to inside the main function, and now >> it works. >> > Great. I think we need to put this question in the FAQ. >> >> For future reference, if it really needs to

Re: Cannot initialize associative array.

2010-06-22 Thread Bernard Helyer
On Tue, 22 Jun 2010 21:32:48 +, dcoder wrote: > Sorry, I forgot to put some compiler output: > > For the declaration: uint[string] mywords = [ "Hello" : 1, "World" : 1, > "Cat" : 1, "Dog" : 1 ]; > > > I get: > > $ dmd test_01.d > test_01.d(3): Error: non-constant expression > ["Hello":1u,"

Re: segfaults

2010-05-03 Thread Bernard Helyer
On 04/05/10 09:49, Steven Schveighoffer wrote: On Mon, 03 May 2010 17:25:30 -0400, Bernard Helyer wrote: I believe his problem is that the return code of the caller indicates success. Could it be perhaps that it can't possibly get at that status? Remember, system runs /bin/sh -c, so al

Re: segfaults

2010-05-03 Thread Bernard Helyer
On 04/05/10 08:57, Lars T. Kyllingstad wrote: On Mon, 03 May 2010 15:54:28 -0500, Ellery Newcomer wrote: Hello. I'm trying to invoke a command inside d, and it returns a success code when the command in question segfaults. any ideas? // the caller import std.process; int main(){ auto

Re: Passing dynamic arrays into C.

2010-04-25 Thread Bernard Helyer
Guilty on all charges. Confused the behaviour of static and dynamic arrays with sizeof. On 25/04/10 21:54, bearophile wrote: Bernard Helyer: glBufferData(GL_ARRAY_BUFFER, vertices.sizeof, vertices.ptr, GL_STATIC_DRAW); glVertexPointer(2, GL_FLOAT

Re: Passing dynamic arrays into C.

2010-04-25 Thread Bernard Helyer
ves 4 int.sizeof // gives 4 int[].sizeof // gives 8 int[3].sizeof // gives 12 class C { int[100] d; }; C.sizeof // gives the size of the reference, not the instance. I haven't checked the sizes, but it generally follows something like that. "Bernard Helyer" wrote in mes

Passing dynamic arrays into C.

2010-04-25 Thread Bernard Helyer
I was having a problem interfacing with OpenGL from D, as demonstrated by this program, written once in D, and again in C: http://gist.github.com/378273 Now the 'gist' of it is, doing things like this (D): glBufferData(GL_ARRAY_BUFFER, vertices.sizeof, vertices.ptr, GL_STA

Re: segfaults

2010-02-23 Thread Bernard Helyer
On 24/02/10 12:53, Ellery Newcomer wrote: Hey! You're right! import tango.io.Stdout; void main(){ Object obj = null; int[] a; a ~= 1; Stdout(obj.toString()).newline; } gives me Die: DW_TAG_type_unit (abbrev 7, offset 0x6f) parent at offset: 0xb has children: FALSE attributes: DW_AT_byte_size (

Re: segfaults

2010-02-23 Thread Bernard Helyer
On 24/02/10 03:45, Ellery Newcomer wrote: I'm thinking it's an issue with DMD. I can get backtraces with simple programs. If you use a dynamic array in there somewhere, the chances of it not working go up, I'm afraid. This doesn't leave many programs that *work*.

Re: segfaults

2010-02-22 Thread Bernard Helyer
On 23/02/10 15:14, Ellery Newcomer wrote: Is there any decent way to figure out where segfaults are coming from? e.g. 200k lines of bad code converted from java I tried gdb, and it didn't seem to work too well. Die: DW_TAG_type_unit (abbrev 3, offset 0x6d) parent at offset: 0xb has children: F

Re: TLS definition in curses.o section .tbss mismatches non-TLS reference in /usr/lib/libncurses.a(lib_initscr.o)

2009-12-10 Thread Bernard Helyer
On 11/12/09 10:48, Gareth Charnock wrote: Is there any way to tell dmd to just share them between threads? __gshared type whatever;