Re: Imports

2017-10-05 Thread Ali Çehreli via Digitalmars-d-learn
On 10/05/2017 03:34 PM, Jiyan wrote: > PS: is it spam to say thank you? Thank you for asking! :p I used to have strong feelings about this in the past. I still think it's spam; I don't expect any thanks from anyone and I think gratitude should be implied. Some people have different

Re: Imports

2017-10-05 Thread Jiyan via Digitalmars-d-learn
On Thursday, 5 October 2017 at 12:35:26 UTC, Mike Parker wrote: On Thursday, 5 October 2017 at 12:25:27 UTC, Mike Parker wrote: [...] Right. I had to go back and look at what I wrote in Learning D, which is the last (and only) time I played around with the default module behavior. I always

Infuriating DUB/DMD build bug.

2017-10-05 Thread WhatMeWorry via Digitalmars-d-learn
I've got a github project and using DUB with DMD and I keep running into this problem. I've tried deleting the entire ...\AppData\Roaming\dub\packages folder, but the problem repeats the very next build attempt. Fetching derelict-util 2.0.6 (getting selected version)... Fetching derelict-ft

Re: Create uninitialized dynamic array

2017-10-05 Thread Igor Shirkalin via Digitalmars-d-learn
On Thursday, 5 October 2017 at 21:04:30 UTC, Adam D. Ruppe wrote: On Thursday, 5 October 2017 at 19:59:48 UTC, Igor Shirkalin wrote: Is there a pure way to make what I want? oh i almost forgot about this function too: http://dpldocs.info/experimental-docs/std.array.uninitializedArray.1.html

Re: Create uninitialized dynamic array

2017-10-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 5 October 2017 at 19:59:48 UTC, Igor Shirkalin wrote: Is there a pure way to make what I want? oh i almost forgot about this function too: http://dpldocs.info/experimental-docs/std.array.uninitializedArray.1.html import std.array; double[] arr =

Re: Create uninitialized dynamic array

2017-10-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 5 October 2017 at 20:52:00 UTC, Igor Shirkalin wrote: Doesn't it mean we have to avoid GC for such large blocks? And what if we need a lot blocks with less sizes? No, it can work, especially if you are on 64 bit. Just if it is trivial I'd malloc it, but if the lifetime is

Re: Create uninitialized dynamic array

2017-10-05 Thread Igor Shirkalin via Digitalmars-d-learn
On Thursday, 5 October 2017 at 20:19:15 UTC, Adam D. Ruppe wrote: On Thursday, 5 October 2017 at 19:59:48 UTC, Igor Shirkalin wrote: I want to quickly fill it with my own data and I do not want to waste CPU time to fill it with zeros (or some other value). You could always just allocate it

Re: Looking for a mentor in D

2017-10-05 Thread Igor Shirkalin via Digitalmars-d-learn
On Tuesday, 3 October 2017 at 06:54:01 UTC, eastanon wrote: I have been reading the D forums for a while and following on its amazing progress for a long time. Over time I have even written some basic D programs for myself, nothing major or earth shuttering. I have downloaded and read Ali's

Re: Create uninitialized dynamic array

2017-10-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 5 October 2017 at 19:59:48 UTC, Igor Shirkalin wrote: I want to quickly fill it with my own data and I do not want to waste CPU time to fill it with zeros (or some other value). You could always just allocate it yourself. Something that large is liable to be accidentally pinned

Re: Andrei's "The D Programming Language" book. Up to date?

2017-10-05 Thread Seb via Digitalmars-d-learn
On Wednesday, 4 October 2017 at 20:49:26 UTC, John Gabriele wrote: Hi all, This is my first message to this forum. And what a pleasure it is to be here. :) I was just looking around at what D books are available. I see that Andrei's "The D Programming Language" was published in 2010.

Create uninitialized dynamic array

