preprocessor pass equivalent?

2012-03-15 Thread Jay Norwood
Is there some option, similar to -E gcc option, that would generate the analogous listing for D? What I mean is that I'd like to see all the code in version blocks gone, all the mixin strings expanded. It is probably too much to wish for having the infered auto's expanded...

Re: preprocessor pass equivalent?

2012-03-15 Thread Dmitry Olshansky
On 15.03.2012 12:35, Jay Norwood wrote: Is there some option, similar to -E gcc option, that would generate the analogous listing for D? What I mean is that I'd like to see all the code in version blocks gone, all the mixin strings expanded. It is probably too much to wish for having the

Re: Vector Swizzling in D

2012-03-15 Thread Don Clugston
On 14/03/12 18:46, Boscop wrote: On Wednesday, 14 March 2012 at 17:35:06 UTC, Don Clugston wrote: In the last bit of code, why not use CTFE for valid(string s) instead of templates? bool valid(string s) { foreach(c; s) { if (c 'w' || c 'z') return false; } return true; } In fact you can use

Re: preprocessor pass equivalent?

2012-03-15 Thread Jacob Carlborg
On 2012-03-15 09:35, Jay Norwood wrote: Is there some option, similar to -E gcc option, that would generate the analogous listing for D? What I mean is that I'd like to see all the code in version blocks gone, all the mixin strings expanded. It is probably too much to wish for having the

Re: preprocessor pass equivalent?

2012-03-15 Thread Jacob Carlborg
On 2012-03-15 11:04, Jacob Carlborg wrote: On 2012-03-15 09:35, Jay Norwood wrote: Is there some option, similar to -E gcc option, that would generate the analogous listing for D? What I mean is that I'd like to see all the code in version blocks gone, all the mixin strings expanded. It is

Re: preprocessor pass equivalent?

2012-03-15 Thread Jonathan M Davis
On Thursday, March 15, 2012 09:35:46 Jay Norwood wrote: Is there some option, similar to -E gcc option, that would generate the analogous listing for D? What I mean is that I'd like to see all the code in version blocks gone, all the mixin strings expanded. It is probably too much to wish

Re: preprocessor pass equivalent?

2012-03-15 Thread Jay Norwood
On Thursday, 15 March 2012 at 10:09:25 UTC, Jacob Carlborg wrote: The Eclipse plugin, Descent, has a view that does something like this. Although I don't know how well it works for D2. It expands mixins, string mixins, replaces scope statements with try/catch/finally and other things. It

Re: preprocessor pass equivalent?

2012-03-15 Thread Adam D. Ruppe
On Thursday, 15 March 2012 at 08:35:48 UTC, Jay Norwood wrote: Is there some option, similar to -E gcc option, that would generate the analogous listing for D? You could add one to the compiler in just a few lines; there's already a function that does it, but it isn't called from anywhere.

Re: preprocessor pass equivalent?

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 02:51:33PM +0100, Adam D. Ruppe wrote: On Thursday, 15 March 2012 at 08:35:48 UTC, Jay Norwood wrote: Is there some option, similar to -E gcc option, that would generate the analogous listing for D? You could add one to the compiler in just a few lines; there's

Re: preprocessor pass equivalent?

2012-03-15 Thread Simen Kjærås
On Thu, 15 Mar 2012 14:34:19 +0100, Jay Norwood j...@prismnet.com wrote: I also found mention of a c++ compiler that someone states can compile c++ and output C. Kind of weird, but maybe compiling D to expanded D would not be such a stretch. That's how early C++ compilers worked.

Re: preprocessor pass equivalent?

2012-03-15 Thread Jacob Carlborg
On 2012-03-15 14:34, Jay Norwood wrote: On Thursday, 15 March 2012 at 10:09:25 UTC, Jacob Carlborg wrote: The Eclipse plugin, Descent, has a view that does something like this. Although I don't know how well it works for D2. It expands mixins, string mixins, replaces scope statements with

Re: preprocessor pass equivalent?

2012-03-15 Thread Trass3r
There's a pull request to help with debugging string mixins: https://github.com/D-Programming-Language/dmd/pull/426

