Re: problem while updating to 2.052

2011-02-20 Thread novice2
Jonathan M Davis, thank you for explanation, but i am on windows :(

Re: problem while updating to 2.052

2011-02-20 Thread Jonathan M Davis
On Sunday 20 February 2011 22:11:13 novice2 wrote: > Christian Köstlin Wrote: > > unfortunately not ... I looked several minutes at the stacktrace (would > > i am sorry for offtopic, but > how you produce stacktrace? sometime i very want to see it... 1. It doesn't work on Windows yet, I don't bel

Re: wstring format

2011-02-20 Thread Jonathan M Davis
On Sunday 20 February 2011 21:26:05 Bekenn wrote: > Is there a wstring version of string.format? I can't seem to find it > anywhere... There probably isn't one. A lot of functions are string-only and do not work with char[], wchar[], dchar[], wstring, or dstring. That may or may not change in t

Re: problem while updating to 2.052

2011-02-20 Thread novice2
Christian Köstlin Wrote: > unfortunately not ... I looked several minutes at the stacktrace (would i am sorry for offtopic, but how you produce stacktrace? sometime i very want to see it...

wstring format

2011-02-20 Thread Bekenn
Is there a wstring version of string.format? I can't seem to find it anywhere...

Re: foreach over string enum

2011-02-20 Thread Daniel Murphy
"Jesse Phillips" wrote in message news:ij2drt$1mq3$1...@digitalmars.com... > > Magic. > > No really, the best I can tell is that the compiler will try to run the > foreach loop at compile-time if there is something in the body that must > be evaluated at compile time. > Actually this happens b

Re: Are function pointers compile time constants?

2011-02-20 Thread Steven Schveighoffer
On Sun, 20 Feb 2011 16:23:14 -0500, Nick Sabalausky wrote: "Simon" wrote in message news:ijrdif$1nn6$1...@digitalmars.com... On 20/02/2011 14:59, d coder wrote: Greetings I tried to initialize a struct member with a function pointer, and found that DMD2 did not like it. Are not function poi

Re: Is std.array.replace supposed to work with char[]?

2011-02-20 Thread Steven Schveighoffer
On Sun, 20 Feb 2011 17:10:28 -0500, Jacob Carlborg wrote: On 2011-02-20 21:30, Steven Schveighoffer wrote: On Sun, 20 Feb 2011 13:40:08 -0500, Jacob Carlborg wrote: I'm confused about how someone can implement a library like this. Every time I try to use D2 it's just a PITA to use. I've u

Re: Is std.array.replace supposed to work with char[]?

2011-02-20 Thread bearophile
http://d.puremagic.com/issues/show_bug.cgi?id=5630

Re: Is std.array.replace supposed to work with char[]?

2011-02-20 Thread bearophile
Steven Schveighoffer: > Just a blind guess, I have not tested, but maybe it's because the compiler > is using const(char) as the return type for your delegate literal since > you never specify one? Right, this works: import std.stdio, std.random, std.string, std.algorithm, std.range; void ma

regex.d(339): *+? not allowed in atom

2011-02-20 Thread Jacob Carlborg
I'm using the regex module in Phobos and getting the following runtime exception: regex.d(339): *+? not allowed in atom What does that mean and what's an "atom" in this case? I'm using DMD 2.052 on Mac OS X. -- /Jacob Carlborg

Re: Is std.array.replace supposed to work with char[]?

2011-02-20 Thread Jacob Carlborg
On 2011-02-20 21:30, Steven Schveighoffer wrote: On Sun, 20 Feb 2011 13:40:08 -0500, Jacob Carlborg wrote: I'm confused about how someone can implement a library like this. Every time I try to use D2 it's just a PITA to use. I've used D1 and Tango for several years and had no problem with th

Re: rdmd problems (OS X Leopard, DMD 2.052)

2011-02-20 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:ijs1vp$3b3$1...@digitalmars.com... > "Magnus Lie Hetland" wrote in message > news:ijrm9q$259n$1...@digitalmars.com... >> On 2011-02-19 22:25:31 +0100, Nick Sabalausky said: >> >> [snip] >>> Unfortunately, rdmd doesn't seem to have gotten much attention la

Re: rdmd problems (OS X Leopard, DMD 2.052)

2011-02-20 Thread Nick Sabalausky
"Magnus Lie Hetland" wrote in message news:ijrm9q$259n$1...@digitalmars.com... > On 2011-02-19 22:25:31 +0100, Nick Sabalausky said: > > [snip] >> Unfortunately, rdmd doesn't seem to have gotten much attention lately. >> I've had a few patches for it sitting in bugzilla for a number of months.

Re: Are function pointers compile time constants?

2011-02-20 Thread Nick Sabalausky
"Simon" wrote in message news:ijrdif$1nn6$1...@digitalmars.com... > On 20/02/2011 14:59, d coder wrote: >> Greetings >> >> I tried to initialize a struct member with a function pointer, and >> found that DMD2 did not like it. Are not function pointers compile >> time constants? And why they shoul

Re: foreach: rvalue aggregate expression not finalized!

2011-02-20 Thread Dmitry Olshansky
On 20.02.2011 23:34, Martin Kinkelin wrote: Hi again, I just came across something odd - if the aggregate expression in a foreach statement constructs a new struct (returning an rvalue), it isn't finalized (well, to be precise, its implicit copy isn't). Test: -- import std.stdio; struc

Re: GC: finalization order?!

2011-02-20 Thread Martin Kinkelin
Hehe, thx for deflating and pointing in the right direction.

foreach: rvalue aggregate expression not finalized!

2011-02-20 Thread Martin Kinkelin
Hi again, I just came across something odd - if the aggregate expression in a foreach statement constructs a new struct (returning an rvalue), it isn't finalized (well, to be precise, its implicit copy isn't). Test: -- import std.stdio; struct A { int[3] _data; string _name;

Re: Is std.array.replace supposed to work with char[]?

2011-02-20 Thread Steven Schveighoffer
On Sun, 20 Feb 2011 13:40:08 -0500, Jacob Carlborg wrote: I'm confused about how someone can implement a library like this. Every time I try to use D2 it's just a PITA to use. I've used D1 and Tango for several years and had no problem with that. Strings are a sore spot for me, I think

Re: Is std.array.replace supposed to work with char[]?

2011-02-20 Thread Steven Schveighoffer
On Sun, 20 Feb 2011 14:51:10 -0500, bearophile wrote: Jacob Carlborg: Every time I try to use D2 it's just a PITA to use. I've used D1 and Tango for several years and had no problem with that. I use this thread to ask regarding one specific little problem I have with strings. I want t

Re: Is std.array.replace supposed to work with char[]?

2011-02-20 Thread bearophile
Jacob Carlborg: > Every time I try to use D2 it's just a PITA to use. I've used D1 and Tango > for > several years and had no problem with that. I use this thread to ask regarding one specific little problem I have with strings. I want to generate a random string of AB using the array, map, et

Re: Is std.array.replace supposed to work with char[]?

2011-02-20 Thread Jacob Carlborg
On 2011-02-20 17:12, Steven Schveighoffer wrote: On Sun, 20 Feb 2011 09:45:36 -0500, Jacob Carlborg wrote: On 2011-02-19 23:20, Steven Schveighoffer wrote: On Sat, 19 Feb 2011 16:23:12 -0500, Jacob Carlborg wrote: Compiling the following code with DMD 2.052 on Mac OS X: import std.array;

Re: rdmd problems (OS X Leopard, DMD 2.052)

2011-02-20 Thread Magnus Lie Hetland
On 2011-02-19 22:25:31 +0100, Nick Sabalausky said: [snip] Unfortunately, rdmd doesn't seem to have gotten much attention lately. I've had a few patches for it sitting in bugzilla for a number of months. (Not that I'm complaning, I realize there's been other priorities.) I see. Kind of surpr

Re: GC: finalization order?!

2011-02-20 Thread Steven Schveighoffer
On Sun, 20 Feb 2011 07:15:06 -0500, Martin Kinkelin wrote: I came to the same conclusion. Even if Parent is a struct, it may get destructed after its Child (e.g., in case the Parent struct is a field of another class). What I did is to use a custom allocator for Child, so that Child instances a

Re: Is std.array.replace supposed to work with char[]?

2011-02-20 Thread Steven Schveighoffer
On Sun, 20 Feb 2011 09:45:36 -0500, Jacob Carlborg wrote: On 2011-02-19 23:20, Steven Schveighoffer wrote: On Sat, 19 Feb 2011 16:23:12 -0500, Jacob Carlborg wrote: Compiling the following code with DMD 2.052 on Mac OS X: import std.array; void main () { char[] a; char[] b; a.replace(1, 3

Re: Are function pointers compile time constants?

2011-02-20 Thread d coder
Thanks Simon.

Re: Are function pointers compile time constants?

2011-02-20 Thread Simon
On 20/02/2011 14:59, d coder wrote: Greetings I tried to initialize a struct member with a function pointer, and found that DMD2 did not like it. Are not function pointers compile time constants? And why they should not be? Regards - Cherry No a function doesn't have an address until the .exe

Are function pointers compile time constants?

2011-02-20 Thread d coder
Greetings I tried to initialize a struct member with a function pointer, and found that DMD2 did not like it. Are not function pointers compile time constants? And why they should not be? Regards - Cherry

Re: Read non-UTF8 file

2011-02-20 Thread Nrgyzer
== Auszug aus spir (denis.s...@gmail.com)'s Artikel > On 02/19/2011 02:42 PM, Nrgyzer wrote: > > == Auszug aus Stewart Gordon (smjg_1...@yahoo.com)'s Artikel > >> On 13/02/2011 21:49, Nrgyzer wrote: > >> > >>> It compiles and works as long as the returned char-array/string of f.readLine() doesn't

Re: Is std.array.replace supposed to work with char[]?

2011-02-20 Thread Jacob Carlborg
On 2011-02-19 23:20, Steven Schveighoffer wrote: On Sat, 19 Feb 2011 16:23:12 -0500, Jacob Carlborg wrote: Compiling the following code with DMD 2.052 on Mac OS X: import std.array; void main () { char[] a; char[] b; a.replace(1, 3, b); } Results in the following error: test.d(7): Error: t

Re: shared/unshared classes

2011-02-20 Thread Jonathan M Davis
On Sunday 20 February 2011 05:36:25 spir wrote: > On 02/20/2011 04:41 AM, Jonathan M Davis wrote: > > On Saturday 19 February 2011 19:12:17 Jonathan M Davis wrote: > >> On Saturday 19 February 2011 19:01:16 Steven Schveighoffer wrote: > >>> On Sat, 19 Feb 2011 21:55:53 -0500, Jonathan M Davis > >>>

Re: shared/unshared classes

2011-02-20 Thread spir
On 02/20/2011 04:41 AM, Jonathan M Davis wrote: On Saturday 19 February 2011 19:12:17 Jonathan M Davis wrote: On Saturday 19 February 2011 19:01:16 Steven Schveighoffer wrote: On Sat, 19 Feb 2011 21:55:53 -0500, Jonathan M Davis wrote: On Saturday 19 February 2011 18:26:25 Steven Schveighoff

Re: GC: finalization order?!

2011-02-20 Thread Jonathan M Davis
On Sunday 20 February 2011 04:10:18 Simen kjaeraas wrote: > Jonathan M Davis wrote: > > Yes. You're right. They can reference the non-GC heap just fine. It's > > just that > > they can't reference the GC heap - probably because the destructor order > > is > > indeterminate and so that the GC doesn

Re: GC: finalization order?!

2011-02-20 Thread Martin Kinkelin
I came to the same conclusion. Even if Parent is a struct, it may get destructed after its Child (e.g., in case the Parent struct is a field of another class). What I did is to use a custom allocator for Child, so that Child instances are not managed by the GC: -- import std.stdio; import

Re: GC: finalization order?!

2011-02-20 Thread Simen kjaeraas
Jonathan M Davis wrote: Yes. You're right. They can reference the non-GC heap just fine. It's just that they can't reference the GC heap - probably because the destructor order is indeterminate and so that the GC doesn't have to worry about dealing with circular references between garbage c

Re: shared/unshared classes

2011-02-20 Thread Johannes Pfau
Steven Schveighoffer wrote: >On Sat, 19 Feb 2011 21:55:53 -0500, Jonathan M Davis > wrote: > >> On Saturday 19 February 2011 18:26:25 Steven Schveighoffer wrote: >>> I was working on an I/O library that I plan to use in development, >>> and possibly submit to phobos, and I thought of this case. >>>

Re: Error when exiting program

2011-02-20 Thread Joel Christensen
On 19-Feb-11 6:53 PM, Jesse Phillips wrote: Joel Christensen Wrote: I'm using some one else's bindings to a C library. The problem seems to be limited to D2 programs. Error as follows: An exception was thrown while finalizing an instance of class jec2.bmp.Bmp I also get other errors at progr