Re: Source code annotations alla Java

2014-12-10 Thread Paulo Pinto via Digitalmars-d-learn
On Thursday, 20 January 2011 at 14:04:54 UTC, Steven Schveighoffer wrote: On Thu, 20 Jan 2011 08:47:28 -0500, Justin Johansson j...@nospam.com wrote: Not long ago the Java Language people introduced the idea of annotations together with an annotation processing tool (apt). Now perhaps the

Re: Garbage collector collects live objects

2014-12-10 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 02:43:19 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 09 Dec 2014 17:18:44 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: but i still have no clue how to overcome GC =( why do you want to fight with GC? most of

Re: Garbage collector collects live objects

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 08:32:12 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 02:43:19 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 09 Dec 2014 17:18:44 + Ruslan Mullakhmetov via Digitalmars-d-learn

Re: Garbage collector collects live objects

2014-12-10 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 21:38:57 UTC, Steven Schveighoffer wrote: On 12/9/14 2:56 PM, Steven Schveighoffer wrote: On 12/9/14 12:40 PM, Ruslan Mullakhmetov wrote: array holds 11 64bit pointers but it's block size is only 128 bytes 11 * 64 = 704 bytes. what's wrong with this

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 22:27:43 UTC, anonymous wrote: On Tuesday, 9 December 2014 at 16:12:35 UTC, Paul wrote: import derelict.sdl2.sdl; import std.stdio; import std.conv; void main() { scope(exit) { SDL_Quit(); } DerelictSDL2.load();

Re: Derelict / SDL error

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 08:59:36 + Paul via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Adding that reveals that I need to add SDL_image 2.0 (I didn't know that that wasn't a part of the standard SDL install) so I've compiled that too. I now get the error: Unsupported

mixin template had error by calling shared function

2014-12-10 Thread Vlasov Roman via Digitalmars-d-learn
I have this code import std.stdio; mixin template Template(void function() func1, void function() func2) { voidto() { func1(); func2(); } }; class SomeClass { mixin Template!(func, func23); void func() {

Re: mixin template had error by calling shared function

2014-12-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 10/12/2014 10:10 p.m., Vlasov Roman wrote: I have this code import std.stdio; mixin template Template(void function() func1, void function() func2) { void to() { func1(); func2(); } }; class SomeClass { mixin Template!(func, func23); void func()

Re: mixin template had error by calling shared function

2014-12-10 Thread via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 09:41:43 UTC, Rikki Cattermole wrote: On 10/12/2014 10:10 p.m., Vlasov Roman wrote: I have this code import std.stdio; mixin template Template(void function() func1, void function() func2) { void to() { func1(); func2(); } };

Re: mixin template had error by calling shared function

2014-12-10 Thread via Digitalmars-d-learn
https://issues.dlang.org/show_bug.cgi?id=13850

Re: mixin template had error by calling shared function

2014-12-10 Thread Vlasov Roman via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 10:34:25 UTC, Marc Schütz wrote: On Wednesday, 10 December 2014 at 09:41:43 UTC, Rikki Cattermole wrote: On 10/12/2014 10:10 p.m., Vlasov Roman wrote: I have this code import std.stdio; mixin template Template(void function() func1, void function() func2) {

Re: mixin template had error by calling shared function

2014-12-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 11/12/2014 12:24 a.m., Vlasov Roman wrote: On Wednesday, 10 December 2014 at 10:34:25 UTC, Marc Schütz wrote: On Wednesday, 10 December 2014 at 09:41:43 UTC, Rikki Cattermole wrote: On 10/12/2014 10:10 p.m., Vlasov Roman wrote: I have this code import std.stdio; mixin template

Template mixin enum stringof

2014-12-10 Thread Lemonfiend via Digitalmars-d-learn
Consider the following: --- enum Foo { BAR, } mixin template S(string s_) { enum s = s_; } void main() { mixin S!(Foo.BAR.stringof); // Error: identifier 'stringof' of 'Foo.BAR.stringof' is not defined enum e = Foo.BAR.stringof; mixin S!(e); // works fine } --- Why

Re: Template mixin enum stringof

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 11:52:11 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Consider the following: --- enum Foo { BAR, } mixin template S(string s_) { enum s = s_; } void main() { mixin S!(Foo.BAR.stringof); // Error: identifier

Re: Derelict / SDL error

2014-12-10 Thread Mike Parker via Digitalmars-d-learn
On 12/10/2014 5:59 PM, Paul wrote: Adding that reveals that I need to add SDL_image 2.0 (I didn't know that that wasn't a part of the standard SDL install) so I've compiled that too. I now get the error: Unsupported image format whether I use a png or jpg. int flags = IMG_INIT_PNG |

Re: Template mixin enum stringof

2014-12-10 Thread Lemonfiend via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 12:08:34 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 10 Dec 2014 11:52:11 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Consider the following: --- enum Foo { BAR, } mixin template S(string s_) { enum s =

Re: Template mixin enum stringof

2014-12-10 Thread Daniel Kozák via Digitalmars-d-learn
V Wed, 10 Dec 2014 11:52:11 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno: Consider the following: --- enum Foo { BAR, } mixin template S(string s_) { enum s = s_; } void main() { mixin S!(Foo.BAR.stringof); // Error: identifier

Re: Garbage collector collects live objects

2014-12-10 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 08:46:12 UTC, Ruslan Mullakhmetov wrote: yes. that was the mistake. also after fixing bug in Blk Attributes printing i got more reasonable attrs for object blk: FINALIZE for array of objects blk: NO_SCAN APPENDABLE this is sound good except for NO_SCAN. ...

Re: Template mixin enum stringof

2014-12-10 Thread Daniel Kozák via Digitalmars-d-learn
V Wed, 10 Dec 2014 12:35:44 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno: On Wednesday, 10 December 2014 at 12:08:34 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 10 Dec 2014 11:52:11 + Lemonfiend via Digitalmars-d-learn

Re: Template mixin enum stringof

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 12:35:44 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 12:08:34 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 10 Dec 2014 11:52:11 + Lemonfiend via Digitalmars-d-learn

Re: Garbage collector collects live objects

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 12:52:22 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 08:46:12 UTC, Ruslan Mullakhmetov wrote: yes. that was the mistake. also after fixing bug in Blk Attributes printing i got more

Re: Garbage collector collects live objects

2014-12-10 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 12:52:24 UTC, Ruslan Mullakhmetov wrote: why and how this happens? can anybody explain it to me? I tried to extract this and saw NO NO_SCAN attrs after moving blk: the following piece of output produced by http://dpaste.dzfl.pl/6f773e17de92 len: 6

Re: Garbage collector collects live objects

2014-12-10 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 13:00:45 UTC, ketmar via Digitalmars-d-learn wrote: can you give us a minified code that causes this behavior? see previous post. the problem vanish if i try to extract it.

Re: Garbage collector collects live objects

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 13:03:21 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 12:52:24 UTC, Ruslan Mullakhmetov wrote: why and how this happens? can anybody explain it to me? I tried to extract this and saw NO

Re: Template mixin enum stringof

2014-12-10 Thread Lemonfiend via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 12:57:07 UTC, Daniel Kozák via Digitalmars-d-learn wrote: V Wed, 10 Dec 2014 12:35:44 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno: On Wednesday, 10 December 2014 at 12:08:34 UTC, ketmar via Digitalmars-d-learn wrote:

Re: Template mixin enum stringof

2014-12-10 Thread Lemonfiend via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 12:57:16 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 10 Dec 2014 12:35:44 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 12:08:34 UTC, ketmar via Digitalmars-d-learn wrote: On Wed,

Re: Template mixin enum stringof

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 13:58:20 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 12:57:16 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 10 Dec 2014 12:35:44 + Lemonfiend via Digitalmars-d-learn

Re: Template mixin enum stringof

2014-12-10 Thread Lemonfiend via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 14:25:30 UTC, ketmar via Digitalmars-d-learn wrote: On Wed, 10 Dec 2014 13:58:20 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 10 December 2014 at 12:57:16 UTC, ketmar via Digitalmars-d-learn wrote: On Wed,

Re: Template mixin enum stringof

2014-12-10 Thread ketmar via Digitalmars-d-learn
On Wed, 10 Dec 2014 14:32:12 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: mixin template S(alias fld) if (is(typeof(fld) == enum)) { import std.conv : to; enum s = to!string(fld); // BAR // or this: //import std.traits :

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 12:10:23 UTC, Mike Parker wrote: Also, though this is unrelated (I just noticed it when looking at your code again), I strongly recommend you move the line scope( exit ) SDL_Quit(); to somewhere after DerelictSDL2.load(). If the SDL shared library fails to

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 09:07:56 UTC, ketmar via Digitalmars-d-learn wrote: do you have the corresponding libraries installed? SDL_Image uses libpng and libjpeg for decoding images, so if you don't have those installed (with corresponding -dev if your system needs that) you will not

Re: Derelict / SDL error

2014-12-10 Thread Mike Parker via Digitalmars-d-learn
On 12/11/2014 12:31 AM, Paul wrote: This thread has degenerated into a discussion of the set up of my OS which is miles off topic and should probably be abandoned. Maybe not. The trouble is that others have been able to compile and run the same code without error. Given that you are still

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 16:58:57 UTC, Mike Parker wrote: On 12/11/2014 12:31 AM, Paul wrote: This thread has degenerated into a discussion of the set up of my OS which is miles off topic and should probably be abandoned. Maybe not. The trouble is that others have been able to

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 18:06:08 UTC, Paul wrote: On Wednesday, 10 December 2014 at 16:58:57 UTC, Mike Parker wrote: On 12/11/2014 12:31 AM, Paul wrote: This thread has degenerated into a discussion of the set up of my OS which is miles off topic and should probably be abandoned.

Re: Derelict / SDL error

2014-12-10 Thread Paul via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 18:58:15 UTC, Paul wrote: The two machines on which errors occur are a Mint 13 (32 bit) box and an ageing laptop with Lubuntu 14.04. I've followed the same procedures but the 64 bit obviously has the 64 bit dmd compiler. Just added SDL_image to this 64 bit

Re: Sorted Array Wrapper Range

2014-12-10 Thread Nordlöw
On Monday, 8 December 2014 at 15:43:37 UTC, Tobias Pankrath wrote: Was my fault. The phobos checkout didn't match my dmd version. Here is my current state (has some more unittest, bugs fixed, no assignment via SortedRange views on Sorted.):

Re: @property usage

2014-12-10 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On 09/12/14 08:31, Nicholas Londey via Digitalmars-d-learn wrote: Does @property ever make sense for a free floating function? http://dlang.org/phobos/std_random.html#.rndGen :-)

Re: Sorted Array Wrapper Range

2014-12-10 Thread Nordlöw
On Monday, 8 December 2014 at 20:18:51 UTC, Nordlöw wrote: Great! You should do a PR when you're satisfied! :) https://github.com/D-Programming-Language/phobos/pull/2793

Re: Derelict / SDL error

2014-12-10 Thread Mike Parker via Digitalmars-d-learn
On 12/11/2014 4:17 AM, Paul wrote: On Wednesday, 10 December 2014 at 18:58:15 UTC, Paul wrote: The two machines on which errors occur are a Mint 13 (32 bit) box and an ageing laptop with Lubuntu 14.04. I've followed the same procedures but the 64 bit obviously has the 64 bit dmd compiler.

std.algorithm and templates

2014-12-10 Thread meat via Digitalmars-d-learn
Hello! Thanks for the notice. I've been enjoying delving into D recently, and have made quite some progress, but I've become stumped on this one problem! I consider myself decent at natural debugging, but this problem has eluded me. I don't believe any of this problem is implementation

Re: std.algorithm and templates

2014-12-10 Thread bearophile via Digitalmars-d-learn
meat: class Woah(){} class Bro: Woah{} DList!Woah woahs; and I'm having trouble with.. foreach( bro; woahs.filter!( a = cast(Bro)a !is null)) import std.algorithm, std.container; class Woah {} class Bro : Woah {} void main() { DList!Woah woahs; foreach (bro; woahs[].filter!(a =