std.socket again

2009-10-07 Thread Sam Hu
Greetings! Is there anybody kindly write several pieces of code to demonstrate how to use socket in D2.Say ,just download the D main page and print the content in the console should be enough. I tried several days but still got lost.The sample accompany with DMD 2032/3 does not work . Thank

std.socket again

2009-10-07 Thread Sam Hu
Greetings! Is there anybody kindly write several pieces of code to demonstrate how to use socket in D2.Say ,just download the D main page and print the content in the console should be enough. I tried several days but still got lost.The sample accompany with DMD 2032/3 does not work . Thank

Re: Get template and its instantiation parameters

2009-10-07 Thread BCS
Hello Jarrett, On Wed, Oct 7, 2009 at 12:54 PM, BCS wrote: You could try parsing T.stringof at compiletime to extract the parts you need. This is *exactly* the kind of bullshit that I hate about string mixins. The question was how to do somthing now. If the best solution isn't that good

Re: Get template and its instantiation parameters

2009-10-07 Thread Christopher Wright
BCS wrote: Hello Michal, If one has a template instance, is it possible to get template name and parameter type that was used for instantiating, at compile time? consider: class List (T) {} List!(int) lst; Foo (lst); I want to create such template Foo which prints: List!(int) List int You

Re: Get template and its instantiation parameters

2009-10-07 Thread Michal Minich
On Wed, 07 Oct 2009 13:15:46 -0400, Jarrett Billingsley wrote: > On Wed, Oct 7, 2009 at 12:54 PM, BCS wrote: >> Hello Michal, >> >>> If one has a template instance, is it possible to get template name >>> and parameter type that was used for instantiating, at compile time? >>> >>> consider: >>> >

Re: How about macro == symbol for mixin statement? [was Re: Member functions C to D]

2009-10-07 Thread Bill Baxter
> On Wed, Oct 7, 2009 at 11:21 AM, Don wrote: >> By contrast, something like Nemerle macros are a kludge. The idea of >> providing a 'hook' into the compiler is a horrible hack. It exposes all >> kinds of compiler internals. Yes, it has nicer syntax. Are you talking specifically about the abilit

Re: How about macro == symbol for mixin statement? [was Re: Member functions C to D]

2009-10-07 Thread Jarrett Billingsley
On Wed, Oct 7, 2009 at 11:21 AM, Don wrote: > Steven Schveighoffer wrote: >> >> On Wed, 07 Oct 2009 09:17:59 -0400, Jarrett Billingsley >> wrote: >> >>> It's also insanely kludgy and ugly. Bleh. > > Ugly, yes. Kludgy, I don't think so. It's only a syntax issue. The basic > concept of passing meta

Re: Get template and its instantiation parameters

2009-10-07 Thread Jarrett Billingsley
On Wed, Oct 7, 2009 at 12:54 PM, BCS wrote: > Hello Michal, > >> If one has a template instance, is it possible to get template name >> and parameter type that was used for instantiating, at compile time? >> >> consider: >> >> class List (T) {} >> >> List!(int) lst; >> Foo (lst); >> I want to crea

Re: Get template and its instantiation parameters

2009-10-07 Thread BCS
Hello Michal, If one has a template instance, is it possible to get template name and parameter type that was used for instantiating, at compile time? consider: class List (T) {} List!(int) lst; Foo (lst); I want to create such template Foo which prints: List!(int) List int You could try pa

Re: How about macro == symbol for mixin statement? [was Re: Member functions C to D]

2009-10-07 Thread Don
Steven Schveighoffer wrote: On Wed, 07 Oct 2009 09:17:59 -0400, Jarrett Billingsley wrote: It's also insanely kludgy and ugly. Bleh. Ugly, yes. Kludgy, I don't think so. It's only a syntax issue. The basic concept of passing meta-code to the compiler in the form of raw text is simple: m

Get template and its instantiation parameters

2009-10-07 Thread Michal Minich
If one has a template instance, is it possible to get template name and parameter type that was used for instantiating, at compile time? consider: class List (T) {} List!(int) lst; Foo (lst); I want to create such template Foo which prints: List!(int) List int Something simiar for Arrays can

How about macro == symbol for mixin statement? [was Re: Member functions C to D]

2009-10-07 Thread Steven Schveighoffer
On Wed, 07 Oct 2009 09:17:59 -0400, Jarrett Billingsley wrote: It's also insanely kludgy and ugly. Bleh. If all a macro did was translate a scoped normal symbol to a mixin (or other macro) statement, would this take care of the ugliness? (would also be an insanely simple solution) i.e

Re: Member functions C to D

2009-10-07 Thread Jarrett Billingsley
On Wed, Oct 7, 2009 at 8:07 AM, Don wrote: > Craig Kuhnert wrote: >> >> downs Wrote: >> >>> Craig Kuhnert wrote: Hi I am trying to convert some code I wrote in C++ to D to give it a try and I have come across some code that I dont know how to convert. I have simplified the

Re: Member functions C to D

2009-10-07 Thread Don
Craig Kuhnert wrote: downs Wrote: Craig Kuhnert wrote: Hi I am trying to convert some code I wrote in C++ to D to give it a try and I have come across some code that I dont know how to convert. I have simplified the code to illustrate the problem I have. How do I do this in D? class IFieldSe

Re: Member functions C to D

2009-10-07 Thread Craig Kuhnert
downs Wrote: > Craig Kuhnert wrote: > > Hi > > I am trying to convert some code I wrote in C++ to D to give it a try and I > > have come across some code that I dont know how to convert. > > I have simplified the code to illustrate the problem I have. > > How do I do this in D? > > > > class IFi

Re: Getting started - D meta-program question

2009-10-07 Thread downs
Justin Johansson wrote: > Your code as below, using auto to declare a temporary var in an if statement, > ahh, nice, > didn't know that. > > if (auto res = dg(current.data)) > return res; > > What other statement types can you generalized use of auto like this to? > Sadly,

Re: Member functions C to D

2009-10-07 Thread downs
Craig Kuhnert wrote: > Hi > I am trying to convert some code I wrote in C++ to D to give it a try and I > have come across some code that I dont know how to convert. > I have simplified the code to illustrate the problem I have. > How do I do this in D? > > class IFieldSetter > { > public: >

Member functions C to D

2009-10-07 Thread Craig Kuhnert
Hi I am trying to convert some code I wrote in C++ to D to give it a try and I have come across some code that I dont know how to convert. I have simplified the code to illustrate the problem I have. How do I do this in D? class IFieldSetter { public: virtual void SetValue(void * object,