Re: How to use "read_bool"?

2012-08-03 Thread Zeh
Thanks for the help, but i tryed both solutions posted and still not working. :/ I get erros to compile the code posted by simendsjo. I try modify at my own, but without success. The code suggest by Timon Gehr compiles, but not work. Honestly speaking, i didn't have enough knowledge to under

Re: Templates and stringof...

2012-08-03 Thread Era Scarecrow
On Friday, 3 August 2012 at 22:50:54 UTC, David Nadlinger wrote: On Friday, 3 August 2012 at 22:44:28 UTC, Andrej Mitrovic wrote: In fact, this should really be put into Phobos so everyone can benefit rather than implementing this internally as a private template of bitmanip. No, it shouldn't

Re: Templates and stringof...

2012-08-03 Thread Era Scarecrow
On Friday, 3 August 2012 at 22:47:52 UTC, David Nadlinger wrote: On Friday, 3 August 2012 at 22:23:23 UTC, Era Scarecrow wrote: Seems like an ugly hack though (to get this done). Why not have another method of fullpathStringof or something similar? Then again if this is one of the few cases tha

Re: Templates and stringof...

2012-08-03 Thread David Nadlinger
On Friday, 3 August 2012 at 22:44:28 UTC, Andrej Mitrovic wrote: On 8/4/12, Andrej Mitrovic wrote: Courtesy of Philippe Sigaud, slightly edited to my style: In fact, this should really be put into Phobos so everyone can benefit rather than implementing this internally as a private template

Re: Templates and stringof...

2012-08-03 Thread David Nadlinger
On Friday, 3 August 2012 at 22:23:23 UTC, Era Scarecrow wrote: Seems like an ugly hack though (to get this done). Why not have another method of fullpathStringof or something similar? Then again if this is one of the few cases that could benefit from it, then maybe we should make it ugly so no

Re: Templates and stringof...

2012-08-03 Thread David Nadlinger
On Friday, 3 August 2012 at 21:33:35 UTC, Era Scarecrow wrote: Because a string doesn't hold it's type information for size checking. int = 4 bytes or 32 bits string = Just emit the check into the code you generate. It also checks for unsuitable types like structs and floats; can't

Re: Templates and stringof...

2012-08-03 Thread Andrej Mitrovic
On 8/4/12, Andrej Mitrovic wrote: > On 8/3/12, Era Scarecrow wrote: >> Now, how do I get the template's stringof to print out 'i_num.i' >> and not 'i'? > > Courtesy of Philippe Sigaud, slightly edited to my style: In fact, this should really be put into Phobos so everyone can benefit rather th

Re: Templates and stringof...

2012-08-03 Thread Era Scarecrow
On Friday, 3 August 2012 at 22:18:25 UTC, Andrej Mitrovic wrote: On 8/4/12, Andrej Mitrovic wrote: On 8/3/12, Era Scarecrow wrote: Now, how do I get the template's stringof to print out 'i_num.i' and not 'i'? snip Ahh crap, it doesn't return the *instance* name. Sorry!! Maybe there ca

Re: Templates and stringof...

2012-08-03 Thread Andrej Mitrovic
On 8/4/12, Andrej Mitrovic wrote: > On 8/3/12, Era Scarecrow wrote: >> Now, how do I get the template's stringof to print out 'i_num.i' >> and not 'i'? > snip Ahh crap, it doesn't return the *instance* name. Sorry!! Maybe there can be a fix though, I'll give it a try..

Re: Templates and stringof...

2012-08-03 Thread Andrej Mitrovic
On 8/3/12, Era Scarecrow wrote: > Now, how do I get the template's stringof to print out 'i_num.i' > and not 'i'? Courtesy of Philippe Sigaud, slightly edited to my style: /** Return the fully qualified name of a symbol. Implemented by Philippe Sigaud in the D Templates book. See h

Re: Templates and stringof...

2012-08-03 Thread Era Scarecrow
On Friday, 3 August 2012 at 21:19:08 UTC, David Nadlinger wrote: On Friday, 3 August 2012 at 21:02:22 UTC, Era Scarecrow wrote: Now, how do I get the template's stringof to print out 'i_num.i' and not 'i'? You don't. Using .stringof in conjunction with string mixins is The Wrong Thing (tm) in

Re: Templates and stringof...

2012-08-03 Thread David Nadlinger
On Friday, 3 August 2012 at 21:02:22 UTC, Era Scarecrow wrote: Now, how do I get the template's stringof to print out 'i_num.i' and not 'i'? You don't. Using .stringof in conjunction with string mixins is The Wrong Thing (tm) in virtually all cases. What do you want to achieve? Why can't yo

Templates and stringof...

2012-08-03 Thread Era Scarecrow
While working on bitfields code I've found a unique scenario that poses some annoyances when generating the code. template XYZ(alias x) { enum XYZ = x.stringof ~ "=100;"; } struct I { int i;} I i_num; int n; mixin(XYZ!(i_num.i)); //cannot find variable i mixin(XYZ!(n)); the mixins beco

Re: How to use "read_bool"?

2012-08-03 Thread Era Scarecrow
On Friday, 3 August 2012 at 19:25:21 UTC, Ali Çehreli wrote: On 08/03/2012 12:17 PM, Philippe Sigaud wrote: > some of us could start a 2nd level translation (japanese, > russian, italian, german and french are likely possibilities). How timely! Crimson Sphere has just started the Korean tran

