Re: Need help understanding exception...

2016-02-20 Thread sanjayss via Digitalmars-d-learn
On Sunday, 21 February 2016 at 06:24:54 UTC, sanjayss wrote: On Sunday, 21 February 2016 at 01:06:16 UTC, Ali Çehreli wrote: [...] Thanks. That helps. I am making the stdin non-blocking (but reverting it back before doing the readln()) -- maybe that is causing some problems. Will follow this

Re: Need help understanding exception...

2016-02-20 Thread sanjayss via Digitalmars-d-learn
On Sunday, 21 February 2016 at 01:06:16 UTC, Ali Çehreli wrote: On 02/20/2016 04:45 PM, sanjayss wrote: > [...] basically "line > [...] is saying. > [...] ioctls and > [...] this, but > [...] am doing > [...] issue). > [...] std.stdio.readlnImpl(shared(core.stdc.stdio._IO_FILE)*, ref > [...] Jud

immutable class can't override opEquals, workaround?

2016-02-20 Thread SimonN via Digitalmars-d-learn
Hi, immutable class A { int i; this(int arg) { i = arg; } override bool opEquals(Object rhsObj) { auto rhs = cast (immutable(A)) rhsObj; return rhs && i == rhs.i; } } Error by dmd 2.070: ./immutclass.d(4): Error: functi

Re: Need help understanding exception...

