Re: virtual destructor in C++ integration: bug or me being stupid?

2015-12-30 Thread Atila Neves via Digitalmars-d-learn
On Tuesday, 29 December 2015 at 18:41:41 UTC, Adam D. Ruppe wrote: On Tuesday, 29 December 2015 at 18:32:23 UTC, Atila Neves wrote: The problem here is that I don't know what the workaround is. The one I used (well, last time I tried this) was to just put a dummy function in the D interface

virtual destructor in C++ integration: bug or me being stupid?

2015-12-29 Thread Atila Neves via Digitalmars-d-learn
cpp.cpp: class Oops { public: virtual ~Oops() {} virtual int number() const { return 42; } }; Oops* newOops() { return new Oops; } d.d: import std.stdio; extern(C++) { interface Oops { int number() const; } Oops newOops(); } void main() { auto oops =

Re: virtual destructor in C++ integration: bug or me being stupid?

2015-12-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 29 December 2015 at 18:32:23 UTC, Atila Neves wrote: The problem here is that I don't know what the workaround is. The one I used (well, last time I tried this) was to just put a dummy function in the D interface that is a placeholder for it. interface C++Class { // at the

Re: DMD -L Flag, maybe a bug?

2015-12-26 Thread anonymous via Digitalmars-d-learn
On 26.12.2015 02:04, Bubbasaur wrote: On Friday, 25 December 2015 at 23:45:42 UTC, anonymous wrote: It's almost like the example in the URL you showed: dmd test.d -LC:/gtkd/src/build/GtkD.lib Note that in the docs I linked it's `dmd hello.d -L+gtkd.lib` with a plus sign. I'm not sure if it's

Re: DMD -L Flag, maybe a bug?

2015-12-26 Thread Bubbasaur via Digitalmars-d-learn
On Saturday, 26 December 2015 at 11:19:27 UTC, anonymous wrote: ... Note that in the docs I linked it's `dmd hello.d -L+gtkd.lib` with a plus sign. I'm not sure if it's significant, but it's a difference. There are two ways in the doc you linked: dmd hello.d -L+gtkd.lib or dmd hello.d

Re: DMD -L Flag, maybe a bug?

2015-12-26 Thread Bubbasaur via Digitalmars-d-learn
On Saturday, 26 December 2015 at 11:53:55 UTC, Ivan Kazmenko wrote: Note that -L passes flags (options) but not necessarily arguments or paths. For example, I use "dmd -L/STACK:268435456" by default along with other options to increase the default stack size to 256Mb. Your comment is

Re: DMD -L Flag, maybe a bug?

2015-12-26 Thread Ivan Kazmenko via Digitalmars-d-learn
On Saturday, 26 December 2015 at 01:04:57 UTC, Bubbasaur wrote: It's almost like the example in the URL you showed: dmd test.d -LC:/gtkd/src/build/GtkD.lib Note that -L passes flags (options) but not necessarily arguments or paths. For example, I use "dmd -L/STACK:268435456" by default

DMD -L Flag, maybe a bug?

2015-12-25 Thread Bubbasaur via Digitalmars-d-learn
ot;-I" flag you don't need any space. It took me 30 minutes until I find why my program wasn't compiling. (I found the tip on a forum elsewhere). Is this a bug or a mistake? Bubba.

Re: DMD -L Flag, maybe a bug?

2015-12-25 Thread Bubbasaur via Digitalmars-d-learn
On Friday, 25 December 2015 at 15:06:27 UTC, anonymous wrote: ... You can try removing the "-L" entirely. If it still works... In fact it works without the "-L". Which makes me wonder if I was using it wrongly? What exactly are trying to pass to the linker? A lib: GtkD. Can you give a

Re: DMD -L Flag, maybe a bug?

2015-12-25 Thread anonymous via Digitalmars-d-learn
On 25.12.2015 15:40, Bubbasaur wrote: But at least on Windows, you need to put a space between -L and the PATH. Which It's weird, since with "-I" flag you don't need any space. I don't think that's right. Unless something awful is going in Windows dmd, that should be processed as two separate

Re: DMD -L Flag, maybe a bug?

2015-12-25 Thread anonymous via Digitalmars-d-learn
On 25.12.2015 19:32, Bubbasaur wrote: On Friday, 25 December 2015 at 15:06:27 UTC, anonymous wrote: In fact it works without the "-L". Which makes me wonder if I was using it wrongly? I'm convinced that putting a space between "-L" and its argument is nonsense. The "-L" part just means "pass

Re: DMD -L Flag, maybe a bug?

2015-12-25 Thread Bubbasaur via Digitalmars-d-learn
On Friday, 25 December 2015 at 23:45:42 UTC, anonymous wrote: ... That means a .lib file, right? Yes. The GtkD docs say to use -L though [2], so I suppose that should work too. Maybe show your exact complete command line, if you want to find out why it doesn't work for you. It's almost

Re: AA struct hashing bug?

2015-12-09 Thread ketmar via Digitalmars-d-learn
heh. it crashed due to "in" presence. if you'll remove "in", it will work.

Re: AA struct hashing bug?

2015-12-08 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 11:45:25 UTC, Random D user wrote: Ok. This is minimal app that crashes for me. If someone could try this: At the very least, there is no crash when changing `struct Foo` to `static struct Foo`, so it is perhaps related to `Foo` being an inner struct with a

Re: AA struct hashing bug?

2015-12-08 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 11:45:25 UTC, Random D user wrote: Ok. This is minimal app that crashes for me. If someone could try this: OK, this at least reproducibly crashes here, too (-m32 and -m64 on Windows, tried dmd 2.069.0 and 2.067.1).

Re: AA struct hashing bug?

2015-12-08 Thread Random D user via Digitalmars-d-learn
{ struct Foo { this( int k ) { a = k; } int a; } Foo foo; int[ Foo ] map; map[ foo ] = 1; // Crash! bug? } } int main( char[][] args ) { App a = new App; a.crash( 1

Re: AA struct hashing bug?

2015-12-08 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 11:45:25 UTC, Random D user wrote: Ok. This is minimal app that crashes for me. If someone could try this: Interesting. With dmd 2.064.2, your example compiles and runs fine. With dmd 2.065.0, it does not compile, complaining that there is no opCmp for `Foo`s.

Re: AA struct hashing bug?

2015-12-08 Thread Random D user via Digitalmars-d-learn
it might be my bug or that the runtime somehow corrupts it's state. Scary. So I have an App class that gets created in main. Basically App = new App App.start(); If I put that code as the first thing in the constructor everything works. If I put that code as the first thing in the first method

Re: AA struct hashing bug?

2015-12-08 Thread Ivan Kazmenko via Digitalmars-d-learn
on Windows. Works for me, too. I tried this again. And it seems it might be my bug or that the runtime somehow corrupts it's state. Scary. So I have an App class that gets created in main. Basically App = new App App.start(); If I put that code as the first thing in the constructor

Re: The @@@BUG@@@ the size of China - std.conv.d - Target parse(Target, Source)(ref Source s, uint radix)

2015-12-08 Thread John Carter via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 00:40:29 UTC, tsbockman wrote: Someone still needs to review the PR, though. Thanks! Looks like it's been merged already. It was a double problem... I failed to read the bit about advancing the ref and then the old big @@@BUG@@@ comment in the unit test made

AA struct hashing bug?

2015-12-07 Thread Random D user via Digitalmars-d-learn
struct Foo { this( int k ) { a = k; } int a; } Foo foo; int[ Foo ] map; map[ foo ] = 1; // Crash! bug? // This also crashes. I believe crash above makes a call like this (or similar) in the rt. //auto h = typeid( foo ).getHash( ); // Crash! win64 & dmd 2.69.2

The @@@BUG@@@ the size of China - std.conv.d - Target parse(Target, Source)(ref Source s, uint radix)

2015-12-07 Thread John Carter via Digitalmars-d-learn
So whilst attempt to convert from a hex string (without the 0x) to int I bumped into the @@@BUG@@@ the size of China https://github.com/D-Programming-Language/phobos/blob/master/std/conv.d#L2270 Is there a bugzilla issue number tracking this? Searching for conv and parse in the issue

Re: AA struct hashing bug?

2015-12-07 Thread Alex Parrill via Digitalmars-d-learn
On Monday, 7 December 2015 at 18:48:18 UTC, Random D user wrote: struct Foo { this( int k ) { a = k; } int a; } Foo foo; int[ Foo ] map; map[ foo ] = 1; // Crash! bug? // This also crashes. I believe crash above makes a call like this (or similar) in the rt. //auto

Re: The @@@BUG@@@ the size of China - std.conv.d - Target parse(Target, Source)(ref Source s, uint radix)

2015-12-07 Thread anonymous via Digitalmars-d-learn
On 07.12.2015 21:56, John Carter wrote: So whilst attempt to convert from a hex string (without the 0x) to int I bumped into the @@@BUG@@@ the size of China https://github.com/D-Programming-Language/phobos/blob/master/std/conv.d#L2270 Is there a bugzilla issue number tracking

Re: The @@@BUG@@@ the size of China - std.conv.d - Target parse(Target, Source)(ref Source s, uint radix)

2015-12-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/7/15 5:32 PM, anonymous wrote: On 07.12.2015 21:56, John Carter wrote: So whilst attempt to convert from a hex string (without the 0x) to int I bumped into the @@@BUG@@@ the size of China https://github.com/D-Programming-Language/phobos/blob/master/std/conv.d#L2270

Re: AA struct hashing bug?

2015-12-07 Thread ketmar via Digitalmars-d-learn
worksforme. git HEAD, GNU/Linux, x86.

Re: The @@@BUG@@@ the size of China - std.conv.d - Target parse(Target, Source)(ref Source s, uint radix)

2015-12-07 Thread tsbockman via Digitalmars-d-learn
On Monday, 7 December 2015 at 20:56:24 UTC, John Carter wrote: So whilst attempt to convert from a hex string (without the 0x) to int I bumped into the @@@BUG@@@ the size of China https://github.com/D-Programming-Language/phobos/blob/master/std/conv.d#L2270 Is there a bugzilla issue

Re: The @@@BUG@@@ the size of China - std.conv.d - Target parse(Target, Source)(ref Source s, uint radix)

2015-12-07 Thread tsbockman via Digitalmars-d-learn
On Monday, 7 December 2015 at 22:38:03 UTC, Steven Schveighoffer wrote: It's an old bug, if it still exists. But in any case, the description is terrible. A real bug report should be filed. -Steve Filed (https://issues.dlang.org/show_bug.cgi?id=15419) and fixed (https://github.com/D

Re: AA struct hashing bug?

2015-12-07 Thread Ivan Kazmenko via Digitalmars-d-learn
On Monday, 7 December 2015 at 22:03:42 UTC, Alex Parrill wrote: On Monday, 7 December 2015 at 18:48:18 UTC, Random D user wrote: struct Foo { this( int k ) { a = k; } int a; } Foo foo; int[ Foo ] map; map[ foo ] = 1; // Crash! bug? // This also crashes. I believe

Re: Is it a bug?

2015-11-25 Thread Jack Applegame via Digitalmars-d-learn
On Wednesday, 25 November 2015 at 09:31:15 UTC, John Colvin wrote: import std.range; import std.algorithm; import std.utf; void main() { char[64] arr; copy(chain("test1", "test2").byCodeUnit, arr[0..10].byCodeUnit); } I'll use byCodeUnit. Thanks.

Re: Is it a bug?

2015-11-25 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 25 November 2015 at 08:10:03 UTC, Jack Applegame wrote: This doesn't compile: import std.range; import std.algorithm; void main() { char[64] arr; copy(chain("test1", "test2"), arr[0..10]); } http://dpaste.dzfl.pl/24230ac02e6e Essentially this comes down to the

Is it a bug?

2015-11-25 Thread Jack Applegame via Digitalmars-d-learn
This doesn't compile: import std.range; import std.algorithm; void main() { char[64] arr; copy(chain("test1", "test2"), arr[0..10]); } http://dpaste.dzfl.pl/24230ac02e6e

Re: Bug? Bad file name?

2015-11-14 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 14 November 2015 at 05:44:44 UTC, Anonymous wrote: I was playing with some code someone posted on the forum that involved opDispatch and compile time parameters. I pasted it in a file named templOpDispatch.d, ran it, and got an error. Then I noticed if I renamed the file it

Re: Bug? Bad file name?

2015-11-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 14 November 2015 at 05:44:44 UTC, Anonymous wrote: Then running 'rdmd templOpDispatch.d' produces: std.process.ProcessException@std\process.d(568): Failed to spawn new process (The requested operation requires elevation.) This is a Windows quirk. When they introduced UAC in

Bug? Bad file name?

2015-11-13 Thread Anonymous via Digitalmars-d-learn
I was playing with some code someone posted on the forum that involved opDispatch and compile time parameters. I pasted it in a file named templOpDispatch.d, ran it, and got an error. Then I noticed if I renamed the file it worked. The source didn't matter; same thing happens with an empty

Re: std.utf.decode behaves unexpectedly - Bug?

2015-11-07 Thread HeiHon via Digitalmars-d-learn
On Friday, 6 November 2015 at 20:00:43 UTC, BBaz wrote: Sorry, the forum as stripped my answer. Here is the full version: ... Thank you very much for taking the time to explain it!

Maybe a dmd bug, what do you think ?

2015-11-06 Thread user123456789abcABC via Digitalmars-d-learn
Template parameter deduction in partially specialized template fails: --- enum Bar{b,a,r} void foo(Bar bar, T)(T t){} alias foob(T) = foo!(Bar.b, T); void main() { foo!(Bar.b)(8); foob(8); // autsch } --- It looks like a bug, doesn't it ?

Re: Maybe a dmd bug, what do you think ?

2015-11-06 Thread rsw0x via Digitalmars-d-learn
like a bug, doesn't it ? I believe this is https://issues.dlang.org/show_bug.cgi?id=1807

std.utf.decode behaves unexpectedly - Bug?

2015-11-06 Thread HeiHon via Digitalmars-d-learn
Consider this: [code] import std.stdio, std.utf, std.exception; void do_decode(string txt) { try { size_t idx; writeln("decode ", txt); for (size_t i = 0; i < txt.length; i++) { dchar dc = std.utf.decode(txt[i..i+1], idx);

Re: std.utf.decode behaves unexpectedly - Bug?

2015-11-06 Thread BBaz via Digitalmars-d-learn
On Friday, 6 November 2015 at 19:26:50 UTC, HeiHon wrote: Am I using std.utf.decode wrongly or is it buggy? It's obviously used wrongly, try this instead: import std.utf, std.stdio; --- dstring do_decode(string txt) { dstring result; try { size_t idx;

Re: std.utf.decode behaves unexpectedly - Bug?

2015-11-06 Thread HeiHon via Digitalmars-d-learn
Sorry, I mixed up the line numbers from dmd 2.068.2 and dmd 2.069.0. The correct line numbers for dmd 2.069.0 are: Attempted to decode past the end of a string (at index 1) file=D:\dmd2\windows\bin\..\..\src\phobos\std\utf.d line=1281 and core.exception.RangeError@std\utf.d(1278): Range

Re: std.utf.decode behaves unexpectedly - Bug?

2015-11-06 Thread Spacen Jasset via Digitalmars-d-learn
On Friday, 6 November 2015 at 19:26:50 UTC, HeiHon wrote: Consider this: [code] import std.stdio, std.utf, std.exception; void do_decode(string txt) { try { size_t idx; writeln("decode ", txt); for (size_t i = 0; i < txt.length; i++) { dchar

Re: std.utf.decode behaves unexpectedly - Bug?

2015-11-06 Thread BBaz via Digitalmars-d-learn
Sorry, the forum as stripped my answer. Here is the full version: On Friday, 6 November 2015 at 19:26:50 UTC, HeiHon wrote: Am I using std.utf.decode wrongly or is it buggy? It's obviously used wrongly, try this instead: import std.utf, std.stdio; --- dstring do_decode(string txt) {

Re: Bug? 0 is less than -10

2015-10-09 Thread Ozan via Digitalmars-d-learn
On Thursday, 8 October 2015 at 09:01:32 UTC, Dominikus Dittes Scherkl wrote: On Wednesday, 7 October 2015 at 16:25:02 UTC, Marc Schütz wrote: Lionello Lunesu posted a PR that should fix this: https://github.com/D-Programming-Language/dmd/pull/1913 See also the discussion in the linked bug

Re: Bug? 0 is less than -10

2015-10-08 Thread Dominikus Dittes Scherkl via Digitalmars-d-learn
On Wednesday, 7 October 2015 at 16:25:02 UTC, Marc Schütz wrote: Lionello Lunesu posted a PR that should fix this: https://github.com/D-Programming-Language/dmd/pull/1913 See also the discussion in the linked bug report. Unfortunately it seems it's been forgotten since then... Meanwhile I

Re: Bug? 0 is less than -10

2015-10-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/7/15 1:27 AM, Laeeth Isharc wrote: On Wednesday, 7 October 2015 at 02:53:32 UTC, Steven Schveighoffer wrote: On 10/6/15 7:21 PM, Laeeth Isharc wrote: could we have ssize_t defined in phobos somewhere so your code ends up being portable ;) (It's trivial to do, obviously). ptrdiff_t

Re: Bug? 0 is less than -10

2015-10-08 Thread Laeeth Isharc via Digitalmars-d-learn
On Thursday, 8 October 2015 at 13:32:17 UTC, Steven Schveighoffer wrote: On 10/7/15 1:27 AM, Laeeth Isharc wrote: On Wednesday, 7 October 2015 at 02:53:32 UTC, Steven Schveighoffer wrote: On 10/6/15 7:21 PM, Laeeth Isharc wrote: could we have ssize_t defined in phobos somewhere so your code

Re: Bug? 0 is less than -10

2015-10-07 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 7 October 2015 at 05:27:12 UTC, Laeeth Isharc wrote: On Wednesday, 7 October 2015 at 02:53:32 UTC, Steven Schveighoffer wrote: On 10/6/15 7:21 PM, Laeeth Isharc wrote: could we have ssize_t defined in phobos somewhere so your code ends up being portable ;) (It's trivial to do,

Re: Bug? 0 is less than -10

2015-10-07 Thread Laeeth Isharc via Digitalmars-d-learn
On Wednesday, 7 October 2015 at 07:38:44 UTC, Andrea Fontana wrote: On Wednesday, 7 October 2015 at 05:27:12 UTC, Laeeth Isharc wrote: On Wednesday, 7 October 2015 at 02:53:32 UTC, Steven Schveighoffer wrote: On 10/6/15 7:21 PM, Laeeth Isharc wrote: could we have ssize_t defined in phobos

Re: Bug? 0 is less than -10

2015-10-07 Thread Marc Schütz via Digitalmars-d-learn
>= 10)) ); } [/code] [output] 0 true false true [/output] How is it generating "true" for (dec <= -10) ? Is there a special casting or something? DMD 2.068.2, Ubuntu 64-bit Lionello Lunesu posted a PR that should fix this: https://github.com/D-Programming-Language/dmd/pul

Re: Bug? 0 is less than -10

2015-10-06 Thread Laeeth Isharc via Digitalmars-d-learn
On Wednesday, 7 October 2015 at 02:53:32 UTC, Steven Schveighoffer wrote: On 10/6/15 7:21 PM, Laeeth Isharc wrote: could we have ssize_t defined in phobos somewhere so your code ends up being portable ;) (It's trivial to do, obviously). ptrdiff_t -Steve It seems unnatural to use such a

Bug? 0 is less than -10

2015-10-06 Thread tcak via Digitalmars-d-learn
Maybe I am just too stressed out to see the problem. [code] import std.stdio; void main(){ size_t dec = 0; writeln( dec, " ", (dec <= -10), " ", (dec >= 10), " ", ((dec <= -10) || (dec >= 10)) ); } [/code] [output] 0 true false true [/output] How is it generating "true" for (dec

Re: Bug? 0 is less than -10

2015-10-06 Thread anonymous via Digitalmars-d-learn
On Tuesday, 6 October 2015 at 14:46:56 UTC, tcak wrote: Maybe I am just too stressed out to see the problem. [code] import std.stdio; void main(){ size_t dec = 0; writeln( dec, " ", (dec <= -10), " ", (dec >= 10), " ", ((dec <= -10) || (dec >= 10)) ); } [/code] [output] 0 true

Re: Bug? 0 is less than -10

2015-10-06 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 6 October 2015 at 14:46:56 UTC, tcak wrote: void main(){ size_t dec = 0; How is it generating "true" for (dec <= -10) ? Is there a special casting or something? size_t is unsigned, so the -10 is cast to unsigned too for the comparison which yields some huge number.

Re: SysTime bug or feature?

2015-10-06 Thread tchaloupka via Digitalmars-d-learn
due to the bug there) when I tried to print out the passed value and ended up with the segfault. So I guess it doesn't bite devs often as it is mostly used as you wrote.

Re: Bug? 0 is less than -10

2015-10-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/6/15 7:21 PM, Laeeth Isharc wrote: could we have ssize_t defined in phobos somewhere so your code ends up being portable ;) (It's trivial to do, obviously). ptrdiff_t -Steve

Re: Bug? 0 is less than -10

2015-10-06 Thread Laeeth Isharc via Digitalmars-d-learn
On Tuesday, 6 October 2015 at 14:55:23 UTC, Adam D. Ruppe wrote: On Tuesday, 6 October 2015 at 14:46:56 UTC, tcak wrote: void main(){ size_t dec = 0; How is it generating "true" for (dec <= -10) ? Is there a special casting or something? size_t is unsigned, so the -10 is cast to

Re: Bug? 0 is less than -10

2015-10-06 Thread Meta via Digitalmars-d-learn
On Tuesday, 6 October 2015 at 14:46:56 UTC, tcak wrote: Maybe I am just too stressed out to see the problem. [code] import std.stdio; void main(){ size_t dec = 0; writeln( dec, " ", (dec <= -10), " ", (dec >= 10), " ", ((dec <= -10) || (dec >= 10)) ); } [/code] [output] 0 true

SysTime bug or feature?

2015-10-05 Thread tchaloupka via Digitalmars-d-learn
This code: import std.stdio; import std.datetime; void main() { SysTime t = SysTime.init; writeln(t); } results in segfault with dmd-2.068.2 Is it ok? Backtrace: #0 0x004733f3 in std.datetime.SysTime.adjTime() const () #1 0x004730b9 in

Re: SysTime bug or feature?

2015-10-05 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, October 05, 2015 18:12:06 tchaloupka via Digitalmars-d-learn wrote: > This code: > > import std.stdio; > import std.datetime; > > void main() > { > SysTime t = SysTime.init; > writeln(t); > } > > results in segfault with dmd-2.068.2 > > Is it ok? It is by design, albeit

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-18 Thread Kagamin via Digitalmars-d-learn
This compiles with enabled warnings: --- int f() { while(true){} assert(false); } ---

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-18 Thread ddos via Digitalmars-d-learn
thank you :) works now

bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread ddos via Digitalmars-d-learn
http://pastebin.com/fknwgjtz i tried to call fibers in a loop forever, to multiplex some networking client worker fibers and a listener fiber it seems to work correctly with for(int i=0;i<1;) with while(true) i get: C:\dev\server_client>dub Building server_client ~master configuration

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread ddos via Digitalmars-d-learn
using DMD32 D Compiler v2.068.0 on windows x64

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread ddos via Digitalmars-d-learn
On Thursday, 17 September 2015 at 19:43:02 UTC, H. S. Teoh wrote: On Thu, Sep 17, 2015 at 07:32:13PM +, ddos via Digitalmars-d-learn wrote: http://pastebin.com/fknwgjtz i tried to call fibers in a loop forever, to multiplex some networking client worker fibers and a listener fiber it

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Sep 17, 2015 at 07:32:13PM +, ddos via Digitalmars-d-learn wrote: > http://pastebin.com/fknwgjtz > > i tried to call fibers in a loop forever, to multiplex some networking > client worker fibers and a listener fiber > it seems to work correctly with for(int i=0;i<1;) > > with

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 17 September 2015 at 19:32:16 UTC, ddos wrote: source\app.d(72): Warning: statement is not reachable What's there? Anything after an endless loop is potentially unreachable and dub treats warnings as errors. With the for loop, the compiler can't be as sure that it is endless

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread ddos via Digitalmars-d-learn
On Thursday, 17 September 2015 at 19:35:05 UTC, Adam D. Ruppe wrote: What's there? Anything after an endless loop is potentially unreachable and dub treats warnings as errors. i see, thx

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread Timon Gehr via Digitalmars-d-learn
On 09/17/2015 09:47 PM, ddos wrote: yeah i tried for(;;) and it generates the same warning :) sure, here is the full example, it's not too long anyways ( the example doesn't make much sense tho because socket.accept is blocking :P ) http://pastebin.com/9K0wRRD6 ps: pastebin needs D support :-D

Re: bug? for(int i=0;i<1;) vs while(true)

2015-09-17 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 17 September 2015 at 19:47:15 UTC, ddos wrote: yeah i tried for(;;) and it generates the same warning :) sure, here is the full example, it's not too long anyways ( the example doesn't make much sense tho because socket.accept is blocking :P ) http://pastebin.com/9K0wRRD6 Yeah,

Re: Another, is it a bug?

2015-09-16 Thread Meta via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:48:59 UTC, Random D user wrote: Yeah... I guess I was expecting it to overload across class boundaries. I mean there's already a member eat in base class and sub class can't override that since it's got different parameters, and it's a function (can't be

Re: Another, is it a bug?

2015-09-16 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 13:18:51 UTC, Meta wrote: It's the exact same as in Java, and probably C# as well. I don't know if there's any OOP language that overloads methods between the base and super class. https://ideone.com/En5JEc https://ideone.com/aIIrKM No, there's nothing

Re: Another, is it a bug?

2015-09-16 Thread Meta via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 14:08:11 UTC, Kagamin wrote: On Wednesday, 16 September 2015 at 13:18:51 UTC, Meta wrote: It's the exact same as in Java, and probably C# as well. I don't know if there's any OOP language that overloads methods between the base and super class.

Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
eat does not override any function, did you mean to override 'main.Father.eat'? } Daughter d = new Daughter(); // BUG? I expected this to work. It seems that compiler doesn't even look into parent class to see if there's a matching function. //int num = d.eat();// Error: funct

Re: Another, is it a bug?

2015-09-15 Thread Meta via Digitalmars-d-learn
apples ) {} // Workaround D, fails -> Error: function main.Daughter.eat does not override any function, did you mean to override 'main.Father.eat'? } Daughter d = new Daughter(); // BUG? I expected this to work. It seems that compiler doesn't even look into parent class to see if ther

Re: Another, is it a bug?

2015-09-15 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:48:59 UTC, Random D user Given that, normally properties are just overloaded methods in D, it's pretty sad classes break this behavior/convention. The D behavior for overloading is different in general: http://dlang.org/hijack.html It basically never

Re: Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:17:05 UTC, Meta wrote: Considering Father defines the function `int eat()` and Daughter defines the completely different function `int eat(int)`, it doesn't surprise me. You're not using virtual dispatch when you do `return super.eat` or `d.Father.eat()`,

Re: Another, is it a bug?

2015-09-15 Thread Random D user via Digitalmars-d-learn
On Wednesday, 16 September 2015 at 03:54:34 UTC, Adam D. Ruppe wrote: On Wednesday, 16 September 2015 at 03:48:59 UTC, Random D user Given that, normally properties are just overloaded methods in D, it's pretty sad classes break this behavior/convention. The D behavior for overloading is

Re: I guess this is a bug?

2015-09-12 Thread anonymous via Digitalmars-d-learn
On Saturday 12 September 2015 20:28, Random D user wrote: > prints (with option B): > bar: 0.00, 0.00 // BUG?? > baz: 1.00, 2.00 Looks like a bug to me. Please file an issue at https://issues.dlang.org/

Re: I guess this is a bug?

2015-09-12 Thread Random D user via Digitalmars-d-learn
On Saturday, 12 September 2015 at 18:28:02 UTC, Random D user wrote: or is it some obscure feature conflict? [...] Oh... and I'm using win 64-bit and dmd 2.068.1, but this behavior was present earlier than that...

I guess this is a bug?

2015-09-12 Thread Random D user via Digitalmars-d-learn
(with option B): bar: 0.000000, 0.00 // BUG?? baz: 1.00, 2.00 prints (with option A): bar: 1.00, 2.00 baz: 1.00, 2.00 - Luckily the option A works as I expected and is good enough for me...

Is this a bug?

2015-09-11 Thread Rene Zwanenburg via Digitalmars-d-learn
The following fails to compile with an 'cannot deduce function from argument types' error. When using an array of something other than TypeInfo_Class everything works as expected. void main() { import std.algorithm.mutation : remove; TypeInfo_Class[] arr;

Re: Is this a bug?

2015-09-11 Thread anonymous via Digitalmars-d-learn
; { > import std.algorithm.mutation : remove; > > TypeInfo_Class[] arr; > TypeInfo_Class c; > arr = arr.remove!(a => a is c); > } Yes, it's a bug. It should work. The problem is that TypeInfo_Class has a method called "init" which shadows the built

Re: Is this a bug?

2015-09-11 Thread Rene Zwanenburg via Digitalmars-d-learn
as expected. void main() { import std.algorithm.mutation : remove; TypeInfo_Class[] arr; TypeInfo_Class c; arr = arr.remove!(a => a is c); } Yes, it's a bug. It should work. The problem is that TypeInfo_Class has a method called "init" which shad

Re: MmFile : Is this std.mmFile BUG?

2015-09-01 Thread Vladimir Panteleev via Digitalmars-d-learn
On Wednesday, 26 August 2015 at 17:30:29 UTC, Alex Parrill wrote: it shouldn't segfault though. The segfault is because of: https://issues.dlang.org/show_bug.cgi?id=14993 It "should've" been an InvalidMemoryOperationError, which in turn was caused by:

MmFile : Is this std.mmFile BUG?

2015-08-26 Thread Junichi Nakata via Digitalmars-d-learn
, Segmentation Fault: 11 . I don't know whether this code is typical use. Is this Phobos BUG? or BY DESIGN?

Re: MmFile : Is this std.mmFile BUG?

2015-08-26 Thread Alex Parrill via Digitalmars-d-learn
Compiler v2.069-devel-d0327d9 After testdic file (size=0) was made, Segmentation Fault: 11 . I don't know whether this code is typical use. Is this Phobos BUG? or BY DESIGN? Note that mmap-ing a zero-length range is invalid on Linux. Dunno about OSX; it shouldn't segfault though.

Re: MmFile : Is this std.mmFile BUG?

2015-08-26 Thread rsw0x via Digitalmars-d-learn
,MmFile.Mode.readWrite,0,null); return 0; } --- OSX 10.10.3 , DMD64 D Compiler v2.069-devel-d0327d9 After testdic file (size=0) was made, Segmentation Fault: 11 . I don't know whether this code is typical use. Is this Phobos BUG? or BY DESIGN? Note that mmap-ing a zero-length range is invalid on Linux