Re: Vector Swizzling in D

2012-03-15 Thread Boscop
Thanks for the suggestions, I updated the article with an improved CTFE version at the end.

Re: DLL's and D

2012-03-15 Thread Chris Pons
Yes, this is a lot more clear, thanks. On Thursday, 15 March 2012 at 05:06:16 UTC, Mike Parker wrote: On 3/15/2012 12:26 PM, Chris Pons wrote: I haven't used DLL's much, especially one I've built on my own, so guidance would be appreciated. I'm trying to figure out how to build a DLL which

Confused about github rebasing

2012-03-15 Thread H. S. Teoh
I'm trying to submit a pull request for druntime, but I'm running into a git problem. This is what I did: - (I forgot that my master branch is out of date) - created a new branch for the fix and committed some changes - switched to master and ran 'git pull' - now master is ahead of the branch by

Re: Confused about github rebasing

2012-03-15 Thread Alex Rønne Petersen
On 15-03-2012 20:13, H. S. Teoh wrote: I'm trying to submit a pull request for druntime, but I'm running into a git problem. This is what I did: - (I forgot that my master branch is out of date) - created a new branch for the fix and committed some changes - switched to master and ran 'git

Re: DLL's and D

2012-03-15 Thread Chris Pons
Ok, I've actually run into another problem. I've decided to use a static library, since my project is small. I have added the path to the static library's .lib file in my project properties, just like with derelict2. However, I'm not sure how to use import properly. The library in question

Re: Confused about github rebasing

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 08:59:57PM +0100, Alex Rønne Petersen wrote: On 15-03-2012 20:13, H. S. Teoh wrote: I'm trying to submit a pull request for druntime, but I'm running into a git problem. This is what I did: - (I forgot that my master branch is out of date) - created a new branch for

Re: Confused about github rebasing

2012-03-15 Thread Alex Rønne Petersen
On 15-03-2012 21:49, H. S. Teoh wrote: On Thu, Mar 15, 2012 at 08:59:57PM +0100, Alex Rønne Petersen wrote: On 15-03-2012 20:13, H. S. Teoh wrote: I'm trying to submit a pull request for druntime, but I'm running into a git problem. This is what I did: - (I forgot that my master branch is out

Re: Confused about github rebasing

2012-03-15 Thread Gour
On Thu, 15 Mar 2012 13:49:14 -0700 H. S. Teoh hst...@quickfur.ath.cx wrote: Another question. How to I repair my current history, which is all messed up now? By not using DVCS which allows you to rewrite history (hint: check Fossil). ;) Otoh, I do not know how much you are 'in love' wiht

Re: Confused about github rebasing

2012-03-15 Thread Alex Rønne Petersen
On 15-03-2012 21:53, Gour wrote: On Thu, 15 Mar 2012 13:49:14 -0700 H. S. Teohhst...@quickfur.ath.cx wrote: Another question. How to I repair my current history, which is all messed up now? By not using DVCS which allows you to rewrite history (hint: check Fossil). ;) It's perfectly

Re: Confused about github rebasing

2012-03-15 Thread Sean Cavanaugh
On 3/15/2012 3:56 PM, Alex Rønne Petersen wrote: On 15-03-2012 21:53, Gour wrote: On Thu, 15 Mar 2012 13:49:14 -0700 H. S. Teohhst...@quickfur.ath.cx wrote: Another question. How to I repair my current history, which is all messed up now? By not using DVCS which allows you to rewrite

Re: Confused about github rebasing

2012-03-15 Thread Jonathan M Davis
On Thursday, March 15, 2012 16:17:50 Sean Cavanaugh wrote: On 3/15/2012 3:56 PM, Alex Rønne Petersen wrote: On 15-03-2012 21:53, Gour wrote: On Thu, 15 Mar 2012 13:49:14 -0700 H. S. Teohhst...@quickfur.ath.cx wrote: Another question. How to I repair my current history, which is all

Re: Confused about github rebasing