2016-02-20 Thread Ali Çehreli via Digitalmars-d-learn
On 02/20/2016 04:45 PM, sanjayss wrote: > I got the following exception on a line of code that is basically "line > = readln()" and need help in understanding what the exception is saying. > (I am playing around with stdio prior to this using unix ioctls and > maybe I am messing something up in th

Need help understanding exception...

2016-02-20 Thread sanjayss via Digitalmars-d-learn
I got the following exception on a line of code that is basically "line = readln()" and need help in understanding what the exception is saying. (I am playing around with stdio prior to this using unix ioctls and maybe I am messing something up in the process resulting in this, but understandin

Re: Why does partial ordering of overloaded functions not take return type into account?

2016-02-20 Thread cym13 via Digitalmars-d-learn
On Saturday, 20 February 2016 at 17:22:49 UTC, Mike Parker wrote: On Saturday, 20 February 2016 at 17:20:16 UTC, Mike Parker wrote: getValue(); It's not unusual to discard the return value when calling a function. Though a getter isn't a good example of this, of course. Oops. I somehow ha

Re: Status icon on Linux

2016-02-20 Thread Gerald via Digitalmars-d-learn
On Saturday, 20 February 2016 at 11:36:11 UTC, Mike Wey wrote: The documentation states we should use notifications, that means i'll probably need to add libnotify bindings to GtkD. Though sending notifications using DBus is also possible. (https://developer.gnome.org/notification-spec/) Depe

Re: Why does partial ordering of overloaded functions not take return type into account?

2016-02-20 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 20 February 2016 at 17:20:16 UTC, Mike Parker wrote: getValue(); It's not unusual to discard the return value when calling a function. Though a getter isn't a good example of this, of course. Oops. I somehow had it in my head that your example function was getValue(), rather t

Re: Why does partial ordering of overloaded functions not take return type into account?

2016-02-20 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 20 February 2016 at 15:47:27 UTC, Jeremy DeHaan wrote: With the case of auto of course there is ambiguity, you don't know which one to pick. In my example there should have been no ambiguity at all as only one of the overloads would actually compile. That is what confuses me and

Re: What happens if memory allocation fails?

2016-02-20 Thread Chris Wright via Digitalmars-d-learn
On Sat, 20 Feb 2016 16:58:02 +, Adam D. Ruppe wrote: > On Saturday, 20 February 2016 at 14:21:28 UTC, tcak wrote: >> What happens if memory allocation fails with "new" keyword? > > Be aware that memory allocation might never actually fail. It really > depends on the operating system. > > But

Re: Why does partial ordering of overloaded functions not take return type into account?

2016-02-20 Thread Chris Wright via Digitalmars-d-learn
On Sat, 20 Feb 2016 15:47:27 +, Jeremy DeHaan wrote: > If there are multiple overloads that have the same number of parameters, > a very simple addition to the rules of function overloading would be > "does it compile?" If only one overload compiles, use it. If more than > one compile, there i

Re: What happens if memory allocation fails?

2016-02-20 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 20 February 2016 at 14:21:28 UTC, tcak wrote: What happens if memory allocation fails with "new" keyword? Be aware that memory allocation might never actually fail. It really depends on the operating system. But if it did fail, it would throw OutOfMemoryError http://dpldocs.inf

Re: What happens if memory allocation fails?

2016-02-20 Thread Kagamin via Digitalmars-d-learn
Currently it crashes: https://issues.dlang.org/show_bug.cgi?id=1180

Re: Why does partial ordering of overloaded functions not take return type into account?

2016-02-20 Thread Jeremy DeHaan via Digitalmars-d-learn
On Saturday, 20 February 2016 at 12:29:21 UTC, Jonathan M Davis wrote: On Saturday, February 20, 2016 03:24:45 Jeremy DeHaan via Digitalmars-d-learn wrote: snip I'm unaware of any language that takes the return type into account when overloading. The type the expression test.thing() has to

Re: Alternate databases

2016-02-20 Thread yawniek via Digitalmars-d-learn
On Saturday, 20 February 2016 at 13:09:53 UTC, Andrew Edwards wrote: I'm searching for client drivers for the following databases. Are the any available? https://rethinkdb.com/docs/install-drivers/ http://docs.basho.com/riak/latest/dev/references/client-implementation/ Thanks, Andrew none fo

Re: Transposing a static array

2016-02-20 Thread maik klein via Digitalmars-d-learn
On Saturday, 20 February 2016 at 03:02:11 UTC, cym13 wrote: On Saturday, 20 February 2016 at 02:26:56 UTC, maik klein wrote: On Saturday, 20 February 2016 at 02:22:12 UTC, Ali Çehreli wrote: [...] Your "Method B" is how I did it too but how do I convert it back to a static array of float[2][

Re: problem with std.range.choose()

2016-02-20 Thread Ali Çehreli via Digitalmars-d-learn
On 02/20/2016 02:18 AM, Johannes Loher wrote: On Wednesday, 17 February 2016 at 01:35:34 UTC, Johannes Loher wrote: Hello, I have a problem with using std.range.choose(): When using std.range.choose() on a range R, for which hasElaborateCopyConstructor!R is true, then a postblit for the result

What happens if memory allocation fails?

2016-02-20 Thread tcak via Digitalmars-d-learn
This is not easy to try. So I need ask, maybe someone has experienced. What happens if memory allocation fails with "new" keyword? Does it throw an exception? throwable? All I want is to be able to catch OutOfMemory event, and take other steps based on that.

Alternate databases

2016-02-20 Thread Andrew Edwards via Digitalmars-d-learn
I'm searching for client drivers for the following databases. Are the any available? https://rethinkdb.com/docs/install-drivers/ http://docs.basho.com/riak/latest/dev/references/client-implementation/ Thanks, Andrew

Re: 111

2016-02-20 Thread Ivan Kazmenko via Digitalmars-d-learn
On Saturday, 20 February 2016 at 04:15:50 UTC, Lisa wrote: module main; import std.stdio; import std.math; int main() { int A, B, C; writef("A = "); readf("%lf", %A); writef("B = "); readf("%lf", %B); writef("C1= "); readf("%lf", %C);

Re: Why does partial ordering of overloaded functions not take return type into account?

2016-02-20 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, February 20, 2016 03:24:45 Jeremy DeHaan via Digitalmars-d-learn wrote: > module main; > > struct ThingOne > { > int thing = 1; > } > > struct ThingTwo > { > float thing = 2; > } > > > struct Test > { >ThingOne thing() > { >return ThingOne(); > } > > Thin

Re: Installing DUB on OSX

2016-02-20 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-02-20 04:21, Joel wrote: How do you do symbolic links? ln -s Replace and with the appropriate paths. -- /Jacob Carlborg

Re: Status icon on Linux

2016-02-20 Thread Mike Wey via Digitalmars-d-learn
On 02/20/2016 06:13 AM, Chris Wright wrote: I want a status icon for a Linux application. gtk.StatusIcon notes that it's deprecated (and doesn't work on MATE 1.8.2). What should I be using? The GTK developers have decided that we don't need no status icon, it would presumably mess up there b

Re: problem with std.range.choose()

2016-02-20 Thread Johannes Loher via Digitalmars-d-learn
On Wednesday, 17 February 2016 at 01:35:34 UTC, Johannes Loher wrote: Hello, I have a problem with using std.range.choose(): When using std.range.choose() on a range R, for which hasElaborateCopyConstructor!R is true, then a postblit for the result of std.range.choose() is created, which inclu