Re: Can't install DMD 2.060 on OS X 10.6.8

2012-09-17 Thread Jacob Carlborg
On 2012-09-18 04:41, Elias Zamaria wrote: I reported it, along with the console details, on the bug tracker. You can see it at http://d.puremagic.com/issues/show_bug.cgi?id=8682. I think it is kind of strange that I need to install a 3rd party app just to be able to install the compiler, especial

Re: undefined reference to `_D6deimos6python6Python12__ModuleInfoZ'

2012-09-17 Thread Ellery Newcomer
On 09/17/2012 04:16 PM, Ellery Newcomer wrote: With a deimos header file, I expect to need only to pass the dpath to it and the library it references to dmd, e.g. stuff - deimos - python - Python.d dmd -Istuff -L-lpython2.7 I should not need to actually pass stuff/deimos/python/Pytho

Re: Can't install DMD 2.060 on OS X 10.6.8

2012-09-17 Thread Elias Zamaria
I reported it, along with the console details, on the bug tracker. You can see it at http://d.puremagic.com/issues/show_bug.cgi?id=8682. I think it is kind of strange that I need to install a 3rd party app just to be able to install the compiler, especially considering that no one else seems t

Re: Compiler should error when goto over initialization?

2012-09-17 Thread Jesse Phillips
On Sunday, 16 September 2012 at 18:33:22 UTC, Iain Buclaw wrote: On Sunday, 16 September 2012 at 18:20:49 UTC, Jesse Phillips wrote: I'm thinking I this is supposed to be a compiler error and I should report as a bug: "It is illegal for a GotoStatement to be used to skip initializations."

undefined reference to `_D6deimos6python6Python12__ModuleInfoZ'

2012-09-17 Thread Ellery Newcomer
With a deimos header file, I expect to need only to pass the dpath to it and the library it references to dmd, e.g. stuff - deimos - python - Python.d dmd -Istuff -L-lpython2.7 I should not need to actually pass stuff/deimos/python/Python.d to dmd. Unfortunately, that is currently not

Re: lockstep alternative for StoppingPolicy.longest

2012-09-17 Thread Andrej Mitrovic
On 9/18/12, Andrej Mitrovic wrote: > On 9/18/12, Ali Çehreli wrote: >> Then .longest with zip seems to be the way to go. > > Ah ain't that cool. It looks like it works. What does it use for the > sentinel, Type.init perhaps? > Yep just tried with floats and returns NaN. Thanks again, Ali! :)

Re: lockstep alternative for StoppingPolicy.longest

2012-09-17 Thread Andrej Mitrovic
On 9/18/12, Ali Çehreli wrote: > Then .longest with zip seems to be the way to go. Ah ain't that cool. It looks like it works. What does it use for the sentinel, Type.init perhaps?

Re: lockstep alternative for StoppingPolicy.longest

2012-09-17 Thread Ali Çehreli
On 09/17/2012 03:51 PM, Andrej Mitrovic wrote: On 9/18/12, Ali Çehreli wrote: I think you actually want .shortest, no? No I want to continue iterating as long as one of the ranges is still not empty. I'm not doing just comparisons, once there's only one range that's not empty I have to do som

Re: lockstep alternative for StoppingPolicy.longest

