Re: What D related (or interesting development based) twitter accounts do you guys follow?

2015-01-23 Thread eles via Digitalmars-d-learn
On Sunday, 28 July 2013 at 16:57:54 UTC, Gary Willoughby wrote: What D related (or interesting development based) twitter accounts do you guys follow? I'm pretty new to twitter and trying to follow accounts that i find interesting. Just remembered when reading this: http://www.viva64.com/en/b

For those ready to take the challenge

2015-01-09 Thread eles via Digitalmars-d-learn
https://codegolf.stackexchange.com/questions/44278/debunking-stroustrups-debunking-of-the-myth-c-is-for-large-complicated-pro

Re: Destructor/Finalizer Guarantees

2014-11-12 Thread eles via Digitalmars-d-learn
On Wednesday, 12 November 2014 at 14:36:19 UTC, Kagamin wrote: With GC you usually have two destructors: Which is why this approach is so cumbersome. At least, in non-GC you only have just one kind of destructor.

Re: Cast to left hand side

2014-11-10 Thread eles via Digitalmars-d-learn
On Monday, 10 November 2014 at 05:00:25 UTC, tcak wrote: On Sunday, 9 November 2014 at 21:47:03 UTC, eles wrote: On Sunday, 9 November 2014 at 19:00:01 UTC, tcak wrote: Because I am auto casting with a keyword, compiler shouldn't complain about it as well. This can also solve "unc

Re: status of D optimizers benefiting from contracts ?

2014-11-09 Thread eles via Digitalmars-d-learn
On Sunday, 9 November 2014 at 16:31:46 UTC, bearophile wrote: H. S. Teoh: It's only a bad idea because people abuse assert() where it's not appropriate. It's a bad idea because Walter seems unable to understand the difference between verifying and proving. I fail to see the difference betw

Re: Cast to left hand side

2014-11-09 Thread eles via Digitalmars-d-learn
On Sunday, 9 November 2014 at 19:00:01 UTC, tcak wrote: In some cases, I need to cast right hand side expression to left hand side. While it looks/feels simple for basic data types, it requires long lines with duplication when flexible code is desired to be written. Example: int a = 7; byte

Re: Destructor order

2014-10-22 Thread eles via Digitalmars-d-learn
On Wednesday, 22 October 2014 at 18:03:44 UTC, anonymous wrote: On Wednesday, 22 October 2014 at 15:45:02 UTC, eles wrote: D version: `foo` should be a `Scoped!A`. When it's typed as `A`, the `Scoped!A` that is returned by `scoped`, is destructed immediately (and the reference leaks, I

Re: Destructor order

2014-10-22 Thread eles via Digitalmars-d-learn
On Wednesday, 22 October 2014 at 18:03:44 UTC, anonymous wrote: On Wednesday, 22 October 2014 at 15:45:02 UTC, eles wrote: `foo` should be a `Scoped!A`. When it's typed as `A`, the `Scoped!A` that is returned by `scoped`, is destructed immediately (and the reference leaks, I guess).

Re: Destructor order

2014-10-22 Thread eles via Digitalmars-d-learn
On Wednesday, 22 October 2014 at 17:13:35 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 22 October 2014 at 16:55:41 UTC, Regan Heath So why wasn't the eles' destructor order in reverse if Scoped is a struct and calls explicit destroy(B) then destroy(A)? Maybe it's the write

Re: Destructor order

