www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Made a Rage-Comic about D

reply David <d dav1d.de> writes:
http://cheezburger.com/6361837056

I stumbled across two of this "bugs" in less than one hour.
Jun 23 2012
next sibling parent reply "Bernard Helyer" <b.helyer gmail.com> writes:
Post code, that sounds interesting. Like, how does it even know 
what a string is? That information should have decayed. So it's 
either a compiler bug or a static assert gone awry*.






*or a false dichotomy
Jun 23 2012
parent reply David <d dav1d.de> writes:
Am 23.06.2012 13:43, schrieb Bernard Helyer:
 Post code, that sounds interesting. Like, how does it even know what a
 string is? That information should have decayed. So it's either a
 compiler bug or a static assert gone awry*.






 *or a false dichotomy
The cool thing is, I wasn't able to track it down until now, since line numbers are completly messed up because of a heavy use of mixin() and CTFE.
Jun 23 2012
next sibling parent reply David <d dav1d.de> writes:
 The cool thing is, I wasn't able to track it down until now, since line
 numbers are completly messed up because of a heavy use of mixin() and CTFE.
s/until now/so far/
Jun 23 2012
parent David <d dav1d.de> writes:
Am 23.06.2012 13:49, schrieb David:
 The cool thing is, I wasn't able to track it down until now, since line
 numbers are completly messed up because of a heavy use of mixin() and
 CTFE.
s/until now/so far/
Seems like I did already fix that, https://github.com/D-Programming-Language/phobos/pull/482 Now I get linker errors, yay \o/
Jun 23 2012
prev sibling parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Saturday, June 23, 2012 13:46:51 David wrote:
 The cool thing is, I wasn't able to track it down until now, since line
 numbers are completly messed up because of a heavy use of mixin() and CTFE.
Which is why I _never_ put newlines in string mixins. - Jonathan M Davis
Jun 23 2012
parent reply "Robert Clipsham" <robert octarineparrot.com> writes:
On Saturday, 23 June 2012 at 23:37:11 UTC, Jonathan M Davis wrote:
 On Saturday, June 23, 2012 13:46:51 David wrote:
 The cool thing is, I wasn't able to track it down until now, 
 since line
 numbers are completly messed up because of a heavy use of 
 mixin() and CTFE.
Which is why I _never_ put newlines in string mixins. - Jonathan M Davis
#line is a godsend when working with string mixins. mixin(`#line ` ~ (30_000 + __LINE__).stringof ~ ` // Some really long code here // The line numbers will be correct but plus 30_000 // Making it fairly simple to debug. `); -- Robert http://octarineparrot.com/
Jun 23 2012
next sibling parent reply "Robert Clipsham" <robert octarineparrot.com> writes:
 #line is a godsend when working with string mixins.

 mixin(`#line ` ~ (30_000 + __LINE__).stringof ~ `
 // Some really long code here
 // The line numbers will be correct but plus 30_000
 // Making it fairly simple to debug.
 `);

 --
 Robert
 http://octarineparrot.com/
Actually, add another 1 to that, my bad! -- Robert http://octarineparrot.com/
Jun 23 2012
parent David <d dav1d.de> writes:
Am 24.06.2012 02:09, schrieb Robert Clipsham:
 #line is a godsend when working with string mixins.

 mixin(`#line ` ~ (30_000 + __LINE__).stringof ~ `
 // Some really long code here
 // The line numbers will be correct but plus 30_000
 // Making it fairly simple to debug.
 `);

 --
 Robert
 http://octarineparrot.com/
Actually, add another 1 to that, my bad! -- Robert http://octarineparrot.com/
Nice workaround, but I hope there will be sometime a proper solution in DMD :/ *dreams*
Jun 24 2012
prev sibling parent "David Nadlinger" <see klickverbot.at> writes:
On Sunday, 24 June 2012 at 00:08:27 UTC, Robert Clipsham wrote:
 // The line numbers will be correct but plus 30_000
You shouldn't do it with that value in std.datetime, though… :P David
Jun 23 2012
prev sibling parent reply "Tobias Pankrath" <tobias pankrath.net> writes:
On Saturday, 23 June 2012 at 11:22:26 UTC, David wrote:
 http://cheezburger.com/6361837056

 I stumbled across two of this "bugs" in less than one hour.
I am currently writing a sat solver for educational purposes and hit a handful of bugs both in dmd and phobos. Still not able to reduce all of them, so that I can report them. It sucks if you don't know whether it's a bug your you are doing something wrong with the language. At least they get fixed.
Jun 23 2012
next sibling parent reply d coder <dlang.coder gmail.com> writes:
On Sat, Jun 23, 2012 at 10:58 PM, Tobias Pankrath <tobias pankrath.net>wrote:

 I am currently writing a sat solver for educational purposes
How mature is the sat solver yet? Do you plan to release it at some point of time? Regards - Puneet
Jun 23 2012
parent "Tobias Pankrath" <tobias pankrath.net> writes:
On Saturday, 23 June 2012 at 17:47:04 UTC, d coder wrote:
 On Sat, Jun 23, 2012 at 10:58 PM, Tobias Pankrath 
 <tobias pankrath.net>wrote:

 I am currently writing a sat solver for educational purposes
How mature is the sat solver yet? Do you plan to release it at some point of time? Regards - Puneet
It was a DPLL with simple BCP yesterday and is a non functional blob today :-). I don't think I will push this to the state of the art. I plan for a conflict driver clause learning solver, that chooses variables like chaff and does non-chronological backtracking plus 2-watched-literal BCP. IF I have enough time to do this. I'm new to sat and need to understand all of the above first :-). If you need a mature one, it seems that minisat can be easily made available or ported to D. I'd do this, if it weren't for educational purposes.
Jun 23 2012
prev sibling parent David <d dav1d.de> writes:
Am 23.06.2012 19:28, schrieb Tobias Pankrath:
 On Saturday, 23 June 2012 at 11:22:26 UTC, David wrote:
 http://cheezburger.com/6361837056

 I stumbled across two of this "bugs" in less than one hour.
I am currently writing a sat solver for educational purposes and hit a handful of bugs both in dmd and phobos. Still not able to reduce all of them, so that I can report them. It sucks if you don't know whether it's a bug your you are doing something wrong with the language. At least they get fixed.
Yeah sometimes it's quite frustrating, but on the other hands you have those moments, fuck yeah it works! with a code which is unique to D, e.g. I was able to reduce a nearly 2k lines monster of a protocol implementation down to 300 lines with a heavy use of CTFE magic.
Jun 23 2012