[Issue 17766] New: Wrong choice of generic mutable/const/immutable methods

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17766 Issue ID: 17766 Summary: Wrong choice of generic mutable/const/immutable methods Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: real simple delegate question.

2017-08-19 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 19 August 2017 at 18:33:37 UTC, WhatMeWorry wrote: Or maybe another approach would be to ask, what type is the compiler replacing auto with. If you want to find out compile with `-vcg-ast`

Re: @safe(bool)

2017-08-19 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 20 August 2017 at 02:53:14 UTC, jmh530 wrote: On Sunday, 20 August 2017 at 00:55:41 UTC, Nicholas Wilson wrote: Sorry, I was referring to preconfigurations in druntime like https://github.com/dlang/DIPs/pull/89/files#diff-26bf588c0174e6cd0fe3d4af615bebdaL60 So modifying

Re: @safe(bool)

2017-08-19 Thread jmh530 via Digitalmars-d
On Sunday, 20 August 2017 at 00:55:41 UTC, Nicholas Wilson wrote: Sorry, I was referring to preconfigurations in druntime like https://github.com/dlang/DIPs/pull/89/files#diff-26bf588c0174e6cd0fe3d4af615bebdaL60 So modifying core.attribute.defaultAttributeSet in the runtime is the only way

Re: Quora

2017-08-19 Thread Jonathan M Davis via Digitalmars-d
On Saturday, August 19, 2017 15:17:52 Ecstatic Coder via Digitalmars-d wrote: > > Its called necro-posting. > > I'm surprised that post isn't read-only. > > Call it like you want, but I ee people putting new > answers/comments to years old posts all the times, as it's > perfectly legitimate on

Re: @safe(bool)

2017-08-19 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 20 August 2017 at 01:05:39 UTC, bitwise wrote: This is indeed, a nice solution. I am a _bit_ worried about abuse, and loss of modularity, but aside from that, I think it's a better solution overall. All features in the style of "I know what I'm doing, just let me do it!" (=void,

Re: jai-like CTFE string formating

2017-08-19 Thread Jerry via Digitalmars-d
On Sunday, 13 August 2017 at 19:51:31 UTC, Stefan Koch wrote: On Sunday, 13 August 2017 at 19:47:37 UTC, Jerry wrote: Seems like it'd be a good idea to pre compute all of phobos for compile time computations, as they should be changing. That would drastically reduce using any of phobos for

Re: void init of out variables

2017-08-19 Thread Nicholas Wilson via Digitalmars-d
On Saturday, 19 August 2017 at 23:05:26 UTC, Walter Bright wrote: On 8/18/2017 11:24 PM, Nicholas Wilson wrote: Hmm, I could, but ref doesn't signal intention like out does. True. Please file an enhancement request. https://issues.dlang.org/show_bug.cgi?id=17765 I also realised that ref

[Issue 17765] New: void initialisation of out parameters

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17765 Issue ID: 17765 Summary: void initialisation of out parameters Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity: enhancement

Re: @safe(bool)