2014-10-22 Thread eles via Digitalmars-d-learn
On Wednesday, 22 October 2014 at 15:45:02 UTC, eles wrote: D version with structs: { //display ~C~B~A A foo; B bar; C *caz = new C(); delete caz; } as expected.

Destructor order

2014-10-22 Thread eles via Digitalmars-d-learn
C++ versions: { //displays ~C~B~A A foo; B bar; C *caz = new C(); delete caz; } std::cout << std::endl; { //displays ~C~B~A std::unique_ptr foo = std::make_unique(); std::unique_ptr bar = std

Re: How to match string by word

2014-10-17 Thread eles via Digitalmars-d-learn
On Friday, 17 October 2014 at 16:39:38 UTC, Uranuz wrote: I haven't touched any key on a keyboard and haven't pressed *Send* but message was posted somehow. Scan for rootkits...

Re: Beginner ?. Why does D suggest to learn java

2014-10-17 Thread eles via Digitalmars-d-learn
On Friday, 17 October 2014 at 13:59:03 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 17 Oct 2014 10:10:09 +0200 spir via Digitalmars-d-learn wrote: computer programming is the literacy of the new age. Let's say, computer knowledge. There are also database administrators, package main

Re: When betterC triggers errors in compilation?

2014-10-14 Thread eles via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 13:31:47 UTC, Adam D. Ruppe wrote: On Tuesday, 14 October 2014 at 13:20:50 UTC, eles wrote: http://forum.dlang.org/post/lddug4$jgv$1...@digitalmars.com -betterC right now is still an undocumented hack that doesn't do much. Thank you.

When betterC triggers errors in compilation?

2014-10-14 Thread eles via Digitalmars-d-learn
Hello, According to this: http://forum.dlang.org/post/lddug4$jgv$1...@digitalmars.com "-betterC" should disable support for exception handling. So I expected dmd to reject the following code: === import std.stdio; int readDieFromFile() { auto

Re: Code fails with linker error. Why?

2014-10-06 Thread eles via Digitalmars-d-learn
On Monday, 6 October 2014 at 19:03:13 UTC, John Colvin wrote: On Monday, 6 October 2014 at 16:04:02 UTC, eles wrote: On Monday, 6 October 2014 at 15:44:36 UTC, John Colvin wrote: On Monday, 6 October 2014 at 12:36:41 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 06 Oct 2014 11:54:55

Re: Code fails with linker error. Why?

2014-10-06 Thread eles via Digitalmars-d-learn
On Monday, 6 October 2014 at 15:44:36 UTC, John Colvin wrote: On Monday, 6 October 2014 at 12:36:41 UTC, ketmar via Digitalmars-d-learn wrote: On Mon, 06 Oct 2014 11:54:55 + John Colvin via Digitalmars-d-learn wrote: I disagree. It's simple and easy to understand. and hackish. D is v

Re: Code fails with linker error. Why?

2014-10-06 Thread eles via Digitalmars-d-learn
On Monday, 6 October 2014 at 13:23:55 UTC, John Colvin wrote: On Monday, 6 October 2014 at 12:16:14 UTC, eles wrote: On Monday, 6 October 2014 at 11:54:56 UTC, John Colvin wrote: On Monday, 6 October 2014 at 10:10:04 UTC, eles wrote: On Saturday, 4 October 2014 at 15:29:57 UTC, John Colvin

Re: Code fails with linker error. Why?

2014-10-06 Thread eles via Digitalmars-d-learn
On Monday, 6 October 2014 at 11:54:56 UTC, John Colvin wrote: On Monday, 6 October 2014 at 10:10:04 UTC, eles wrote: On Saturday, 4 October 2014 at 15:29:57 UTC, John Colvin wrote: On Saturday, 4 October 2014 at 11:19:52 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 04 Oct 2014 11:01:28

Re: Code fails with linker error. Why?

2014-10-06 Thread eles via Digitalmars-d-learn
On Saturday, 4 October 2014 at 15:29:57 UTC, John Colvin wrote: On Saturday, 4 October 2014 at 11:19:52 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 04 Oct 2014 11:01:28 + John Colvin via Digitalmars-d-learn wrote: On Saturday, 4 October 2014 at 10:38:32 UTC, ketmar via Digitalmar

Re: Code fails with linker error. Why?

2014-10-04 Thread eles via Digitalmars-d-learn
On Saturday, 4 October 2014 at 10:38:32 UTC, ketmar via Digitalmars-d-learn wrote: On Sat, 04 Oct 2014 10:27:16 + John Colvin via Digitalmars-d-learn wrote: is there any possibility to declare *class* *method* in one Yes, that too. Is even worse.

Re: Code fails with linker error. Why?

2014-10-04 Thread eles via Digitalmars-d-learn
On Saturday, 4 October 2014 at 10:27:18 UTC, John Colvin wrote: On Saturday, 4 October 2014 at 04:02:46 UTC, eles wrote: On Friday, 3 October 2014 at 15:47:33 UTC, John Colvin wrote: On Friday, 3 October 2014 at 15:44:16 UTC, eles wrote: So the compiler has no way of knowing whether you&#x

Re: Code fails with linker error. Why?

2014-10-04 Thread eles via Digitalmars-d-learn
On Saturday, 4 October 2014 at 10:27:18 UTC, John Colvin wrote: On Saturday, 4 October 2014 at 04:02:46 UTC, eles wrote: On Friday, 3 October 2014 at 15:47:33 UTC, John Colvin wrote: On Friday, 3 October 2014 at 15:44:16 UTC, eles wrote: class ShapeSurface(T) { public: int formula

Re: Code fails with linker error. Why?

2014-10-04 Thread eles via Digitalmars-d-learn
On Saturday, 4 October 2014 at 09:39:12 UTC, Chris Nicholson-Sauls wrote: In the original you are casting an int to a pointer type, which is legitimate (although rarely a good idea). The other side of the matter is simply precedence. cast(T)a.b; Is really the same as: cast(T)(a.b); But th

Re: Code fails with linker error. Why?

2014-10-04 Thread eles via Digitalmars-d-learn
On Saturday, 4 October 2014 at 09:39:12 UTC, Chris Nicholson-Sauls wrote: In the original you are casting an int to a pointer type, which is legitimate (although rarely a good idea). The other side of the matter is simply precedence. cast(T)a.b; Is really the same as: cast(T)(a.b); Yes, y

Re: Code fails with linker error. Why?

2014-10-03 Thread eles via Digitalmars-d-learn
On Friday, 3 October 2014 at 15:47:33 UTC, John Colvin wrote: On Friday, 3 October 2014 at 15:44:16 UTC, eles wrote: class ShapeSurface(T) { public: int formula(); that means you have a definition of formula elsewhere (which the linker tries to find, but obviously fails. What you

Code fails with linker error. Why?

2014-10-03 Thread eles via Digitalmars-d-learn
This is under Linux 64 with both dmd 2.066 (and latest gdc-4.9): = class ShapeSurface(T) { public: int formula(); int getSurfaceBy100() { int surface; surface = cast(T *)this.formula();

Re: Allowing Expressions such as (low < value < high)

2014-09-05 Thread eles via Digitalmars-d-learn
On Friday, 5 September 2014 at 07:26:45 UTC, klpo wrote: On Thursday, 4 September 2014 at 20:29:09 UTC, Nordlöw wrote: On Thursday, 4 September 2014 at 20:03:57 UTC, Nordlöw wrote: The problem is in D "[0..9]" has a completely different signification. All the sins of the past...

Re: 'idiomatic' porting of c and or c++ code that does NULL checking

2014-08-26 Thread eles via Digitalmars-d-learn
On Wednesday, 27 August 2014 at 05:45:34 UTC, eles wrote: On Wednesday, 27 August 2014 at 05:39:59 UTC, Vladimir Panteleev wrote: On Monday, 25 August 2014 at 03:19:09 UTC, Mike Parker wrote: failure and the SIGKILL. (and SIGKILL just because you cannot catch it, otherwise you could

Re: 'idiomatic' porting of c and or c++ code that does NULL checking

2014-08-26 Thread eles via Digitalmars-d-learn
On Wednesday, 27 August 2014 at 05:39:59 UTC, Vladimir Panteleev wrote: On Monday, 25 August 2014 at 03:19:09 UTC, Mike Parker wrote: Sorry, you're right, that description of Exception/Error is correct. But I don't think that SDL initialization is a non-recoverable error. The program might

Re: Learning D

2014-08-26 Thread eles via Digitalmars-d-learn
On Monday, 25 August 2014 at 16:46:11 UTC, Ryan wrote: Me: Software developer for 30 years. What IDE should I use? I'm not big fan of Eclipse, although if If you are an Eclipse (CDT) user for C/C++, then you will find a very similar plugin for D, called DDT, here: http://code.google.com/

Re: How to get nogc to work with manual memory allocation

2014-08-24 Thread eles via Digitalmars-d-learn
On Sunday, 24 August 2014 at 08:48:03 UTC, bearophile wrote: Bienlein: things in such Limbo for several years). decades

Re: Programming a Game in D? :D

2014-08-03 Thread eles via Digitalmars-d-learn
On Sunday, 3 August 2014 at 12:37:51 UTC, eles wrote: On Saturday, 2 August 2014 at 20:58:34 UTC, Foo wrote: On Saturday, 2 August 2014 at 20:38:59 UTC, David wrote: on this road. It matters less for us to be able to use slices And this while D really nailed down two things very well

Re: Programming a Game in D? :D

2014-08-03 Thread eles via Digitalmars-d-learn
On Sunday, 3 August 2014 at 05:17:08 UTC, Mike Parker wrote: On 8/3/2014 5:38 AM, David wrote: about platform support, I know the story. But throwing all the weight behind a more-standard back-end would improve things. Yes, it would require some transition effort. But, then, ldc and gdc wo

Re: Programming a Game in D? :D

2014-08-03 Thread eles via Digitalmars-d-learn
On Saturday, 2 August 2014 at 20:58:34 UTC, Foo wrote: On Saturday, 2 August 2014 at 20:38:59 UTC, David wrote: Hi, not too sure if there's still someone reading this post, but i do have another question. So, I heared so much good stuff about D, it's powerfull, fast the syntax is nice, but wel

Re: GC.calloc(), then what?

2014-06-27 Thread eles via Digitalmars-d-learn
On Friday, 27 June 2014 at 08:17:07 UTC, Ali Çehreli wrote: Thank you for your responses. I am partly enlightened. :p On 06/27/2014 12:34 AM, safety0ff wrote: > On Friday, 27 June 2014 at 07:03:28 UTC, Ali Çehreli wrote: But addRange doesn't seem to make sense for stdlib.malloc'ed memory, ri

Re: Is this reasonable?

2013-12-05 Thread eles
On Thursday, 5 December 2013 at 19:36:46 UTC, H. S. Teoh wrote: On Thu, Dec 05, 2013 at 03:47:27PM -0300, Ary Borenszweig wrote: [...] Cough, cough, make array length be an int. Do you really need arrays that big? :-S (I'm talking to Mr. D Compiler here) A negative length array makes no sens

Re: Is this reasonable?

2013-12-05 Thread eles
On Thursday, 5 December 2013 at 19:51:52 UTC, Ary Borenszweig wrote: On 12/5/13 4:35 PM, H. S. Teoh wrote: On Thu, Dec 05, 2013 at 03:47:27PM -0300, Ary Borenszweig wrote: [...] Cough, cough, make array length be an int. Do you really need arrays that big? :-S (I'm talking to Mr. D Compiler

Re: Is this reasonable?

2013-12-05 Thread eles
On Thursday, 5 December 2013 at 17:44:18 UTC, H. S. Teoh wrote: On Thu, Dec 05, 2013 at 06:15:37PM +0100, Steve Teale wrote: Here I feel like a beginner, but it seems very unfriendly: import std.stdio; struct ABC { double a; int b; bool c; } ABC[20] aabc; void foo(int n) { writef

Re: Is this reasonable?

2013-12-05 Thread eles
On Thursday, 5 December 2013 at 18:26:48 UTC, Jonathan M Davis wrote: On Thursday, December 05, 2013 19:16:29 Maxim Fomin wrote: On Thursday, 5 December 2013 at 17:15:39 UTC, Steve Teale wrote: the values. The best that could be done would be to warn about the comparison or to make it an err

Re: Is anything private by default when declared in a module?

2013-12-03 Thread eles
On Monday, 2 December 2013 at 21:28:48 UTC, lomereiter wrote: On Monday, 2 December 2013 at 20:53:10 UTC, Namespace wrote: OMG now I get it why in 2.064 importing std.regex makes visible std.uni.isWhite all of a sudden. Unicorns cannot be white, as they are already pink & invisible. At leas

Re: Problem with rdmd

2013-10-01 Thread eles
On Saturday, 31 August 2013 at 12:01:48 UTC, Dicebot wrote: On Friday, 30 August 2013 at 13:32:25 UTC, eles wrote: On Friday, 30 August 2013 at 11:34:59 UTC, Jacob Carlborg wrote: On 2013-08-30 09:39, eles wrote: This is an ancient dmd misfeature - it treats `dmd test` as `dmd test.d`, adding

Re: using scons on 64-bit platform, with gdc

2013-09-18 Thread eles
On Wednesday, 18 September 2013 at 07:09:27 UTC, eles wrote: import os env = Environment(ENV = os.environ) gcc -o test01 -m32 test01.o -L/usr/lib -lphobos2 -lpthread -lm Related, why the scons is passing the -L/usr/lib to the gcc, while the LD_LIBRARY_PATH variable of my bash shell is

using scons on 64-bit platform, with gdc

2013-09-18 Thread eles
Hi, Not sure it is a bug or a misuse of scons, but on Saucy 64, with scons --version script: v2.3.0, 2013/03/03 09:48:35, by garyo on reepicheep engine: v2.3.0, 2013/03/03 09:48:35, by garyo on reepicheep and a simple SConstruct like: import os env = Environment(ENV = os.e

volatile

2013-09-09 Thread eles
Among the intended uses of volatile is to "allow access to memory mapped devices" (quoting wikipedia). This play an immense role in the embedded, signaling to the compiler that the content of that variable/address could change without notice. It is not because other thread would change it. I

Re: Problem with rdmd

2013-09-05 Thread eles
On Saturday, 31 August 2013 at 17:42:21 UTC, Andrei Alexandrescu wrote: On 8/30/13 6:32 AM, eles wrote: On Friday, 30 August 2013 at 11:34:59 UTC, Jacob Carlborg wrote: On 2013-08-30 09:39, eles wrote: One possible solution would be for rdmd to create a link in its temporary directory to the

Re: Problem with rdmd

2013-09-01 Thread eles
everything with system() statements. On Saturday, 31 August 2013 at 11:08:57 UTC, Jacob Carlborg wrote: On 2013-08-30 09:39, eles wrote: On Linux 64 $chmod +x htest $cat ./htest #!/usr/bin/env rdmd import std.stdio; void main() { writeln("hello world!"); } then: $./htest Error: c

Re: Problem with rdmd

2013-08-30 Thread eles
On Friday, 30 August 2013 at 11:34:59 UTC, Jacob Carlborg wrote: On 2013-08-30 09:39, eles wrote: I'm pretty sure it's DMD that is the problem. Yes. But that's, the least to say, limiting. This: https://github.com/D-Programming-Language/tools/blob/master/rdmd.d#L160 shou

Re: Problem with rdmd

2013-08-30 Thread eles
On Friday, 30 August 2013 at 07:56:14 UTC, anonymous wrote: On Friday, 30 August 2013 at 07:39:41 UTC, eles wrote: A workaround for this? ln htest htest.d Thanks.

Problem with rdmd

2013-08-30 Thread eles
On Linux 64 $chmod +x htest $cat ./htest #!/usr/bin/env rdmd import std.stdio; void main() { writeln("hello world!"); } then: $./htest Error: cannot read file ./htest.d Failed: 'dmd' '-v' '-o-' './htest.d' '-I.' OTOH: $cp htest htest.d $./htest.d hello world! It seems that rdmd expe

Re: trouble with long

2013-07-16 Thread eles
On Tuesday, 16 July 2013 at 11:14:44 UTC, bearophile wrote: eles: Bye, bearophile Don C.: "There's a root cause issue -- integer overflow is not an error in general. The paper which bearophile keeps posting, which he has apparently never read, shows quite convincingly that you cann

Re: trouble with long

2013-07-16 Thread eles
On Tuesday, 16 July 2013 at 11:14:44 UTC, bearophile wrote: eles: Bye, bearophile Walter: "Consider all the addressing modes used - they are all adds, with no overflow checks. Secondly, they all rely on wraparound (overflow) arithmetic, after all, that is how subtraction is done.

trouble with long

2013-07-16 Thread eles
$cat test.cpp: #include int main() { long long x = 125000 * 2; std::cout << x << std::endl; return 0; } g++-generated exe displays: -1794967296 $cat test.d: import std.stdio; int main() { long x = 125000 * 2; writefln("%d",x); return 0

Re: version(noboundscheck) + friends

2013-06-04 Thread eles
On Tuesday, 4 June 2013 at 07:19:52 UTC, Jonathan M Davis wrote: On Tuesday, June 04, 2013 09:14:28 eles wrote: On Monday, 3 June 2013 at 22:19:23 UTC, Ali Çehreli wrote: > On 06/03/2013 03:11 PM, Timothee Cour wrote: Nothing in the language checks for integer overflow, and given the overh

Re: version(noboundscheck) + friends

2013-06-04 Thread eles
On Monday, 3 June 2013 at 22:19:23 UTC, Ali Çehreli wrote: On 06/03/2013 03:11 PM, Timothee Cour wrote: > Why aren't we using version=noboundscheck (+ friends) instead of > -noboundscheck? Hijack: what about version(integeroverflow) ?

unsigned int in for loops

2011-02-04 Thread eles
example, disabling implicit casting of (-1) to UINT_MAX). cordially, eles. PS i really like being able to use an unsigned int for those loops, both for logical and for programming (large values of the loop index), while still avoiding such traps. thanks.

help needed with gdb

2010-05-19 Thread eles
ted normally. (gdb) as you see, the debug session was unsuccesful. can anybody enlighten me why? what is the line "warning: the debug information found in "/lib/ld-2.11.1.so" does not match "/lib/ld-linux.so.2" (CRC mismatch)."? thank you eles

Re: compiled gdb

2010-05-15 Thread eles
maybe it could be even integrated in the dmd archive, just like the windbg currently is...

compiled gdb

2010-05-14 Thread eles
it comes to dependencies and so on). eles

Re: std.complex

2010-05-11 Thread eles
== Quote from Lars T. Kyllingstad (pub...@kyllingen.nospamnet)'s article > On Tue, 11 May 2010 15:08:07 +0000, eles wrote: > > Maybe I am wrong, but my feeling is that if the complex numbers were a > > native type (like creal&co. are now), then it would have been possible

Re: std.complex

2010-05-11 Thread eles
Maybe I am wrong, but my feeling is that if the complex numbers were a native type (like creal&co. are now), then it would have been possible to have a dedicated formatting (just like %f, %d and %s are) for writefln. Putting the type into the library seems to forbid some very nice things: - init

Re: std.complex

2010-05-11 Thread eles
be nice to be able displaying a complex number in both Cartesian and Polar formats) eles

Re: std.complex

2010-05-11 Thread eles
>dmd test.d C:\dmd2>test C:\dmd2> While we are here, can somebody look at DMD bug 2460 please? eles

Re: std.complex

2010-05-09 Thread eles
Thank you, Don. I saw your post on the http://news.gmane.org/ gmane.comp.lang.d.dmd.beta group. I'll wait for the next release. Does anybody knows about when the http://d.puremagic.com/issues/ show_bug.cgi?id=2460 (DMD bug 2460) will be addressed?

Re: std.complex

2010-05-09 Thread eles
report? otoh, native types creal, cfloat etc. are not deprecated, it seems. they should be, i think. eles

Re: std.complex

2010-05-09 Thread eles
Thanks for your answer. Me too, I prefer working on linux but for some reasons I remain on windows until dmd goes 64-bit. For the record, std.stdio works fine: Compiling import std.stdio; int main(){ writefln("hello!\n"); return 0; } results in: C:\dmd2>dmd test.d C:\dmd2>test hello!

std.complex

2010-05-08 Thread eles
Hello, I just installed dmd 2.045 (unarchived in c:\dmd2) and put c: \dmd2\windows2\bin on path. Compiling the following: import std.complex; int main(){ return 0; } fails with: C:\dmd2>dmd test.d OPTLINK (R) for Win32 Release 8.00.2 Copyright (C) Digital Mars 1989-2009 All rights

Re: Newsgroups, off-topic

2010-04-16 Thread eles
Thank you for your answer. I hope to see std.complex integrated in the next release of dmd. I am mainly interested in scientific (i.e. numerical) computations, so a good numerical library (GSL, Lapack etc.) would be welcome in D. I like the std.algorithm, though. Eles PS Thanks to everybody for

Newsgroups, off-topic

2010-04-16 Thread eles
owever, it is a nuisance to install multilib. Thanks everybody. Eles