Re: Debugging compile time memory usage

2018-06-25 Thread Bauss via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 00:59:24 UTC, Nicholas Wilson wrote: On Sunday, 24 June 2018 at 14:16:26 UTC, Kamil Koczurek wrote: [...] If you were able to compile it with LDC and not DMD, then that is most likely due to the LDC executable being 64-bit (limited to available system RAM+swaps)

Re: 'static foreach' chapter and more

2018-06-25 Thread Bauss via Digitalmars-d-announce
On Tuesday, 26 June 2018 at 01:52:42 UTC, Ali Çehreli wrote: I've made some online improvements to "Programming in D" since September 2017. [...] Great work on the book and keeping it up to date!

Re: D hash table comparison benchmark

2018-06-25 Thread Nathan S. via Digitalmars-d
On Tuesday, 26 June 2018 at 03:45:27 UTC, Seb wrote: Did you by chance also benchmark it with other languages like C++, Go or Rust? I didn't since I was evaluating hashtable implementations for use in a D application. BTW I'm not sure what your plans are, but are you aware of this recent

Re: opDispatch and alias this

2018-06-25 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, June 26, 2018 03:17:37 aliak via Digitalmars-d wrote: > On Tuesday, 26 June 2018 at 03:07:08 UTC, aliak wrote: > > Also, what would the work around be for code that relies on > > opDispatch and alias this? And shouldn't the PR take in to > > account the "Deprecation process" and

[Issue 19027] New: iota(int.min, int.max).length is incorrect

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19027 Issue ID: 19027 Summary: iota(int.min, int.max).length is incorrect Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement

Re: Disappointing performance from DMD/Phobos