2017-08-19 Thread bitwise via Digitalmars-d
On Sunday, 20 August 2017 at 00:49:28 UTC, Nicholas Wilson wrote: [...] With DIP 1012 you should be able to go struct Container(T, bool safetyOn = true) { static if(safe) RefCounted!(T[]) data; else T[] data; auto opSlice()

Re: @safe(bool)

2017-08-19 Thread Nicholas Wilson via Digitalmars-d
On Saturday, 19 August 2017 at 20:39:07 UTC, jmh530 wrote: On Saturday, 19 August 2017 at 13:09:41 UTC, Nicholas Wilson wrote: Hacking the runtime is certainly one way to achieve changing the default attributes. However having them as regular attributes means that is is possible to do

Re: @safe(bool)

2017-08-19 Thread Nicholas Wilson via Digitalmars-d
On Saturday, 19 August 2017 at 19:15:25 UTC, bitwise wrote: On Saturday, 19 August 2017 at 18:22:58 UTC, Guillaume Boucher wrote: On Thursday, 17 August 2017 at 16:32:20 UTC, bitwise wrote: In a high-performance context though, the performance hit may be unacceptable. Well in those super

Re: @safe(bool)

2017-08-19 Thread Nicholas Wilson via Digitalmars-d
On Saturday, 19 August 2017 at 17:10:54 UTC, bitwise wrote: I'm still concerned about having to read code that's laced full of custom attributes, the resolution of which may span several files, templates, etc. I also think this type of thing could have a detrimental effect on modularity when

[Issue 10523] Don't call array op functions for short vector ops

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10523 --- Comment #1 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/80513b41f815b4cc77fa279f63ea0feaad358041 convert array ops to library calls - capture expression tree

Re: void init of out variables

2017-08-19 Thread Walter Bright via Digitalmars-d
On 8/18/2017 11:24 PM, Nicholas Wilson wrote: On Saturday, 19 August 2017 at 06:23:10 UTC, Igor Shirkalin wrote: On Saturday, 19 August 2017 at 06:20:28 UTC, Nicholas Wilson wrote: I have a function that takes a large matrix as an out parameter. Is there a way to do `=void` for an out

[Issue 17764] [scope][DIP1000] Escape checker defeated by composition transformations

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17764 ZombineDev changed: What|Removed |Added Keywords||accepts-invalid,

[Issue 17764] New: [scope][DIP1000] Escape checker defeated by composition transformations

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17764 Issue ID: 17764 Summary: [scope][DIP1000] Escape checker defeated by composition transformations Product: D Version: D2 Hardware: All OS: All Status:

Re: Exception chaining and collectException

2017-08-19 Thread Nemanja Boric via Digitalmars-d
On Friday, 18 August 2017 at 22:51:35 UTC, Walter Bright wrote: On 8/18/2017 5:07 AM, Steven Schveighoffer wrote: If we are to remove them, what happens when exceptions would normally chain? In C++, throwing an exception while unwinding is a fatal error. Well, you still can throw it, but

Re: @safe(bool)

2017-08-19 Thread jmh530 via Digitalmars-d
On Saturday, 19 August 2017 at 13:09:41 UTC, Nicholas Wilson wrote: Hacking the runtime is certainly one way to achieve changing the default attributes. However having them as regular attributes means that is is possible to do configuration by version statements, which is a) much easier than

Re: LDC, ARM: unnecessary default initialization

2017-08-19 Thread Jack Applegame via Digitalmars-d
On Friday, 18 August 2017 at 17:28:38 UTC, kinke wrote: On Friday, 18 August 2017 at 12:09:04 UTC, kinke wrote: On Friday, 18 August 2017 at 09:42:25 UTC, Jack Applegame wrote: For some reason, the LDC default initializes the structure, even if initialization of all its members is specified as

[Issue 17762] Cannot compile with clean DMD.

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17762 Rainer Schuetze changed: What|Removed |Added Severity|critical|normal --- Comment #4

Re: @safe(bool)

2017-08-19 Thread bitwise via Digitalmars-d
On Saturday, 19 August 2017 at 18:22:58 UTC, Guillaume Boucher wrote: On Thursday, 17 August 2017 at 16:32:20 UTC, bitwise wrote: In a high-performance context though, the performance hit may be unacceptable. Well in those super rare situations, there's always the workaround with mixins:

[Issue 17762] Cannot compile with clean DMD.

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17762 Rainer Schuetze changed: What|Removed |Added CC||r.sagita...@gmx.de

[Issue 17763] [scope][DIP1000] The compiler treats implicit and explicit static array slicing differently

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17763 ZombineDev changed: What|Removed |Added Summary|[scope][DIP1000] Error: |[scope][DIP1000] The

Re: real simple delegate question.

2017-08-19 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 18 August 2017 at 20:39:38 UTC, angel wrote: On Friday, 18 August 2017 at 02:38:15 UTC, WhatMeForget wrote: [...] This actually appears correct ... The 1-st example: Each call to makeCalculator() increments a static (i.e. shared among all makeCalculator() instances) variable -

Re: @safe(bool)

2017-08-19 Thread Guillaume Boucher via Digitalmars-d
On Thursday, 17 August 2017 at 16:32:20 UTC, bitwise wrote: In a high-performance context though, the performance hit may be unacceptable. Well in those super rare situations, there's always the workaround with mixins: mixin template funcWithAttr(string decl, string attributes, string

Re: @safe(bool)

2017-08-19 Thread Guillaume Boucher via Digitalmars-d
On Saturday, 19 August 2017 at 16:02:27 UTC, bitwise wrote: We have to consider the potential for abuse. I don't like measuring features on the potential for abuse, but this feature cries for abuse. Even in the simpler form of your proposal. Let's say there are two functions with

