Re: OT: why do people use python when it is slow?

2015-10-14 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 15 October 2015 at 02:20:42 UTC, jmh530 wrote: On Wednesday, 14 October 2015 at 22:11:56 UTC, data pulverizer wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting more

Re: Class, constructor and inherance.

2015-10-14 Thread Rikki Cattermole via Digitalmars-d-learn
On 15/10/15 5:43 PM, holo wrote: Please again, any example? I'm trying to figure out how it should be done but i don't have any base from which i can build some solution. #!/usr/bin/rdmd import std.stdio; interface RequestResult { int add (int x); } class B : RequestResult {

Re: Why isn't global operator overloading allowed in D?

2015-10-14 Thread WagonPassenger via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 15:02:02 UTC, Shriramana Sharma wrote: Hello. I just came upon a need in my program to make binary arithmetic operators valid between two real[] in my programs, and thought of writing a global opOpAssign, but then looked through the documentation, found nothing

Re: Class, constructor and inherance.

2015-10-14 Thread holo via Digitalmars-d-learn
Please again, any example? I'm trying to figure out how it should be done but i don't have any base from which i can build some solution. #!/usr/bin/rdmd import std.stdio; interface RequestResult { int add (int x); } class B : RequestResult { int add(int x) {

Re: Class, constructor and inherance.

2015-10-14 Thread Rikki Cattermole via Digitalmars-d-learn
On 15/10/15 4:45 PM, holo wrote: Just some ideas: interface RequestResult { ... } RequestResult go(string[string] requestParameters) Basically it is same what you wrote in one of first posts. Interface is for declaration of methods which need to be implemented in class. How in that case

Re: Class, constructor and inherance.

2015-10-14 Thread holo via Digitalmars-d-learn
Just some ideas: interface RequestResult { ... } RequestResult go(string[string] requestParameters) Basically it is same what you wrote in one of first posts. Interface is for declaration of methods which need to be implemented in class. How in that case is it possible to return Re

Re: Class, constructor and inherance.

2015-10-14 Thread Rikki Cattermole via Digitalmars-d-learn
On 15/10/15 8:15 AM, holo wrote: I want to ask you for advises what i could do with that class to make it looks more "pro"/elegant/build in "proper way". Probably there are lot of mistakes which all beginners are doing. eg.: Did i use interface correctly? You are reasonably close: credential

Re: OT: why do people use python when it is slow?

2015-10-14 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 22:11:56 UTC, data pulverizer wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting more widely. I believe it is easier and more effective to start

Re: OT: why do people use python when it is slow?

2015-10-14 Thread data pulverizer via Digitalmars-d-learn
On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting more widely. I am coming at D by way of R, C++, Python etc. so I speak as a statistician who is interested in data science application

Re: Tree datatype

2015-10-14 Thread cym13 via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 18:07:25 UTC, Meta wrote: The answer is more or less no, unless you sort of fake it like in cym13's example. A tree is not possible without pointers due to its recursive nature. Even if it looks like the implementation doesn't use pointers, they're just hidden u

Re: Class, constructor and inherance.

2015-10-14 Thread holo via Digitalmars-d-learn
I want to ask you for advises what i could do with that class to make it looks more "pro"/elegant/build in "proper way". Probably there are lot of mistakes which all beginners are doing. eg.: Did i use interface correctly? You are reasonably close: credential sig = new sigv4(); Why are y

Re: OT: why do people use python when it is slow?

2015-10-14 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 18:55:28 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 14 October 2015 at 18:37:40 UTC, Mengu wrote: websites? nope. like booking.com, airbnb.com, reddit.com are popular websites that have many parts which have to be dynamic and responsive as hell and they canno

Re: OT: why do people use python when it is slow?

2015-10-14 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 18:37:40 UTC, Mengu wrote: websites? nope. like booking.com, airbnb.com, reddit.com are popular websites that have many parts which have to be dynamic and responsive as hell and they cannot use caching, pre-generated content, etc. They can if they know what th

Re: OT: why do people use python when it is slow?

2015-10-14 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 15:49:20 UTC, David DeWitt wrote: I agree but the quora question ask why it is popular despite being slow and this is the reason. If you are doing tasks that are computationally expensive in Python then yes it will be slow but Python is popular largely because

Re: OT: why do people use python when it is slow?

2015-10-14 Thread Mengu via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 05:42:12 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting more widely. That's flaimbait: «Many really popular website

Re: OT: why do people use python when it is slow?

2015-10-14 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2015-10-14 at 14:48 +, John Colvin via Digitalmars-d-learn wrote: > On Wednesday, 14 October 2015 at 14:32:00 UTC, jmh530 wrote: > > On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc > > wrote: > > > https://www.quora.com/Why-is-Python-so-popular-despite-being-so-s > > > low >

Re: Tree datatype

2015-10-14 Thread Meta via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 14:42:31 UTC, Namal wrote: Hello, I don't remember exactly but I think when I first saw D code there was tree datatype implemented without pointers. Is it possible to make a tree struct without pointers? The answer is more or less no, unless you sort of fake

Re: OT: why do people use python when it is slow?