2012-09-17 Thread Andrej Mitrovic
On 9/18/12, Andrej Mitrovic wrote: > On 9/18/12, Andrej Mitrovic wrote: >> foreach (aa, bb; lockstep(arr1, arr2)) >> { >> if (aa == sentinel) >> { >> if (aa % 2 == 0) > > Gah I've messed up the simple example. If aa was a sentinel then it > meant I wouldn't che

Re: lockstep alternative for StoppingPolicy.longest

2012-09-17 Thread Andrej Mitrovic
On 9/18/12, Andrej Mitrovic wrote: > foreach (aa, bb; lockstep(arr1, arr2)) > { > if (aa == sentinel) > { > if (aa % 2 == 0) Gah I've messed up the simple example. If aa was a sentinel then it meant I wouldn't check it at all, I'd try to check 'bb' instead.

Re: lockstep alternative for StoppingPolicy.longest

2012-09-17 Thread Andrej Mitrovic
On 9/18/12, Ali Çehreli wrote: > I think you actually want .shortest, no? No I want to continue iterating as long as one of the ranges is still not empty. I'm not doing just comparisons, once there's only one range that's not empty I have to do some special checks on its elements. In simple terms

Re: lockstep alternative for StoppingPolicy.longest

2012-09-17 Thread Ali Çehreli
On 09/17/2012 03:00 PM, Andrej Mitrovic wrote: I need to iterate through two arrays and do some special comparisons, but the arrays are not guaranteed to have the same length. lockstep doesn't work with the "longest" policy, e.g.: int[] a = [1, 2]; int[] b = [1, 2, 3]; foreach (aa, bb; lockstep

Re: Error: WndProc - nothrow

2012-09-17 Thread Andrej Mitrovic
On 9/17/12, Simon wrote: > You MUST NOT allow a D exception to > propagate out of the wndproc (or indeed any other Win32 callback > function) as the Win32 calling code has no idea how to process it and > you'll just get a crash. > That's just complete and utter bullshit. A try/catch can be set in

lockstep alternative for StoppingPolicy.longest

2012-09-17 Thread Andrej Mitrovic
I need to iterate through two arrays and do some special comparisons, but the arrays are not guaranteed to have the same length. lockstep doesn't work with the "longest" policy, e.g.: int[] a = [1, 2]; int[] b = [1, 2, 3]; foreach (aa, bb; lockstep(a, b, StoppingPolicy.longest)) // throws { } W

Re: Error: WndProc - nothrow

2012-09-17 Thread Simon
On 16/09/2012 23:32, cal wrote: On Sunday, 16 September 2012 at 22:08:53 UTC, deed wrote: Exactly. I couldn't remember seeing this error before. I've only used the dsource Win32 bindings, because there is often stuff missing from the phobos ones: http://www.dsource.org/projects/bindings/wiki/

Re: ref keys

2012-09-17 Thread Jonathan M Davis
On Monday, September 17, 2012 23:11:42 Namespace wrote: > I thought that "new A()" could be implicit immutable. Thanks for > reporting. I'm sure that there are places where the compiler theoretically could implicitly convert a class or struct instantiated with new to immutable (e.g. when it's us

Re: problems with nothrow

2012-09-17 Thread Jonathan M Davis
On Monday, September 17, 2012 22:59:31 Namespace wrote: > It seems that nothrow functions/methods which take a AA have some > problems with .length and opApply, but I'm not sure if I should > report it as a bug. > > Here the code: > http://dpaste.dzfl.pl/a61e721e > http://dpaste.dzfl.pl/3652fcc4

Re: ref keys

2012-09-17 Thread anonymous
On Monday, 17 September 2012 at 13:42:08 UTC, Namespace wrote: I can do: array[new A()] = 42; array[a1] = 23; Both lines are valid. But if I would access the elements later with their keys, I can't because I have not a valid key for the element 42, only for 23. so my suggestion is: allow ref

Re: ref keys

2012-09-17 Thread Namespace
I thought that "new A()" could be implicit immutable. Thanks for reporting.

Re: ref keys

2012-09-17 Thread Jonathan M Davis
On Monday, September 17, 2012 20:56:21 Namespace wrote: > As you can see here, you can change the key very easily: > http://dpaste.dzfl.pl/71697a23 It's a bug. It should already be reported somewhere, but I can't find it, so re-reported it: http://d.puremagic.com/issues/show_bug.cgi?id=8681 The

problems with nothrow

2012-09-17 Thread Namespace
It seems that nothrow functions/methods which take a AA have some problems with .length and opApply, but I'm not sure if I should report it as a bug. Here the code: http://dpaste.dzfl.pl/a61e721e http://dpaste.dzfl.pl/3652fcc4

Re: std.net.curl - how to set custom Content-Type?

2012-09-17 Thread Jonathan M Davis
On Monday, September 17, 2012 20:59:05 Johannes Pfau wrote: > addRequestHeader is quite dumb. It simply appends the header to a list. > So by just calling it again you would actually send 2 Content-Type > headers. So, you're suggesting to send 2 content headers? That can't be good. It might work,

Re: std.net.curl - how to set custom Content-Type?

2012-09-17 Thread Johannes Pfau
Am Mon, 17 Sep 2012 22:33:28 +0400 schrieb Dmitry Olshansky : > Recently was playing around with std.net.curl high-level API. > > One thing that is a blocker for me is (quoting the docs): > > @property void postData(const(char)[] data); > Specifying data to post when not using the onSend callbac

Re: ref keys

2012-09-17 Thread Namespace
As you can see here, you can change the key very easily: http://dpaste.dzfl.pl/71697a23 But even they would be immutable: I have still no guarantee that my key must be a lvalue. Or am I wrong? Otherwise I'm still for ref keys.

ctfe slicing

2012-09-17 Thread Ellery Newcomer
does it still copy the slice?

Re: ref keys

2012-09-17 Thread Jonathan M Davis
On Monday, September 17, 2012 15:42:55 Namespace wrote: > Until now it is possible to have const keys in assocative arrays, Keys are supposed to be immutable. If that's not enforced by the compiler, then it's a bug. Given the current issues with the implementation for AAs' it wouldn't surprise m

std.net.curl - how to set custom Content-Type?

2012-09-17 Thread Dmitry Olshansky
Recently was playing around with std.net.curl high-level API. One thing that is a blocker for me is (quoting the docs): @property void postData(const(char)[] data); Specifying data to post when not using the onSend callback. ... Content-Type will default to text/plain. Data is not converted or

Re: Get identifier of "this"

2012-09-17 Thread Jonathan M Davis
On Monday, September 17, 2012 19:43:24 Andre wrote: > Hi, > > assuming I have following constuct: > > public class Bank{ > public enum test() > { > return "writeln(\""~__traits(identfier, this)~"\");"; > } > } > > public static void main(){ > Bank b = new Bank; > mixin(b.test()); > } > > During

Re: Get identifier of "this"

2012-09-17 Thread Andre
On Monday, 17 September 2012 at 18:01:02 UTC, Andrej Mitrovic wrote: On 9/17/12, Andre wrote: Get identifier of "this" You can't really get that info at runtime, a class object isn't bound to a name, 'this' has no identifier. Symbols (like variables) have identifiers, not objects. ... Hi

Re: Get identifier of "this"

2012-09-17 Thread Andrej Mitrovic
On 9/17/12, Steven Schveighoffer wrote: > Please file, ICE should never occur. You're bound to find a small million of these when it comes to typos in templates. :) http://d.puremagic.com/issues/show_bug.cgi?id=8679

Re: Get identifier of "this"

2012-09-17 Thread Steven Schveighoffer
On Mon, 17 Sep 2012 14:01:35 -0400, Andrej Mitrovic wrote: Your original sample does cause a compiler ICE but I don't know if it's worth filing since the code was invalid. Please file, ICE should never occur. -Steve

Re: Get identifier of "this"

2012-09-17 Thread Andrej Mitrovic
On 9/17/12, Andre wrote: > Get identifier of "this" You can't really get that info at runtime, a class object isn't bound to a name, 'this' has no identifier. Symbols (like variables) have identifiers, not objects. > public class Bank{ Unnecessary, declarations are public by default. > pub

Get identifier of "this"

2012-09-17 Thread Andre
Hi, assuming I have following constuct: public class Bank{ public enum test() { return "writeln(\""~__traits(identfier, this)~"\");"; } } public static void main(){ Bank b = new Bank; mixin(b.test()); } During compile time, following code should be generated: writeln("b");

Re: Regarding type deduction

2012-09-17 Thread Jesse Phillips
On Monday, 17 September 2012 at 14:54:48 UTC, bearophile wrote: Do you think it's useful and possible to extend the D type inference (deduction) for templates to support something like this (I know there are different ways to do this in D)? struct Tree1 { static struct Node { int x; } } s

Regarding type deduction

2012-09-17 Thread bearophile
Do you think it's useful and possible to extend the D type inference (deduction) for templates to support something like this (I know there are different ways to do this in D)? struct Tree1 { static struct Node { int x; } } struct Tree2 { static struct Node { int x, y; } } void foo(T)(

ref keys

2012-09-17 Thread Namespace
Until now it is possible to have const keys in assocative arrays, e.g. Tile[const Vector2s], but it isn't possible to have ref keys, e.g. Tile[ref Vector2s]. If I have this code: [code] class A { } A a1 = new A(); int[A] array; [/code] I can do: array[new A()] = 42; array[a1] = 23; Both line

Re: Can't install DMD 2.060 on OS X 10.6.8

2012-09-17 Thread Jacob Carlborg
On 2012-09-17 08:49, Elias Zamaria wrote: "Check the Console"? How do I do that? What console are you referring to? /Applications/Utilities/Console.app Also, why is this installer on the official-looking download page if it doesn't work? Should whoever is in control of the page put this other