2017-10-05 Thread Igor Shirkalin via Digitalmars-d-learn
Hello! Preface: I need 1G array of ints (or anything else). Problem: I want to quickly fill it with my own data and I do not want to waste CPU time to fill it with zeros (or some other value). I do like this: void main() { int[] data; // key code: data.length = SOMETHING; //

Re: Fun project (after a day of studying euclidean geometry) in Dlang

2017-10-05 Thread Tristan B. Kildaire via Digitalmars-d-learn
On Thursday, 5 October 2017 at 17:49:00 UTC, Tristan B. Kildaire wrote: On 2017/10/05 18:21, Tristan B. Kildaire wrote: On Thursday, 5 October 2017 at 16:00:52 UTC, Tristan B. Kildaire wrote: link to it somewhere. Beware this is my first bigg-ish program in D. You will probably laugh at

Re: Fun project (after a day of studying euclidean geometry) in Dlang

2017-10-05 Thread Tristan B. Kildaire via Digitalmars-d-learn
On 2017/10/05 18:21, Tristan B. Kildaire wrote: On Thursday, 5 October 2017 at 16:00:52 UTC, Tristan B. Kildaire wrote: link to it somewhere. Beware this is my first bigg-ish program in D. You will probably laugh at some of the things I did. Sadly it has nothing to do with Euclidean

Re: Emacs d-mode indentation, 2 spaces to 4?

2017-10-05 Thread John Gabriele via Digitalmars-d-learn
On Thursday, 5 October 2017 at 05:22:16 UTC, Ali Çehreli wrote: On 10/04/2017 09:57 PM, John Gabriele wrote: I'm using Emacs 25.2.2 with d-mode-20161022.717 on Debian Testing, and by default this mode indents by 2 spaces. Is there an easy way to configure it to use 4 spaces instead? I

Re: Emacs d-mode indentation, 2 spaces to 4?

2017-10-05 Thread John Gabriele via Digitalmars-d-learn
On Thursday, 5 October 2017 at 08:49:30 UTC, Aravinda VK wrote: On Thursday, 5 October 2017 at 04:57:09 UTC, John Gabriele wrote: I'm using Emacs 25.2.2 with d-mode-20161022.717 on Debian Testing, and by default this mode indents by 2 spaces. Is there an easy way to configure it to use 4

Re: Fun project (after a day of studying euclidean geometry) in Dlang

2017-10-05 Thread Tristan B. Kildaire via Digitalmars-d-learn
On Thursday, 5 October 2017 at 16:00:52 UTC, Tristan B. Kildaire wrote: link to it somewhere. Beware this is my first bigg-ish program in D. You will probably laugh at some of the things I did. Sadly it has nothing to do with Euclidean Geometry (maybe next time!). Will post a link as

Re: Sockets and the Promiscous Mode

2017-10-05 Thread Tristan B. Kildaire via Digitalmars-d-learn
On 2017/09/30 17:17, fichtknick wrote: Hello all only for learning purposes and my interest for deeper network programming. I wanted to write a program and filter the entire traffic in my network. I have a server and various computers in my network, but I dont know, as I in D the promiscous

Re: Sockets and the Promiscous Mode

2017-10-05 Thread Tristan B. Kildaire via Digitalmars-d-learn
On 2017/09/30 17:17, fichtknick wrote: Hello all only for learning purposes and my interest for deeper network programming. I wanted to write a program and filter the entire traffic in my network. I have a server and various computers in my network, but I dont know, as I in D the promiscous

Re: Sockets and the Promiscous Mode

2017-10-05 Thread Tristan B. Kildaire via Digitalmars-d-learn
On 2017/09/30 17:17, fichtknick wrote: Hello all only for learning purposes and my interest for deeper network programming. I wanted to write a program and filter the entire traffic in my network. I have a server and various computers in my network, but I dont know, as I in D the promiscous

Fun project (after a day of studying euclidean geometry) in Dlang

2017-10-05 Thread Tristan B. Kildaire via Digitalmars-d-learn
So I really felt like doing something in D today and decided to write a database engine. I am still working on the scheme/protocol/format for the database files (which is going well) (so far 111 lines of code in the `database.d` module). Next will be to finish the Database class up in said

Re: learning reflection in D

2017-10-05 Thread drug via Digitalmars-d-learn
05.10.2017 18:04, Adam D. Ruppe пишет: On Thursday, 5 October 2017 at 14:59:10 UTC, drug wrote: 1) why .stringof and typeid() is equal logically and different in fact? What is difference between them? Is it that stringof compile time and typeid runtime things? Anyway wouldn't it be better they