Re: MmFile : Is this std.mmFile BUG?

2015-08-26 Thread Junichi Nakata via Digitalmars-d-learn
std.mmFile; int main() { auto x = new MmFile(testdic,MmFile.Mode.readWrite,0,null); return 0; } --- OSX 10.10.3 , DMD64 D Compiler v2.069-devel-d0327d9 After testdic file (size=0) was made, Segmentation Fault: 11 . I don't know whether this code is typical use. Is this Phobos BUG? or BY DESIGN

[dmd2.068] Bug or future?

2015-08-07 Thread VlasovRoman via Digitalmars-d-learn
): Error: no property 'len2' for type 'Vector!float', did you mean 'len'? In dmd 2.067 is normaly. is it Bug or enhancements?

Re: [dmd2.068] Bug or future?

2015-08-07 Thread Ali Çehreli via Digitalmars-d-learn
On 08/06/2015 11:26 PM, VlasovRoman wrote: I have some code: Filed: https://issues.dlang.org/show_bug.cgi?id=14883 Ali

Re: [dmd2.068] Bug or future?

2015-08-07 Thread Ali Çehreli via Digitalmars-d-learn
On 08/06/2015 11:26 PM, VlasovRoman wrote: I have some code: Reduced: import std.stdio; auto foo(T)(T) { return 42; } struct Vector(T) { pragma(msg, is(typeof(foo(Vector.init;// prints true static if(is(typeof(foo(Vector.init { static assert(false);

Re: [dmd2.068] Bug or future?

2015-08-07 Thread Daniel Kozak via Digitalmars-d-learn
); } I get error by compiler when i build this: main.d(30): Error: no property 'len2' for type 'Vector!float', did you mean 'len'? In dmd 2.067 is normaly. is it Bug or enhancements? Does not work in 2.067 for me. Btw. you do not need to do this: alias selftype = Vector!T; You can just use

Re: Bug or feature?

2015-08-04 Thread Jack Applegame via Digitalmars-d-learn
fix - https://github.com/D-Programming-Language/phobos/pull/3524

Re: Static arrays inside struct and class - bug?

2015-08-01 Thread BBasile via Digitalmars-d-learn
On Saturday, 1 August 2015 at 17:22:40 UTC, NX wrote: I wonder if the followings are compiler bugs: class stuff_class { byte[1024*1024*16] arr; // Error: index 16777216 overflow for static array } struct stuff { byte[1024*1024*16] arr; // Error: index 16777216 overflow for static

Re: Static arrays inside struct and class - bug?

2015-08-01 Thread NX via Digitalmars-d-learn
Typo: *scenario

Static arrays inside struct and class - bug?

2015-08-01 Thread NX via Digitalmars-d-learn
I wonder if the followings are compiler bugs: class stuff_class { byte[1024*1024*16] arr; // Error: index 16777216 overflow for static array } struct stuff { byte[1024*1024*16] arr; // Error: index 16777216 overflow for static array } My project has just stopped for this reason, I

Re: Static arrays inside struct and class - bug?

2015-08-01 Thread NX via Digitalmars-d-learn
On Saturday, 1 August 2015 at 17:29:54 UTC, Adam D. Ruppe wrote: On Saturday, 1 August 2015 at 17:22:40 UTC, NX wrote: I wonder if the followings are compiler bugs: No, it is by design, the idea is to keep static arrays smallish so null references will be caught by the processor. (An overly

Re: Static arrays inside struct and class - bug?

2015-08-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 1 August 2015 at 17:22:40 UTC, NX wrote: I wonder if the followings are compiler bugs: No, it is by design, the idea is to keep static arrays smallish so null references will be caught by the processor. (An overly large static array could allow indexing it through a null pointer

Re: Static arrays inside struct and class - bug?

2015-08-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 1 August 2015 at 18:07:51 UTC, NX wrote: Sorry, I can't see _the_ point in that. Yeah, especially since you can jsut break up the array and get the same effect anyway... so like if you don't want to dynamically allocate the memory, you could also try: byte[1024*1024*8]

<    5   6   7   8   9   10   11   12   13   14   >