Converting Fuse headers

2010-11-06 Thread Jesse Phillips
I'm trying to make fuse work in D[1]. I had some help from htod, but not everything was successful. And I'm not exactly sure how to properly convert strings and such. What I currently have allows me to compile some fuse programs (hello for example[2]). But the result is a dead link (only seem t

Re: check type

2010-11-06 Thread bearophile
spir: > class SC { > string f = "SC"; > void show() {writeln(this.f);} > } > class C : SC { > string f = "C"; > } > void main () { > auto c = new C(); > writeln(c.f) ; // OK, got "C" > c.show() ; // expected "C", got "SC" > > // below test for type > if (

Re: template mixins vs. string mixins

2010-11-06 Thread Trass3r
They are handly for boiler plate code that you sometimes just can't avoid. When you do that stuff template mixins are nicer to work with than string mixins Yeah, mixin string generation functions are just cumbersome and unreadable.

Re: check type

2010-11-06 Thread spir
On Sat, 06 Nov 2010 14:48:44 -0400 bearophile wrote: > spir: > > > What is the common idiom to check whether the type of a given element is > > what I expect? > > Seems that > > typeof(e) == Type > > is refused by the compiler, for any reason? I get > > DeeMatch.d(237): Error: type stri

example code fails, std.stream

2010-11-06 Thread Paul Ingelbrant
I have this little program: import std.stdio; import std.stream; void main () { Stream file = new BufferedFile("spec.txt"); foreach(ulong n, string line; file) { stdout.writefln("line %d: %s",n,line); } file.close(); } which is basicall a cut-n-paste from http://digitalmars.com/d/2.0/phobos/s

Re: check type

2010-11-06 Thread bearophile
spir: > What is the common idiom to check whether the type of a given element is what > I expect? > Seems that > typeof(e) == Type > is refused by the compiler, for any reason? I get > DeeMatch.d(237): Error: type string is not an expression I don't know why the language refuses a na

Re: check type

2010-11-06 Thread Adam Burton
spir wrote: > Hello, > > > What is the common idiom to check whether the type of a given element is > what I expect? Seems that > typeof(e) == Type > is refused by the compiler, for any reason? I get > DeeMatch.d(237): Error: type string is not an expression > I'm using > typeof(e).stringof == "

check type

2010-11-06 Thread spir
Hello, What is the common idiom to check whether the type of a given element is what I expect? Seems that typeof(e) == Type is refused by the compiler, for any reason? I get DeeMatch.d(237): Error: type string is not an expression I'm using typeof(e).stringof == "TypeName

Re: template mixins vs. string mixins

2010-11-06 Thread Jacob Carlborg
On 2010-11-06 11:13, Don wrote: Trass3r wrote: In the past template mixins were a neat special usecase of templates. Now with the "mixin template()" syntax they've become a separate thing because you can add special code for handling them, e.g. allowing them to add constructors to classes. The

Re: template mixins vs. string mixins

2010-11-06 Thread div0
On 06/11/2010 10:13, Don wrote: Trass3r wrote: In the past template mixins were a neat special usecase of templates. Now with the "mixin template()" syntax they've become a separate thing because you can add special code for handling them, e.g. allowing them to add constructors to classes. The

Re: template mixins vs. string mixins

2010-11-06 Thread Don
Trass3r wrote: In the past template mixins were a neat special usecase of templates. Now with the "mixin template()" syntax they've become a separate thing because you can add special code for handling them, e.g. allowing them to add constructors to classes. The question is: what is their rig

Re: template mixins vs. string mixins

2010-11-06 Thread Simen kjaeraas
Trass3r wrote: In the past template mixins were a neat special usecase of templates. Now with the "mixin template()" syntax they've become a separate thing because you can add special code for handling them, e.g. allowing them to add constructors to classes. The question is: what is thei

template mixins vs. string mixins

2010-11-06 Thread Trass3r
In the past template mixins were a neat special usecase of templates. Now with the "mixin template()" syntax they've become a separate thing because you can add special code for handling them, e.g. allowing them to add constructors to classes. The question is: what is their right to exist?