[Issue 17763] [scope][DIP1000] Error: "cannot take address of scope local" while passing a slice to a scope parameter

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17763 ZombineDev changed: What|Removed |Added Keywords||accepts-invalid,

Re: Visual Studio Code code-d serve-d beta release

2017-08-19 Thread Soulsbane via Digitalmars-d-announce
On Saturday, 19 August 2017 at 13:07:41 UTC, WebFreak001 wrote: On Saturday, 19 August 2017 at 05:11:35 UTC, Soulsbane wrote: On Saturday, 19 August 2017 at 05:11:13 UTC, Soulsbane wrote: I got it working! Nice work so far except I no longer see any output in the extension Code Outline's[1]

Re: @safe(bool)

2017-08-19 Thread bitwise via Digitalmars-d
On Friday, 18 August 2017 at 23:48:05 UTC, Nicholas Wilson wrote: The only breaking changes are nothrow and pure get a leading '@'. They will go through a proper deprecation process and I will be very surprised if anything breaks. The new symbols added to core.attributes can use `@future` if

[Issue 17763] New: [scope][DIP1000] Error: "cannot take address of scope local" while passing a slice to a scope parameter

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17763 Issue ID: 17763 Summary: [scope][DIP1000] Error: "cannot take address of scope local" while passing a slice to a scope parameter Product: D Version: D2 Hardware: All

[Issue 17763] [scope][DIP1000] Error: "cannot take address of scope local" while passing a slice to a scope parameter

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17763 ZombineDev changed: What|Removed |Added Keywords||safe --

Re: dmd (v2.075.0): fully static linking: undefined reference to `__tls_get_addr'

2017-08-19 Thread Joakim via Digitalmars-d-learn
On Saturday, 19 August 2017 at 14:22:21 UTC, kdevel wrote: On Saturday, 19 August 2017 at 14:07:49 UTC, kdevel wrote: src/rt/sections_elf_shared.d:(.text._D2rt19sections_elf_shared11getTLSRangeFNbNimmZAv[_D2rt19sections_elf_shared11getTLSRangeFNbNimmZAv]+0x38): undefined reference to

Re: @safe(bool)

2017-08-19 Thread bitwise via Digitalmars-d
On Friday, 18 August 2017 at 18:15:33 UTC, Timon Gehr wrote: [...] alias naughty = AliasSeq!(impure,system,throws,gc); alias nice = AliasSeq!(pure,safe,nothrow,nogc); @nice void foo(); @naughty void bar(); We have to consider the potential for abuse. For example, D's templates are great -

Re: Quora

2017-08-19 Thread Ecstatic Coder via Digitalmars-d
Its called necro-posting. I'm surprised that post isn't read-only. Call it like you want, but I ee people putting new answers/comments to years old posts all the times, as it's perfectly legitimate on many blogs and websites. What was the best answer 10 years ago is often completely wrong

Re: Quora

2017-08-19 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 19 August 2017 at 15:08:41 UTC, rikki cattermole wrote: Its called necro-posting. I'm surprised that post isn't read-only. Stack Overflow (and sibling sites) explicitly encourage answering old questions (they will give you badges for it) because they get good search results and

Re: Quora

2017-08-19 Thread rikki cattermole via Digitalmars-d
On 19/08/2017 4:02 PM, Ecstatic Coder wrote: That is 6 years old. It would not help anybody to comment. Have you noticed that when you "google" something related to programming, the first results areĀ  often pages which are several years old ? If I understand you well, you are telling me to

Re: Quora

2017-08-19 Thread Ecstatic Coder via Digitalmars-d
That is 6 years old. It would not help anybody to comment. Have you noticed that when you "google" something related to programming, the first results are often pages which are several years old ? If I understand you well, you are telling me to let these pages unchanged. We shouldn't

Re: Quora

2017-08-19 Thread rikki cattermole via Digitalmars-d
On 19/08/2017 3:54 PM, Ecstatic Coder wrote: Or more likely some community members who have the privileges to remove answers, think that hype and "proof" of usage is more important than actual technical reasons. I suggest that you try to talk about D here :

Re: Quora

2017-08-19 Thread Ecstatic Coder via Digitalmars-d
Or more likely some community members who have the privileges to remove answers, think that hype and "proof" of usage is more important than actual technical reasons. I suggest that you try to talk about D here :

Re: Quora

2017-08-19 Thread rikki cattermole via Digitalmars-d
On 19/08/2017 3:38 PM, Ecstatic Coder wrote: On Saturday, 19 August 2017 at 11:33:13 UTC, Joakim wrote: On Saturday, 19 August 2017 at 11:00:25 UTC, Rico Decho wrote: Here is another one : https://www.quora.com/Which-language-is-best-for-a-beginner-programmer I don't think many people here

Re: Quora

2017-08-19 Thread Ecstatic Coder via Digitalmars-d
On Saturday, 19 August 2017 at 11:33:13 UTC, Joakim wrote: On Saturday, 19 August 2017 at 11:00:25 UTC, Rico Decho wrote: Here is another one : https://www.quora.com/Which-language-is-best-for-a-beginner-programmer I don't think many people here go to Quora, I know I don't. You answers

Re: dmd (v2.075.0): fully static linking: undefined reference to `__tls_get_addr'