2015-10-14 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 15:54:49 UTC, Laeeth Isharc wrote: For a long time, Ola, I am done discussing with you. But I would ask you to take more responsibility for the effect of you words. The piece you quote is from the question, and not from what I wrote. You refer to it as flame

Re: Tree datatype

2015-10-14 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Oct 14, 2015 at 03:00:51PM +, Tobias Pankrath via Digitalmars-d-learn wrote: > On Wednesday, 14 October 2015 at 14:42:31 UTC, Namal wrote: > >Hello, > > > >I don't remember exactly but I think when I first saw D code there > >was tree datatype implemented without pointers. Is it possib

Re: OT: why do people use python when it is slow?

2015-10-14 Thread Laeeth Isharc via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 05:42:12 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting more widely. That's flaimbait: «Many really popular website

Re: OT: why do people use python when it is slow?

2015-10-14 Thread David DeWitt via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 15:31:49 UTC, John Colvin wrote: On Wednesday, 14 October 2015 at 15:25:22 UTC, David DeWitt wrote: On Wednesday, 14 October 2015 at 14:48:22 UTC, John Colvin wrote: On Wednesday, 14 October 2015 at 14:32:00 UTC, jmh530 wrote: On Tuesday, 13 October 2015 at 23:2

Re: OT: why do people use python when it is slow?

2015-10-14 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 15:25:22 UTC, David DeWitt wrote: On Wednesday, 14 October 2015 at 14:48:22 UTC, John Colvin wrote: On Wednesday, 14 October 2015 at 14:32:00 UTC, jmh530 wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Pytho

Re: Why isn't global operator overloading allowed in D?

2015-10-14 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 15:02:02 UTC, Shriramana Sharma wrote: Hello. I just came upon a need in my program to make binary arithmetic operators valid between two real[] in my programs What binary arithmetic operators do you need that real[] doesn't already support?

Re: OT: why do people use python when it is slow?

2015-10-14 Thread David DeWitt via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 14:48:22 UTC, John Colvin wrote: On Wednesday, 14 October 2015 at 14:32:00 UTC, jmh530 wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting more wid

Re: Why isn't global operator overloading allowed in D?

2015-10-14 Thread Shriramana Sharma via Digitalmars-d-learn
Shriramana Sharma wrote: > Hello. I just came upon a need in my program to make binary arithmetic > operators valid between two real[] in my programs, and thought of writing > a global opOpAssign, but then looked through the documentation, found > nothing on operator overloading allowed at the glo

Why isn't global operator overloading allowed in D?

2015-10-14 Thread Shriramana Sharma via Digitalmars-d-learn
Hello. I just came upon a need in my program to make binary arithmetic operators valid between two real[] in my programs, and thought of writing a global opOpAssign, but then looked through the documentation, found nothing on operator overloading allowed at the global level (even within a single

Re: Tree datatype

2015-10-14 Thread Tobias Pankrath via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 14:42:31 UTC, Namal wrote: Hello, I don't remember exactly but I think when I first saw D code there was tree datatype implemented without pointers. Is it possible to make a tree struct without pointers? struct Tree { Tree[] children; } That works quite w

Re: Tree datatype

2015-10-14 Thread cym13 via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 14:42:31 UTC, Namal wrote: Hello, I don't remember exactly but I think when I first saw D code there was tree datatype implemented without pointers. Is it possible to make a tree struct without pointers? If it is a binary tree, sure: just put your elements in

Tree datatype

2015-10-14 Thread Namal via Digitalmars-d-learn
Hello, I don't remember exactly but I think when I first saw D code there was tree datatype implemented without pointers. Is it possible to make a tree struct without pointers?

Re: OT: why do people use python when it is slow?

2015-10-14 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 14:32:00 UTC, jmh530 wrote: On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting more widely. I was just writing some R code yesterday after playing aroun

Re: OT: why do people use python when it is slow?

2015-10-14 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 13 October 2015 at 23:26:14 UTC, Laeeth Isharc wrote: https://www.quora.com/Why-is-Python-so-popular-despite-being-so-slow Andrei suggested posting more widely. I was just writing some R code yesterday after playing around with D for a couple weeks. I accomplished more in an aftern

Re: User input parsing

2015-10-14 Thread Joel via Digitalmars-d-learn
Thanks guys. I did think of regex, but I don't know how to learn it.

Re: User input parsing

2015-10-14 Thread Ali Çehreli via Digitalmars-d-learn
On 10/14/2015 12:14 AM, Joel wrote: Is there a fast way to get a number out of a text input? Like getting '1.5' out of 'sdaz1.5;['. Here's what I have at the moment: string processValue(string s) { string ns; foreach(c; s) { if

Re: User input parsing

2015-10-14 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 14 October 2015 at 07:14:45 UTC, Joel wrote: Is there a fast way to get a number out of a text input? Like getting '1.5' out of 'sdaz1.5;['. Here's what I have at the moment: string processValue(string s) { string ns;

User input parsing

2015-10-14 Thread Joel via Digitalmars-d-learn
Is there a fast way to get a number out of a text input? Like getting '1.5' out of 'sdaz1.5;['. Here's what I have at the moment: string processValue(string s) { string ns; foreach(c; s) {