2012-03-15 Thread Alex Rønne Petersen
On 15-03-2012 22:17, Sean Cavanaugh wrote: On 3/15/2012 3:56 PM, Alex Rønne Petersen wrote: On 15-03-2012 21:53, Gour wrote: On Thu, 15 Mar 2012 13:49:14 -0700 H. S. Teohhst...@quickfur.ath.cx wrote: Another question. How to I repair my current history, which is all messed up now? By not

Re: Confused about github rebasing

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 09:51:30PM +0100, Alex Rønne Petersen wrote: On 15-03-2012 21:49, H. S. Teoh wrote: [...] Another question. How to I repair my current history, which is all messed up now? That is, my branch has a whole bunch of commits I didn't make; how do I clean it up? Or is it

Re: DLL's and D

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 09:16:45PM +0100, Chris Pons wrote: Ok, I've actually run into another problem. I've decided to use a static library, since my project is small. I have added the path to the static library's .lib file in my project properties, just like with derelict2. However, I'm not

Re: Confused about github rebasing

2012-03-15 Thread Alex Rønne Petersen
On 15-03-2012 22:37, H. S. Teoh wrote: On Thu, Mar 15, 2012 at 09:51:30PM +0100, Alex Rønne Petersen wrote: On 15-03-2012 21:49, H. S. Teoh wrote: [...] Another question. How to I repair my current history, which is all messed up now? That is, my branch has a whole bunch of commits I didn't

Re: Confused about github rebasing

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 11:12:26PM +0100, Alex Rønne Petersen wrote: On 15-03-2012 22:37, H. S. Teoh wrote: [...] I did discover an interesting thing about git though... at one point in the cleanup process I accidentally reset 1 more commit than I had intended, and that commit had no other

Re: DLL's and D

2012-03-15 Thread Andrej Mitrovic
On 3/15/12, H. S. Teoh hst...@quickfur.ath.cx wrote: It's correct, albeit a bit ugly. To alleviate the ugliness, you can tell the compiler where the root directory for the library is supposed to be. For example, if you invoked dmd with -ILibraries/Math, then you'll be able to say:

Re: Shutting down thread with Socket blocking for connection

2012-03-15 Thread Danny Arends
You could have a look at my attempt: https://github.com/DannyArends/D-coding/tree/master/src/web

Build errors and VS Macros for Build Commands

2012-03-15 Thread Chris Pons
I've been playing around with VS Macros trying to step away from explicit declarations of library locations. I'm using a google repository as I would like to be able to work on projects either at my desktop or laptop without having to worry about specific library path locations. I tried

Re: Confused about github rebasing

2012-03-15 Thread Daniel Murphy
H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.719.1331847338.4860.digitalmars-d-le...@puremagic.com... Actually, I discovered that my origin/master branch was also broken (probably due to running the wrong git command in it in the past), because it had a bunch of commits

Re: Confused about github rebasing

2012-03-15 Thread H. S. Teoh
On Fri, Mar 16, 2012 at 01:43:52PM +1100, Daniel Murphy wrote: H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.719.1331847338.4860.digitalmars-d-le...@puremagic.com... Actually, I discovered that my origin/master branch was also broken (probably due to running the wrong

Re: Confused about github rebasing

2012-03-15 Thread James Miller
On 16 March 2012 16:35, H. S. Teoh hst...@quickfur.ath.cx wrote: [...] I used to have this problem all the time - now I have a script which checks out master and pulls with -ff-only (in all three repositories) giving me a nice big error if I accidentally committed to master. Although I think

Re: Confused about github rebasing

2012-03-15 Thread H. S. Teoh
On Fri, Mar 16, 2012 at 04:52:35PM +1300, James Miller wrote: [...] Generally I find that pulls should be rebased, ff-only, and local merges done with --no-ff. This means that you have merge history in the tree, which can be useful when trying to do code archaeology, and pulls are forced to be

Re: Confused about github rebasing

2012-03-15 Thread James Miller
On 16 March 2012 17:09, H. S. Teoh hst...@quickfur.ath.cx wrote: Generally I find that pulls should be rebased, ff-only, and local merges done with --no-ff. This means that you have merge history in the tree, which can be useful when trying to do code archaeology, and pulls are forced to be