2017-08-19 Thread kdevel via Digitalmars-d-learn
On Saturday, 19 August 2017 at 14:07:49 UTC, kdevel wrote: src/rt/sections_elf_shared.d:(.text._D2rt19sections_elf_shared11getTLSRangeFNbNimmZAv[_D2rt19sections_elf_shared11getTLSRangeFNbNimmZAv]+0x38): undefined reference to `__tls_get_addr' https://issues.dlang.org/show_bug.cgi?id=12268

Re: Different Output after each execution

2017-08-19 Thread Vino.B via Digitalmars-d-learn
On Friday, 18 August 2017 at 16:53:46 UTC, Moritz Maxeiner wrote: On Friday, 18 August 2017 at 15:46:13 UTC, Vino.B wrote: [...] Negating the filtering rule should yield you the inverse set: --- dirEntries(i, SpanMode.shallow).filter!(a => a.isDir).filter!(a => !globMatch(a.baseName,

Folder Size

2017-08-19 Thread Vino.B via Digitalmars-d-learn
Hi All, I have written a small program to find the size of folder's , but the output is not as expected, hence request your help and advice on any techniques to reduce the run time of the program. Requirement: The script has to scan several file system

dmd (v2.075.0): fully static linking: undefined reference to `__tls_get_addr'