Re: learning reflection in D

2017-10-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 5 October 2017 at 14:59:10 UTC, drug wrote: 1) why .stringof and typeid() is equal logically and different in fact? What is difference between them? Is it that stringof compile time and typeid runtime things? Anyway wouldn't it be better they will equal both logically and

learning reflection in D

2017-10-05 Thread drug via Digitalmars-d-learn
https://run.dlang.io/is/8LbmzG 1) why .stringof and typeid() is equal logically and different in fact? What is difference between them? Is it that stringof compile time and typeid runtime things? Anyway wouldn't it be better they will equal both logically and literally? 2) Where do these

Re: Imports

2017-10-05 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 5 October 2017 at 12:25:27 UTC, Mike Parker wrote: And actually, now that I think about it, this is probably one of those situations where the defualt fails. So yes, you'll need a module name. Right. I had to go back and look at what I wrote in Learning D, which is the last

Re: Imports

2017-10-05 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 5 October 2017 at 12:18:57 UTC, Mike Parker wrote: Regardless, every module should have a module name at the top. There are situations where the inferred package & module names can't work. Ugh. Sorry, I mean for sourcePaths you have to pass `src` and not `dir`. And actually,

Re: Imports

2017-10-05 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 5 October 2017 at 12:17:23 UTC, Mike Parker wrote: On Thursday, 5 October 2017 at 11:44:00 UTC, Jiyan wrote: [...] But as i see it with sourcePaths the directories are not influencing the module names(in the directories except "source"), so "dir.sub" will just have the name

Re: Imports

2017-10-05 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 5 October 2017 at 11:44:00 UTC, Jiyan wrote: [...] But as i see it with sourcePaths the directories are not influencing the module names(in the directories except "source"), so "dir.sub" will just have the name "sub" is there a way around that, except naming every module like:

Re: Imports

2017-10-05 Thread Jiyan via Digitalmars-d-learn
On Thursday, 5 October 2017 at 00:28:32 UTC, Mike Parker wrote: On Wednesday, 4 October 2017 at 16:31:35 UTC, Jiyan wrote: [...] If you have this directory tree: - mylib -- pack1 --- a.d --- b.d pack2 - c.d [...] Thank you, i think i kinda got that :) But as i see it with

Re: Andrei's "The D Programming Language" book. Up to date?

2017-10-05 Thread Dukc via Digitalmars-d-learn
On Wednesday, 4 October 2017 at 20:49:26 UTC, John Gabriele wrote: Hi all, This is my first message to this forum. And what a pleasure it is to be here. :) I was just looking around at what D books are available. I see that Andrei's "The D Programming Language" was published in 2010.

Re: For fun: Expressive C++ 17 Coding Challenge in D

2017-10-05 Thread Biotronic via Digitalmars-d-learn
On Wednesday, 4 October 2017 at 19:20:12 UTC, Jesse Phillips wrote: On Wednesday, 4 October 2017 at 15:26:02 UTC, Ali Çehreli wrote: On 10/04/2017 02:04 AM, Biotronic wrote: ... Hey where is the list of features used e.g: ranges, ufcs... Features used: D. But sure, added them to the gist:

Re: Emacs d-mode indentation, 2 spaces to 4?

2017-10-05 Thread Aravinda VK via Digitalmars-d-learn
On Thursday, 5 October 2017 at 04:57:09 UTC, John Gabriele wrote: I'm using Emacs 25.2.2 with d-mode-20161022.717 on Debian Testing, and by default this mode indents by 2 spaces. Is there an easy way to configure it to use 4 spaces instead? Add below snippet to your .emacs file (add-hook