Re: What is the design reasons for Not considering base class overloaded function?

2011-05-25 Thread Ali Çehreli
On 05/24/2011 10:28 PM, Matthew Ong wrote: However, when doing overload resolution, the functions in the base class are not considered: // ### Why Not? Since B is a subset of A, and within B itself methods inherited from A can be called. b.foo(1); // calls B.foo(long), since

Any example of using these Special Tokens?

2011-05-25 Thread Matthew Ong
Hi, I am not able make use of these 3 special tokens to print something. writefln(gshared: %s,__gshared); writefln(thread: %s,__thread); writefln(traits: %s,__traits); rc\Sample.d(128): expression expected, not '__gshared'

Any application shutdown hooks?

2011-05-25 Thread Matthew Ong
Hi, If I am writing a database library such as DSL, Data Service Layer, there is a need for me to do a good clean up for the connections/results sets/transactions that this library is currently handling. How ever, if another library/package somewhere else calls for a

Re: Any example of using these Special Tokens?

2011-05-25 Thread Jonathan M Davis
On 2011-05-25 01:29, Matthew Ong wrote: Hi, I am not able make use of these 3 special tokens to print something. writefln(gshared: %s,__gshared); writefln(thread: %s,__thread); writefln(traits: %s,__traits);

Re: What is the design reasons for Not considering base class overloaded

2011-05-25 Thread bearophile
Matthew Ong: This may sound inefficient, but since the D compiler knows all of the class hierarchy when generating code, all functions that are not overridden can be optimized to be non-virtual. This is pure theory, little more than advertisement. Also because D supports separate

Re: Any example of using these Special Tokens?

2011-05-25 Thread bearophile
Matthew Ong: I am not able make use of these 3 special tokens to print something. writefln(gshared: %s,__gshared); writefln(thread: %s,__thread); writefln(traits: %s,__traits); They are keywords, so it's like writing: writefln(traits: %s, for); Would some like to show me how this is

Re: Any example of using these Special Tokens?

2011-05-25 Thread Matthew Ong
On 5/25/2011 5:45 PM, bearophile wrote: Matthew Ong: I am not able make use of these 3 special tokens to print something. writefln(gshared: %s,__gshared); writefln(thread: %s,__thread); writefln(traits: %s,__traits); They are keywords, so it's like writing: writefln(traits: %s, for);

Re: Any example of using these Special Tokens?

2011-05-25 Thread dennis luehring
Am 25.05.2011 12:42, schrieb Matthew Ong: On 5/25/2011 5:45 PM, bearophile wrote: Matthew Ong: I am not able make use of these 3 special tokens to print something. writefln(gshared: %s,__gshared); writefln(thread: %s,__thread); writefln(traits: %s,__traits); They are keywords, so

Re: Any example of using these Special Tokens?

2011-05-25 Thread dennis luehring
Am 25.05.2011 10:29, schrieb Matthew Ong: Hi, I am not able make use of these 3 special tokens to print something. writefln(gshared: %s,__gshared); writefln(thread: %s,__thread); writefln(traits: %s,__traits); rc\Sample.d(128):

Re: Any example of using these Special Tokens?

2011-05-25 Thread Andrej Mitrovic
I think __thread might be an alias for thread local. Maybe it was used explicitly in D1 since D1 didn't have TLS by default?

Re: Any application shutdown hooks?

2011-05-25 Thread Steven Schveighoffer
http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve

Re: Any application shutdown hooks?

2011-05-25 Thread Matthew Ong
On 5/25/2011 11:13 PM, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve Static Destructor maybe executed when the class is being unloaded GC? Because this is a class level. It is more like the application level exit and such. That is not

Re: What is the design reasons for Not considering base class overloaded function?

2011-05-25 Thread Ali Çehreli
On 05/24/2011 11:42 PM, Jacob Carlborg wrote: Yes, but all declarations in classes or modules are public by default. Thanks for the correction. All this time I've been thinking the opposite. My understanding seemed correct, since most of the little programs that I've written have been in a

Re: Any application shutdown hooks?

2011-05-25 Thread Ali Çehreli
On 05/25/2011 08:35 AM, Matthew Ong wrote: On 5/25/2011 11:13 PM, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve Static Destructor maybe executed when the class is being unloaded GC? Because this is a class level. It is more like the

Re: Any application shutdown hooks?

2011-05-25 Thread Steven Schveighoffer
On Wed, 25 May 2011 11:35:51 -0400, Matthew Ong on...@yahoo.com wrote: On 5/25/2011 11:13 PM, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve Static Destructor maybe executed when the class is being unloaded GC? Because this is a class level.

Re: Any application shutdown hooks?

2011-05-25 Thread Steven Schveighoffer
On Wed, 25 May 2011 11:50:16 -0400, Ali Çehreli acehr...@yahoo.com wrote: On 05/25/2011 08:35 AM, Matthew Ong wrote: On 5/25/2011 11:13 PM, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve Static Destructor maybe executed when the class is

Re: Any application shutdown hooks?

2011-05-25 Thread Matthew Ong
On 5/25/2011 11:52 PM, Steven Schveighoffer wrote: If you want a static dtor that runs on every thread shutdown, use a normal static dtor. If you want one that runs on the entire application shutdown, use a shared static dtor. -Steve Module Destructor: Cool feature that I can consider to use

Re: Any application shutdown hooks?

2011-05-25 Thread Steven Schveighoffer
On Wed, 25 May 2011 11:52:14 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Wed, 25 May 2011 11:35:51 -0400, Matthew Ong on...@yahoo.com wrote: On 5/25/2011 11:13 PM, Steven Schveighoffer wrote: http://www.digitalmars.com/d/2.0/class.html#StaticDestructor -Steve Static

Re: Any application shutdown hooks?

2011-05-25 Thread Andrej Mitrovic
On 5/25/11, Steven Schveighoffer schvei...@yahoo.com wrote: If you want a static dtor that runs on every thread shutdown, use a normal static dtor. If you want one that runs on the entire application shutdown, use a shared static dtor. I saw some commits change a static dtor to a shared

Re: howto recompile dmd 2.053 for CentOS 5.x?

2011-05-25 Thread Lars Holowko
On Tue, May 24, 2011 at 5:30 PM, Nick Sabalausky a@a.a wrote: The DMD zips contain all the source code. You should be able to do this: - Unzip dmd.2.053.zip (or whatever other version you want) - Go into the 'src/dmd' directory - Compile dmd (For me, it's just make -f linux.mak, but I'm on a

Re: Any application shutdown hooks?

2011-05-25 Thread Matthew Ong
On 5/26/2011 12:23 AM, Andrej Mitrovic wrote: On 5/25/11, Steven Schveighofferschvei...@yahoo.com wrote: If you want a static dtor that runs on every thread shutdown, use a normal static dtor. If you want one that runs on the entire application shutdown, use a shared static dtor. I saw some