2018-06-25 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 26 June 2018 at 02:10:17 UTC, Manu wrote: Some code: - struct Entity { enum NumSystems = 4; struct SystemData { uint start, length; } SystemData[NumSystems] systemData; @property uint systemBits() const { return systemData[].map!(e =>

Re: D hash table comparison benchmark

2018-06-25 Thread Seb via Digitalmars-d
On Tuesday, 26 June 2018 at 02:53:22 UTC, Nathan S. wrote: With LDC2 the times for vibe.utils.hashmap and memutils.hashmap are suspiciously low, leading me to suspect that the optimizer might be omitting most of the work. Here are the figures without optimizations enabled. == Speed Ranking

Re: template sequence parameters treats member functions differently?

2018-06-25 Thread aliak via Digitalmars-d-learn
On Monday, 25 June 2018 at 18:59:37 UTC, Steven Schveighoffer wrote: On 6/25/18 2:51 PM, aliak wrote: On Monday, 25 June 2018 at 15:06:42 UTC, Steven Schveighoffer wrote: I don't see any reason why the alias is to the function and not the contexted function. I don't see how it's any

[Issue 19026] New: Aliasing an inner function gets context but aliasing a member function through instance does not

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19026 Issue ID: 19026 Summary: Aliasing an inner function gets context but aliasing a member function through instance does not Product: D Version: D2 Hardware: All

Re: Disappointing performance from DMD/Phobos

2018-06-25 Thread Nathan S. via Digitalmars-d
On Tuesday, 26 June 2018 at 02:20:37 UTC, Manu wrote: I optimised another major gotcha eating perf, and now this issue is taking 13% of my entire work time... bummer. Without disagreeing with you, ldc2 optimizes this fine. https://run.dlang.io/is/NJct6U const @property uint

Re: Disappointing performance from DMD/Phobos

2018-06-25 Thread David Bennett via Digitalmars-d
On Tuesday, 26 June 2018 at 02:10:17 UTC, Manu wrote: [snip] @property uint systemBits() const { return systemData[].map!(e => e.length).sum; } [snip] This property sum's 4 ints... that should be insanely fast. It should also be something like 5-8 lines of asm. Turns out, that call to

Re: opDispatch and alias this

2018-06-25 Thread aliak via Digitalmars-d
On Tuesday, 26 June 2018 at 03:07:08 UTC, aliak wrote: Also, what would the work around be for code that relies on opDispatch and alias this? And shouldn't the PR take in to account the "Deprecation process" and deprecate it first before banning it? Cheers, - Ali s/shouldn't/will

Re: Disappointing performance from DMD/Phobos

2018-06-25 Thread Jonathan M Davis via Digitalmars-d
On Monday, June 25, 2018 19:10:17 Manu via Digitalmars-d wrote: > Some code: > - > struct Entity > { > enum NumSystems = 4; > struct SystemData > { > uint start, length; > } > SystemData[NumSystems] systemData; > @property uint systemBits() const {

Re: opDispatch and alias this

2018-06-25 Thread aliak via Digitalmars-d
On Monday, 25 June 2018 at 23:13:12 UTC, Seb wrote: Apparently three years ago it was we decided to ban alias this and opDispatch in the same class. What are your thoughts on this now? Is anyone depending on using alias this + opDispatch together like e.g. in

Re: D hash table comparison benchmark

2018-06-25 Thread Nathan S. via Digitalmars-d
With LDC2 the times for vibe.utils.hashmap and memutils.hashmap are suspiciously low, leading me to suspect that the optimizer might be omitting most of the work. Here are the figures without optimizations enabled. == Speed Ranking using DMD (no optimizations) == 95 msecs built-in AA 168

Re: Disappointing performance from DMD/Phobos

2018-06-25 Thread Manu via Digitalmars-d
On Mon, 25 Jun 2018 at 19:10, Manu wrote: > > Some code: > - > struct Entity > { > enum NumSystems = 4; > struct SystemData > { > uint start, length; > } > SystemData[NumSystems] systemData; > @property uint systemBits() const { return

D hash table comparison benchmark

2018-06-25 Thread Nathan S. via Digitalmars-d
The below benchmarks come from writing 100 int-to-int mappings to a new hashtable then reading them back, repeated 10_000 times. The built-in AA doesn't deallocate memory when it falls out of scope but the other maps do. Benchmark code in next post. == Speed Ranking using LDC2 (optimized) ==

Re: D hash table comparison benchmark

2018-06-25 Thread Nathan S. via Digitalmars-d
Benchmark code: dub.sdl ``` name "hashbench" description "D hashtable comparison." dependency "emsi_containers" version="~>0.7.0" dependency "memutils" version="~>0.4.11" dependency "vibe-d:utils" version="~>0.8.4" dependency "jive" version="~>0.2.0" //dependency "collections" version="~>0.1.0"

Disappointing performance from DMD/Phobos

2018-06-25 Thread Manu via Digitalmars-d
Some code: - struct Entity { enum NumSystems = 4; struct SystemData { uint start, length; } SystemData[NumSystems] systemData; @property uint systemBits() const { return systemData[].map!(e => e.length).sum; } } Entity e; e.systemBits(); // <- call

Re: opDispatch and alias this

2018-06-25 Thread IgorStepanov via Digitalmars-d
On Tuesday, 26 June 2018 at 00:56:13 UTC, Jonathan M Davis wrote: On Monday, June 25, 2018 23:13:12 Seb via Digitalmars-d wrote: - Jonathan M Davis I've tried to fix this issue. If briefly there is one collision: Final alias this should be r-value: static struct S { int i; } void

Re: Phobos and the Tools repo are now on DUB

2018-06-25 Thread Seb via Digitalmars-d-announce
On Monday, 25 June 2018 at 21:34:43 UTC, Seb wrote: Phobos ... I forgot the links to the DUB registry: https://phobos.dub.pm https://dtools.dub.pm

'static foreach' chapter and more

2018-06-25 Thread Ali Çehreli via Digitalmars-d-announce
I've made some online improvements to "Programming in D" since September 2017. http://ddili.org/ders/d.en/index.html NOTE: The copies of the book at hard copy printers are not updated yet. If you order from Amazon etc. it will still be the OLD version. I need some more time to work on

Re: Debugging compile time memory usage

2018-06-25 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 24 June 2018 at 14:16:26 UTC, Kamil Koczurek wrote: I recently wrote a brainfuck compiler in D, which loads the BF source at compile time, performs some (simple) optimizations, translates everything to D and puts it into the source code with a mixin. I did manage to get some

Re: opDispatch and alias this

2018-06-25 Thread Jonathan M Davis via Digitalmars-d
On Monday, June 25, 2018 23:13:12 Seb via Digitalmars-d wrote: > Apparently three years ago it was we decided to ban alias this > and opDispatch in the same class. > What are your thoughts on this now? > Is anyone depending on using alias this + opDispatch together > like e.g. in

Re: Can I parse this kind of HTML with arsd.dom module?

2018-06-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 24 June 2018 at 03:46:09 UTC, Dr.No wrote: to make it work. But if anyone else know how to fix this, will be very welcome too! try it now. thanks to Sandman83 on github.

opDispatch and alias this

2018-06-25 Thread Seb via Digitalmars-d
Apparently three years ago it was we decided to ban alias this and opDispatch in the same class. What are your thoughts on this now? Is anyone depending on using alias this + opDispatch together like e.g. in https://github.com/dlang/phobos/pull/6596?

Re: Nullable!T with T of class type

2018-06-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, June 25, 2018 19:40:30 kdevel via Digitalmars-d-learn wrote: > Just stumbled over the following design: > > class S {...} > > class R { > >Nullable!S s; > > } > > s was checked in code like > > R r; > > if (r.s is null) >throw new Exception ("some

Associative Array that Supports upper/lower Ranges

2018-06-25 Thread Vijay Nayar via Digitalmars-d
I was in need of an associative array / dictionary object that could also support getting ranges of entries with keys below or above a given value. I couldn't find anything that would do this, and ended up using the RedBlackTree to store key/value pairs, and then wrap the relevant functions

Phobos and the Tools repo are now on DUB

2018-06-25 Thread Seb via Digitalmars-d-announce
Phobos -- It's now possible to access the latest version of Phobos's experimental packages through dub: ``` #!/usr/bin/env dub /++dub.sdl: dependency "phobos:checkedint" version="~master" +/ void main(string[] args) { import stdx.checkedint; // From latest Phobos import

[Issue 19025] Better definition of deallocateAll in ContiguousFreeList

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19025 mmcoma...@gmail.com changed: What|Removed |Added CC||mmcoma...@gmail.com --

[Issue 18034] SIMD optimization issues

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18034 mmcoma...@gmail.com changed: What|Removed |Added CC||mmcoma...@gmail.com --

Re: Visual D 0.47.0 released

2018-06-25 Thread Manu via Digitalmars-d-announce
On Sun, 24 Jun 2018 at 06:10, Rainer Schuetze via Digitalmars-d-announce wrote: > > Hi, > > a new release of Visual D has just been uploaded. Major changes are > > * improved Visual C++ project integration: better dependencies, >automatic libraries, name demangling > * new project wizard > *

[Issue 18953] Win32: extern(C++) struct destructor not called correctly through runtime

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18953 --- Comment #5 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3a4707b4b15743ff4a068fe5ac6b983b6ce042c4 fix issue 18953 - extern(C++) struct destructor not called

[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 18953] Win32: extern(C++) struct destructor not called correctly through runtime

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18953 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 18916] ICE using Typedef and __LINE__

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18916 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 18266] ICE: should allow reusing identifier in declarations in disjoint scopes in a function

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18266 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/5e18ed610d8d946c1718f591806342e933788559 Fix Issue 18266 - ICE: should allow reusing identifier in

[Issue 18984] Debugging stack struct's which are returned causes incorrect debuginfo.

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18984 --- Comment #7 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b3c9c561ce8a52b9997a0fef8912eecd296f8c32 fix issue 18984 - Debugging stack struct's which are returned

[Issue 18966] extern(C++) constructor should match C++ semantics assigning vtable

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18966 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/403d5f0148abe60ac1836da9038c18cebd8b8644 fix Issue 18966 - extern(C++) constructor should match C++

[Issue 18266] ICE: should allow reusing identifier in declarations in disjoint scopes in a function

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18266 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 18916] ICE using Typedef and __LINE__

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18916 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3b3e97904dd844d2c7546c528a4cb6fec19fe106 Fix Issue 18916 - ICE using Typedef and __LINE__

Re: foreach / mutating iterator - How to do this?

2018-06-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, June 25, 2018 17:29:23 Robert M. Münch via Digitalmars-d-learn wrote: > I have two foreach loops where the inner should change the iterator > (append new entries) of the outer. > > foreach(a, candidates) { > foreach(b, a) { > if(...) candidates ~= additionalCandidate; > } > }

[Issue 19025] New: Better definition of deallocateAll in ContiguousFreeList

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19025 Issue ID: 19025 Summary: Better definition of deallocateAll in ContiguousFreeList Product: D Version: D2 Hardware: All OS: All Status: NEW

Nullable!T with T of class type

2018-06-25 Thread kdevel via Digitalmars-d-learn
Just stumbled over the following design: class S {...} class R { : Nullable!S s; : } s was checked in code like R r; : if (r.s is null) throw new Exception ("some error message"); At runtime the following was caught: fatal error: caught

Re: template sequence parameters treats member functions differently?

2018-06-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/25/18 2:51 PM, aliak wrote: On Monday, 25 June 2018 at 15:06:42 UTC, Steven Schveighoffer wrote: I don't see any reason why the alias is to the function and not the contexted function. I don't see how it's any different from the ones which use inner functions. I can only agree - me no

Re: template sequence parameters treats member functions differently?

2018-06-25 Thread aliak via Digitalmars-d-learn
On Monday, 25 June 2018 at 15:06:42 UTC, Steven Schveighoffer wrote: On 6/24/18 5:19 PM, aliak wrote: [...] No, because the alias is an alias to the function, not the delegate. The act of taking the address creates the delegate, where the delegate's ptr is the context pointer (i.e. s),

Futures

2018-06-25 Thread Russel Winder via Digitalmars-d-learn
Hi, I am sure std.parallelism and vibe.d both have futures/channels/executors systems as there appears not to be anything in Phobos as a futures system. Or am I wrong here? What is needed is a futures system with a single threaded executor system that can be integrated with GtkD so as to make

[Issue 16987] ABI error wrt. COM interfaces returning structs

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16987 ki...@gmx.net changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

Re: overload .

2018-06-25 Thread aliak via Digitalmars-d-learn
On Monday, 25 June 2018 at 15:39:09 UTC, Mr.Bingo wrote: On Monday, 25 June 2018 at 13:58:54 UTC, aliak wrote: A.x is translated in to A.opDispatch!"x" with no args. So I guess you can overload or you can static if on a template parameter sequence: import std.stdio; struct S { auto

[Issue 18978] Cannot create new projects in 0.47.0-beta1

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18978 Thomas changed: What|Removed |Added Status|RESOLVED|VERIFIED --

Re: Visual D 0.47.0 released

2018-06-25 Thread kinke via Digitalmars-d-announce
On Sunday, 24 June 2018 at 13:08:53 UTC, Rainer Schuetze wrote: a new release of Visual D has just been uploaded Thanks Rainer, much appreciated. Looking forward to the many debugging improvements.

[Issue 18996] Inserting a type containing indirections into an std.container Array causes SIGILL(4). Illegal Instruction.

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18996 --- Comment #9 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/1b0af1ee6030b233eba7d29629c5ea995d5df944 Fix issue 18996 - ProtoGC should support removing

[Issue 19005] [REG2.081-b1] object.hashOf no longer works for std.datetime.date.Date

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19005 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 18996] Inserting a type containing indirections into an std.container Array causes SIGILL(4). Illegal Instruction.

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18996 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 19008] core.internal.convert.toUbyte doesn't work on enums

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19008 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/3e233e7e88bbf84d27cf87c33d94ab85f6f6fc12 Fix Issue 19008 - core.internal.convert.toUbyte

[Issue 19005] [REG2.081-b1] object.hashOf no longer works for std.datetime.date.Date

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19005 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/416d1dd1afc43ff423becca63801f5807e8efdb9 Fix Issue 19005 - [REG2.081-b1] object.hashOf no

[Issue 19008] core.internal.convert.toUbyte doesn't work on enums

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19008 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Making sense of recursion

2018-06-25 Thread ag0aep6g via Digitalmars-d-learn
On 06/25/2018 07:45 PM, zbr wrote: void mergeSort(int[] arr, int l, int r) {    if (l < r)   // 1    {   int m = l+(r-l)/2;    // 2   mergeSort(arr, l, m); // 3   mergeSort(arr, m+1, r);   // 4   merge(arr, l, m, r);  // 5   

Re: Making sense of recursion

2018-06-25 Thread Colin via Digitalmars-d-learn
On Monday, 25 June 2018 at 17:45:01 UTC, zbr wrote: Hi, this question is not specifically D related but I'll just ask anyway. Consider the following snippet: [...] Your mistake is in your visualization :-) But... more like: 0 < 4 ? true : mergeSort(0,2) && mergeSort(3, 4) And so on. I.e,

Making sense of recursion

2018-06-25 Thread zbr via Digitalmars-d-learn
Hi, this question is not specifically D related but I'll just ask anyway. Consider the following snippet: void mergeSort(int[] arr, int l, int r) { if (l < r) // 1 { int m = l+(r-l)/2;// 2 mergeSort(arr, l, m); // 3

Re: Phobos' std.conv.to-conversion from enum to string doesn't scale beyond hundreds of enumerators

2018-06-25 Thread Timoses via Digitalmars-d
On Monday, 25 June 2018 at 00:35:40 UTC, Jonathan M Davis wrote: On Sunday, June 24, 2018 23:53:09 Timoses via Digitalmars-d wrote: On Sunday, 24 June 2018 at 23:34:49 UTC, Per Nordlöw wrote: > Provided that > > __traits(allMembers, E) > > is a cheap operation as it's called once for every

Re: Bug on website code.dlang.org

2018-06-25 Thread Timoses via Digitalmars-d
On Monday, 25 June 2018 at 14:45:31 UTC, Miguel L wrote: Sorry, I don't know where is the right place to report a bug on the web site. I just noticed searching for "code" in code.dlang.org generates this crash: I suppose it's related to:

Re: foreach / mutating iterator - How to do this?

2018-06-25 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Jun 25, 2018 at 05:29:23PM +0200, Robert M. Münch via Digitalmars-d-learn wrote: > I have two foreach loops where the inner should change the iterator > (append new entries) of the outer. > > foreach(a, candidates) { > foreach(b, a) { > if(...) candidates ~=

Re: Code failing unknown reason out of memory, also recursive types

2018-06-25 Thread Mr.Bingo via Digitalmars-d-learn
On Monday, 25 June 2018 at 14:41:28 UTC, rikki cattermole wrote: Let me get this straight, you decided to max out your memory address space /twice over/ before you hit run time, and think that this would be a good idea? Well, that cause was suppose to allocate a dynamic array instead of a

Boston D presentation Wednesday 6/27

2018-06-25 Thread Steven Schveighoffer via Digitalmars-d-announce
Hi all, We are going to meet on 6/27 at 6 pm at the Capital One cafe in the Back Bay in Boston (https://www.capitalone.com/local/boston-backbay). Sameer Pradhan, a regular at the Boston D meetup group will show us his NLP tool that he is planning to port from Python to D, called OntoNotes.

Re: overload .

2018-06-25 Thread Mr.Bingo via Digitalmars-d-learn
On Monday, 25 June 2018 at 13:58:54 UTC, aliak wrote: On Monday, 25 June 2018 at 13:37:01 UTC, Mr.Bingo wrote: One can overload assignment and dispatch so that something like A.x = ... is valid when x is not a typical member but gets resolved by the above functions. Therefore, I can create

Re: Expanding tool (written in D) use, want advice

2018-06-25 Thread Vijay Nayar via Digitalmars-d
On Friday, 22 June 2018 at 14:45:46 UTC, Jesse Phillips wrote: Should I be looking more at the benefits of having D as a tool? It was a good choice for me since I know D so well (and other reasons at the time), but C# is a reasonable language in this space. I'm thinking, like should I go into

foreach / mutating iterator - How to do this?

2018-06-25 Thread Robert M. Münch via Digitalmars-d-learn
I have two foreach loops where the inner should change the iterator (append new entries) of the outer. foreach(a, candidates) { foreach(b, a) { if(...) candidates ~= additionalCandidate; } } The foreach docs state that the collection must not change during

Re: template sequence parameters treats member functions differently?

2018-06-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/24/18 5:19 PM, aliak wrote: Hi, I'm having some issues with template sequence parameters, it seems they are not typed as delegates inside a template, but are outside. I.e. template T(V...) {     alias T = typeof([0]); } struct S { void f() {} } S s; pragma(msg, T!(s.f)); // void

Bug on website code.dlang.org

2018-06-25 Thread Miguel L via Digitalmars-d
Sorry, I don't know where is the right place to report a bug on the web site. I just noticed searching for "code" in code.dlang.org generates this crash: https://code.dlang.org/search?q=code 500 - Internal Server Error Internal Server Error Internal error information:

Re: Code failing unknown reason out of memory, also recursive types

2018-06-25 Thread rikki cattermole via Digitalmars-d-learn
Let me get this straight, you decided to max out your memory address space /twice over/ before you hit run time, and think that this would be a good idea?

Code failing unknown reason out of memory, also recursive types

2018-06-25 Thread Mr.Bingo via Digitalmars-d-learn
import std.stdio; union Vector(T, size_t N = size_t.max) { import std.range, std.typecons, std.meta, std.algorithm, std.conv, std.math; static if (N == size_t.max) // For size_t.max sets N to be infinite/dynamic; { mixin("Tuple!("~"T,".repeat(N).join()~") data;");

Re: overload .

2018-06-25 Thread aliak via Digitalmars-d-learn
On Monday, 25 June 2018 at 13:37:01 UTC, Mr.Bingo wrote: One can overload assignment and dispatch so that something like A.x = ... is valid when x is not a typical member but gets resolved by the above functions. Therefore, I can create a member for assignment. How can I create a member

Re: VisualD / fatal error C1905: Front-End and Back-End are not compatible (have to use the same processor)

2018-06-25 Thread Robert M. Münch via Digitalmars-d-learn
With the latest releasae I still have the same problem. I really don't have any idea what the cause could be or how to fix it... Anyone? Viele Grüsse. Robert M. Münch On 2018-05-21 17:46:45 +, Robert M. Münch said: A project I can compile via the command line and dub, gives an error in

overload .

2018-06-25 Thread Mr.Bingo via Digitalmars-d-learn
One can overload assignment and dispatch so that something like A.x = ... is valid when x is not a typical member but gets resolved by the above functions. Therefore, I can create a member for assignment. How can I create a member for getting the value? A.x = 3; // Seems to get

Re: Wrapping a forward range in another forward range

2018-06-25 Thread Rudy Raab via Digitalmars-d-learn
On Sunday, 24 June 2018 at 21:28:06 UTC, aliak wrote: On Sunday, 24 June 2018 at 20:33:32 UTC, Rudy Raab wrote: So I have an XLSX (MS Excel 2007+ file format) library that I wrote (https://github.com/TransientResponse/dlang-xlsx) that I recently converted from std.xml to dxml. That went well

Re: Determine if CTFE or RT

2018-06-25 Thread Mr.Bingo via Digitalmars-d-learn
On Monday, 25 June 2018 at 10:49:26 UTC, Simen Kjærås wrote: On Monday, 25 June 2018 at 09:36:45 UTC, Martin Tschierschke wrote: I am not sure that I understood it right, but there is a way to detect the status of a parameter: My question was different, but I wished to get a ctRegex! or

Re: Parenthesis around if/for/while condition is not necessary

2018-06-25 Thread aliak via Digitalmars-d
On Monday, 25 June 2018 at 10:38:49 UTC, Basile B. wrote: On Monday, 25 June 2018 at 10:36:46 UTC, Basile B. wrote: On Sunday, 24 June 2018 at 23:08:15 UTC, aliak wrote: Wow nice, that was quick, would it be much more to make it so that braces are required with if statements that do not

[Issue 19018] Lexer allows invalid integer literals, like `0x`

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19018 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 19018] Lexer allows invalid integer literals, like `0x`

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19018 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/37ff0dc4376b1617066be6435ac3cedd86f7cc7f Fix Issue 19018 - deprecate invalid integer literal

Re: Determine if CTFE or RT

2018-06-25 Thread Simen Kjærås via Digitalmars-d-learn
On Monday, 25 June 2018 at 09:36:45 UTC, Martin Tschierschke wrote: I am not sure that I understood it right, but there is a way to detect the status of a parameter: My question was different, but I wished to get a ctRegex! or regex used depending on the expression: import

Re: Determine if CTFE or RT

2018-06-25 Thread ag0aep6g via Digitalmars-d-learn
On 06/25/2018 07:47 AM, Mr.Bingo wrote: The docs say that CTFE is used only when explicit, I was under the impression that it would attempt to optimize functions if they could be computed at compile time. The halting problem has nothing to do with this. The ctfe engine already complains when

Re: Parenthesis around if/for/while condition is not necessary

2018-06-25 Thread Basile B. via Digitalmars-d
On Sunday, 24 June 2018 at 23:08:15 UTC, aliak wrote: On Sunday, 24 June 2018 at 11:27:12 UTC, Basile B. wrote: On Saturday, 23 June 2018 at 06:24:29 UTC, Basile B. wrote: On Saturday, 23 June 2018 at 06:18:53 UTC, user1234 wrote: On Saturday, 23 June 2018 at 05:09:13 UTC, aedt wrote: On

Re: Parenthesis around if/for/while condition is not necessary

2018-06-25 Thread Basile B. via Digitalmars-d
On Monday, 25 June 2018 at 10:36:46 UTC, Basile B. wrote: On Sunday, 24 June 2018 at 23:08:15 UTC, aliak wrote: On Sunday, 24 June 2018 at 11:27:12 UTC, Basile B. wrote: On Saturday, 23 June 2018 at 06:24:29 UTC, Basile B. wrote: On Saturday, 23 June 2018 at 06:18:53 UTC, user1234 wrote: On

Re: Determine if CTFE or RT

2018-06-25 Thread Martin Tschierschke via Digitalmars-d-learn
On Monday, 25 June 2018 at 08:05:53 UTC, Mr.Bingo wrote: On Monday, 25 June 2018 at 07:02:24 UTC, Jonathan M Davis wrote: On Monday, June 25, 2018 05:47:30 Mr.Bingo via Digitalmars-d-learn wrote: The problem then, if D can't arbitrarily use ctfe, means that there should be a way to force ctfe

[Issue 18374] Add range functions to Nullable

2018-06-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18374 --- Comment #2 from Mitu --- (In reply to Seb from comment #1) > Are you aware of the new `apply`? > > https://dlang.org/changelog/2.080.0.html#std-typecons-nullable-apply > > It still would be great to have Nullable and ranges working nicely

Re: Phobos' std.conv.to-conversion from enum to string doesn't scale beyond hundreds of enumerators

2018-06-25 Thread Jonathan M Davis via Digitalmars-d
On Monday, June 25, 2018 07:43:53 Per Nordlöw via Digitalmars-d wrote: > On Monday, 25 June 2018 at 00:35:40 UTC, Jonathan M Davis wrote: > > Or if you want it to stay an AliasSeq, then just use Alias or > > AliasSeq on it. e.g. > > > > alias members = AliasSeq!(__traits(allMembers, E)); > >

Re: Determine if CTFE or RT

2018-06-25 Thread Mr.Bingo via Digitalmars-d-learn
On Monday, 25 June 2018 at 07:02:24 UTC, Jonathan M Davis wrote: On Monday, June 25, 2018 05:47:30 Mr.Bingo via Digitalmars-d-learn wrote: The problem then, if D can't arbitrarily use ctfe, means that there should be a way to force ctfe optionally! If you want to use CTFE, then give an enum

Re: Phobos' std.conv.to-conversion from enum to string doesn't scale beyond hundreds of enumerators

2018-06-25 Thread Per Nordlöw via Digitalmars-d
On Monday, 25 June 2018 at 07:43:53 UTC, Per Nordlöw wrote: On Monday, 25 June 2018 at 00:35:40 UTC, Jonathan M Davis wrote: Or if you want it to stay an AliasSeq, then just use Alias or AliasSeq on it. e.g. alias members = AliasSeq!(__traits(allMembers, E)); Thanks! Should we prefer this

Re: Phobos' std.conv.to-conversion from enum to string doesn't scale beyond hundreds of enumerators

2018-06-25 Thread Per Nordlöw via Digitalmars-d
On Monday, 25 June 2018 at 00:35:40 UTC, Jonathan M Davis wrote: Or if you want it to stay an AliasSeq, then just use Alias or AliasSeq on it. e.g. alias members = AliasSeq!(__traits(allMembers, E)); Thanks! Should we prefer this over enum members = [__traits(allMembers, E)]; ?

Re: Phobos' std.conv.to-conversion from enum to string doesn't scale beyond hundreds of enumerators

2018-06-25 Thread Per Nordlöw via Digitalmars-d
On Sunday, 24 June 2018 at 23:53:09 UTC, Timoses wrote: enum members = [_traits(allMembers, E)]; seems to work Great! Now becomes: @safe: /** Enumeration wrapper that uses optimized conversion to string (via `toString` * member). */ struct Enum(E) if (is(E == enum)) { @property

Re: Determine if CTFE or RT

2018-06-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, June 25, 2018 05:47:30 Mr.Bingo via Digitalmars-d-learn wrote: > The problem then, if D can't arbitrarily use ctfe, means that > there should be a way to force ctfe optionally! If you want to use CTFE, then give an enum the value of the expression you want calculated. If you want to do