Re: How to use "read_bool"?

2012-08-03 Thread Ali Çehreli
On 08/03/2012 12:17 PM, Philippe Sigaud wrote: > some of us could start a 2nd level > translation (japanese, russian, italian, german and french are likely > possibilities). How timely! Crimson Sphere has just started the Korean translation: http://p-crimsonsphere.blogspot.kr/p/programming-in

Re: How to use "read_bool"?

2012-08-03 Thread Philippe Sigaud
On Fri, Aug 3, 2012 at 8:59 PM, bearophile wrote: > Money isn't just for money. Money has also effects on the mind of people :-) Well money is nothing but effect in our mind... I know that, for quite some time now, whenever I find a book as a free pdf and I like it, I make a point to buy it ane

Re: How to use "read_bool"?

2012-08-03 Thread bearophile
Ali Çehreli: No, the Turkish version is free as well. :) Some people complain that there is no way of showing material appreciation. Human psychology is not linear :-) Sometimes if you pay some (a little) money you think of it as more important. Sometimes if you have a way to give back to th

Re: How to use "read_bool"?

2012-08-03 Thread Ali Çehreli
On 08/03/2012 10:58 AM, simendsjo wrote: > Guess I should do this as you give away all your hard work for free. Thank you! I am making it better little by little every day. > Do you mind me asking why you give away the translation for free btw? I think all of the following: This is my project

Re: NotNull Parser

2012-08-03 Thread Namespace
No further suggestions or criticism?

Re: How to use "read_bool"?

2012-08-03 Thread simendsjo
On Fri, 03 Aug 2012 19:30:25 +0200, Ali Çehreli wrote: On 08/03/2012 09:12 AM, simendsjo wrote: > What tutorials is this? The function is at the very end of the following chapter: http://ddili.org/ders/d.en/logical_expressions.html Ali Ah, ok. I still haven't read the chapters you've

Re: How to use "read_bool"?

2012-08-03 Thread Ali Çehreli
On 08/03/2012 09:12 AM, simendsjo wrote: > What tutorials is this? The function is at the very end of the following chapter: http://ddili.org/ders/d.en/logical_expressions.html Ali

Re: How to use "read_bool"?

2012-08-03 Thread simendsjo
On Fri, 03 Aug 2012 08:05:46 +0200, Ali Çehreli wrote: On 08/02/2012 09:17 PM, Zeh wrote: > Hi, i am just a newbie trying learn D. But, i get having some trouble > with "read_bool". More specifically on program of this lesson: As Timon said, read_bool() is a separate function on the same pag

Re: NotNull Parser

2012-08-03 Thread Namespace
Object@ is a type, so if you write: void foo(Object@ o) {... It means the compiler statically refuses you to give a nullable type to foo. So inside foo there is no need for a run time test. Good work :-) Bye, bearophile Change line 14 from OpToken = r"\?", into OpToken = r"\@", And it wor

Re: NotNull Parser

2012-08-03 Thread bearophile
Timon Gehr: The notation 'T?' is normally used for a nullable type. Right. that's why I have suggested a trailing "@": http://d.puremagic.com/issues/show_bug.cgi?id=4571 Namespace: void foo(Object? o) { // do something with o } [/code] will

Re: NotNull Parser

2012-08-03 Thread Namespace
On Friday, 3 August 2012 at 10:53:02 UTC, Timon Gehr wrote: On 08/03/2012 12:38 PM, Namespace wrote: In context with my post here: http://forum.dlang.org/thread/gajrorlwnrriljxnx...@forum.dlang.org#post-egvyqwkcqjglhrvujkar:40forum.dlang.org I wrote the last days a NotNull Parser. What is this

Re: NotNull Parser

2012-08-03 Thread Timon Gehr
On 08/03/2012 12:38 PM, Namespace wrote: In context with my post here: http://forum.dlang.org/thread/gajrorlwnrriljxnx...@forum.dlang.org#post-egvyqwkcqjglhrvujkar:40forum.dlang.org I wrote the last days a NotNull Parser. What is this? The NotNull Parser generate for parameter statements with a

Re: NotNull Parser

2012-08-03 Thread Namespace
On Friday, 3 August 2012 at 10:42:48 UTC, David wrote: Yay Preprocessors <3 irony? :P

Re: Cannot build ws2_32.lib

2012-08-03 Thread Regan Heath
On Fri, 03 Aug 2012 07:00:25 +0100, Andre Tampubolon wrote: On 8/3/2012 12:31 AM, Regan Heath wrote: Have you downloaded and extracted a normal dmd 2.0 installation/zip? If so, you should have: \dmd2\windows\lib\ws2_32.lib and your \dmd2\windows\bin\sc.ini Actually I just solved t

Re: NotNull Parser

2012-08-03 Thread David
Yay Preprocessors <3

Re: Removing a pull...

2012-08-03 Thread Era Scarecrow
On Thursday, 2 August 2012 at 11:26:42 UTC, David Nadlinger wrote: Hm? You can just close pull requests (button at the bottom of the Page), and reopen them later. So I've removed the pull, but the auto tester is still pulling both code sources, so it's failing automatically because of it. Do