Re: Placement of shared does not allow to set a delegate

2014-06-19 Thread Tolga Cakiroglu via Digitalmars-d-learn
Yes the understanding is correct. I simplified the code a little: IMPORTANT: DMD 2.065 is used. class Car{ void delegate() onEvent; } class Test{ this() shared { auto car = new shared Car(); assert( typeid( car.onEvent ).toString() == "shared(void dele

Re: Placement of shared does not allow to set a delegate

2014-06-16 Thread Tolga Cakiroglu via Digitalmars-d-learn
On Monday, 16 June 2014 at 15:25:51 UTC, Ali Çehreli wrote: Here is a minimal example that reproduces the issue and the hint that compiles the code: class SocketListener { public void delegate( shared(SocketListener) sender ) /* shared */// <-- UNCOMMENT TO COMPILE eventWhenSt

Re: Doing exercise from book, but I'm getting error with splitter

2014-06-16 Thread Tolga Cakiroglu via Digitalmars-d-learn
Add "import std.algorithm". Splitter is defined there. http://dlang.org/phobos/std_algorithm.html#splitter On Monday, 16 June 2014 at 16:38:15 UTC, Sanios wrote: Hello guys, as first I don't know, if I'm writing to correct section, but I've got a problem. I'm actually reading book of D guide and

Re: Placement of shared does not allow to set a delegate

2014-06-16 Thread Tolga Cakiroglu via Digitalmars-d-learn
Thanks Ali. That has solved the problem. Actually I tried to use that `shared` as follows before: public shared void delegate( shared(BasicSocketListener) sender ) eventWhenStarted; Though it didn't work with that. When it is put "before" the attribute name, it works now. It is just confusin

Placement of shared does not allow to set a delegate

2014-06-16 Thread Tolga Cakiroglu via Digitalmars-d-learn
In a class I defined an event attribute as follows: public void delegate( shared(SocketListener) sender ) eventWhenStarted; --- An instance of SocketListener is created. auto listener = new shared SocketListener(); --- I defined a shared method that will be called when the event occurs.

Re: Objects(from classes) at Compile time? no gc

2014-05-15 Thread Tolga Cakiroglu via Digitalmars-d-learn
On Friday, 16 May 2014 at 04:59:46 UTC, Taylor Hillegeist wrote: The subject says it all really. i have this example: import core.memory; class fruit{ int value=5; public int getvalue(){ return value; } } int main(string[] args) { GC.disable; static fruit myfruit; return

Re: Reading ELF Files

2014-05-01 Thread Tolga Cakiroglu via Digitalmars-d-learn
On Thursday, 1 May 2014 at 11:38:50 UTC, Nordlöw wrote: Have anybody put together some D code for reading out tables from ELF files? A range/slice based version would be nice. I don't know this though, in the morning Ubuntu has showed updates. One of them was "libelf" which says in its descr

Re: async socket programming in D?

2014-04-20 Thread Tolga Cakiroglu via Digitalmars-d-learn
On Sunday, 20 April 2014 at 22:44:28 UTC, Bauss wrote: I know the socket has the nonblocking settings, but how would I actually go around using it in D? Is there a specific procedure for it to work correctly etc. I've taken a look at splat.d but it seems to be very outdated, so that's why I