2017-08-19 Thread kdevel via Digitalmars-d-learn
test.d --- void main () { } --- $ dmd -c test.d $ cc -o test test.o -L/[...]/dmd2/linux/lib64 -lphobos2 -static -lpthread -lrt /[...]/dmd2/linux/lib64/libphobos2.a(sections_elf_shared_774_420.o): In function `_D2rt19sections_elf_shared11getTLSRangeFNbNimmZAv':

[Issue 17762] Cannot compile with clean DMD.

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17762 --- Comment #2 from Vincent --- > The official releases for Windows are signed and not infected. Unfortunately, I already had infected visuald.exe and don't want my bad experience repeat, whatever you try to convince me. In any

Re: Visual Studio Code code-d serve-d beta release

2017-08-19 Thread WebFreak001 via Digitalmars-d-announce
On Saturday, 19 August 2017 at 05:11:35 UTC, Soulsbane wrote: On Saturday, 19 August 2017 at 05:11:13 UTC, Soulsbane wrote: I got it working! Nice work so far except I no longer see any output in the extension Code Outline's[1] pane. It works fine in the other version of code-d. I know this

Re: @safe(bool)

2017-08-19 Thread Nicholas Wilson via Digitalmars-d
On Saturday, 19 August 2017 at 02:00:47 UTC, jmh530 wrote: On Saturday, 19 August 2017 at 00:37:06 UTC, Nicholas Wilson wrote: Having to change the default attributes will be a rare occurrence (embedded (nothrow, nogc final) security critical (safe). My reading of that updated DIP is

[Issue 17762] Cannot compile with clean DMD.

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17762 greenify changed: What|Removed |Added CC||greeen...@gmail.com ---

[Issue 17762] New: Cannot compile with clean DMD.

2017-08-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17762 Issue ID: 17762 Summary: Cannot compile with clean DMD. Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: critical Priority:

Re: Quora

2017-08-19 Thread Joakim via Digitalmars-d
On Saturday, 19 August 2017 at 11:00:25 UTC, Rico Decho wrote: Here is another one : https://www.quora.com/Which-language-is-best-for-a-beginner-programmer I don't think many people here go to Quora, I know I don't. You answers were decent though.

Re: Module Info error

2017-08-19 Thread Mike Wey via Digitalmars-d-learn
On 19-08-17 04:07, Johnson Jones wrote: Still getting this! What I don't understand is why I can import certain libraries and they compile fine while others don't! So, moduleInfo is a "function" per module that is created at compilation, right? If one doesn't compile the module then the

Re: GtkD on android

2017-08-19 Thread Mike Wey via Digitalmars-d-learn
On 19-08-17 01:55, Johnson wrote: Hey Mike, have you put in thought or effort in to getting GtkD working on android? e.g., https://github.com/eugals/GTKAndroid/wiki/Building If I get around to it and no one has beating me before, I will try to compile something like the above and get the

Re: ffmpeg

2017-08-19 Thread Jolly James via Digitalmars-d-learn
On Saturday, 19 August 2017 at 02:50:44 UTC, Johnson Jones wrote: Trying to get it to work. You could just try to use/call the ffmeg executable as wrapper. For sure, not the best, but proabably the easiest solution. Afaik it also supports pipes.

Re: void init of out variables

2017-08-19 Thread kinke via Digitalmars-d
On Saturday, 19 August 2017 at 06:20:28 UTC, Nicholas Wilson wrote: is there a way to not assign to out variables? I don't think so. Is there a good reason not to return the matrix directly (taking advantage of in-place construction)? float[M][M] f() { float[M][M] mean = void; //

Re: Quora

2017-08-19 Thread Rico Decho via Digitalmars-d
Here is another one : https://www.quora.com/Which-language-is-best-for-a-beginner-programmer

Aedi 0.3.0 released

2017-08-19 Thread Alexandru Ermicioi via Digitalmars-d-announce
Good day, Announcing Aedi 0.3.0 release! Aedi is a dependency injection framework, aimed at easiness of use, easiness to extend, and easiness to integrate with existing tools. Following changes are included in 0.3.0 release: 1. New version of api to register and configure components

Using mixin templates for operator overloading.

2017-08-19 Thread Balagopal Komarath via Digitalmars-d-learn
Let us say I want to automatically define subtraction given that addition and negation are defined. I tried the following using mixin templates. If I simply mixin the template using "mixin sub;", then it gives the error tmpmixin.d(29): Error: incompatible types for ((a) - (b)): 'A!0' and

Quora

2017-08-19 Thread Rico Decho via Digitalmars-d
May I ask to those of you who actually agree that D is a nice language to learn programming and implement many kinds of applications to vote for my answers to the following questions on Quora ? https://www.quora.com/What-is-the-best-language-to-learn-as-a-beginner-programmer

Re: Some news from Dplug

2017-08-19 Thread Joakim via Digitalmars-d-announce
On Friday, 18 August 2017 at 12:45:34 UTC, Guillaume Piolat wrote: Some news from the audio front! Reminder: Dplug is a convenient library for creating audio plug-ins (VST / AU) for Mac, Windows and now Linux. Thanks to the effort of Richard Andrew Cattermole and Ethan Rekker, Dplug got

Re: void init of out variables

2017-08-19 Thread Nicholas Wilson via Digitalmars-d
On Saturday, 19 August 2017 at 06:23:10 UTC, Igor Shirkalin wrote: On Saturday, 19 August 2017 at 06:20:28 UTC, Nicholas Wilson wrote: I have a function that takes a large matrix as an out parameter. Is there a way to do `=void` for an out parameter like there is for is for a plain

void init of out variables

2017-08-19 Thread Nicholas Wilson via Digitalmars-d
I have a function that takes a large matrix as an out parameter. Is there a way to do `=void` for an out parameter like there is for is for a plain declaration? enum M = 2600; void f() { float[M] mean = void; // works as expected, mean is left uninitialised } void g(out float[M][M] corr)

Re: void init of out variables

2017-08-19 Thread Igor Shirkalin via Digitalmars-d
On Saturday, 19 August 2017 at 06:20:28 UTC, Nicholas Wilson wrote: I have a function that takes a large matrix as an out parameter. Is there a way to do `=void` for an out parameter like there is for is for a plain declaration? enum M = 2600; void f() { float[M] mean = void; // works as