Re: Is it possible to store different generic types in ex. an

2016-11-12 Thread Erik van Velzen via Digitalmars-d-learn
On Wednesday, 9 November 2016 at 15:44:59 UTC, Is it possible to store different generic types? wrote: Foo[] foos; // Where Foo of course should allow any generic version of Foo You can use an array of std.variant

[Issue 3880] std.regex functions with const/immutable Regex object

2016-11-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3880 Jakub Łabaj changed: What|Removed |Added Status|REOPENED|RESOLVED

VSCode D

2016-11-12 Thread bitwise via Digitalmars-d
Not sure if anyone else noticed: https://code.visualstudio.com/updates#_format-document-format-selection See last of the 5 thumbnails.

Re: VSCode D

2016-11-12 Thread WebFreak001 via Digitalmars-d
On Saturday, 12 November 2016 at 20:27:42 UTC, bitwise wrote: Not sure if anyone else noticed: https://code.visualstudio.com/updates#_format-document-format-selection See last of the 5 thumbnails. https://twitter.com/WebFreak001/status/793923181769809924

Third attempt for SUM

2016-11-12 Thread Ilya Yaroshenko via Digitalmars-d
Hi all, Advanced summation algorithms [3] from Mir project [1] are ready to be merged to Phobos. Many thanks to Walter Bright for the new Dlang floating point semantic [2]. Best regards, Ilya 1. https://github.com/libmir/mir 2. https://github.com/dlang/dmd/pull/6247 3.

High performance producer/consumer

2016-11-12 Thread Andrei Alexandrescu via Digitalmars-d
I got this reference from a colleague: https://multibuffer.codeplex.com/ Is there interest in porting this to D? Andrei

Re: Variable-Length Bit-Level Encoding

2016-11-12 Thread Nordlöw via Digitalmars-d-learn
On Saturday, 12 November 2016 at 19:13:13 UTC, Nordlöw wrote: Does anybody have a suggestion for an encoder that is more suitable for real-world values that are, for instance, normally distributed? Doh, forget the normal distribution thing here. It, of course, doesn't work with unsigned

Variable-Length Bit-Level Encoding

2016-11-12 Thread Nordlöw via Digitalmars-d-learn
I'm looking for libraries/snippets (either in D or similar languages) that perform variable-length encoding of unsigned integers onto a bit-stream. Requirement is that smaller inputs (integer values) should be encoded with equal or fewer bits. This 0 => [0] 1 => [1,0] 2 => [1,1,0] is easy

Re: Variable-Length Bit-Level Encoding

2016-11-12 Thread James Buren via Digitalmars-d-learn
On Saturday, 12 November 2016 at 19:13:13 UTC, Nordlöw wrote: Does anybody have a suggestion for an encoder that is more suitable for real-world values that are, for instance, normally distributed? I don't recall the name, but there is an algorithm for encoding data of an arbitrary number of

Re: High performance producer/consumer

2016-11-12 Thread deadalnix via Digitalmars-d
On Saturday, 12 November 2016 at 18:13:20 UTC, Andrei Alexandrescu wrote: I got this reference from a colleague: https://multibuffer.codeplex.com/ Is there interest in porting this to D? Andrei I wanted to provide one a few years back, but the lack of proper implementation of shared was a

Re: [OT] Re: CTFE Status

2016-11-12 Thread Jacob Carlborg via Digitalmars-d
On 2016-11-09 20:07, Nick Sabalausky wrote: Although I have my doubts it would explain all the issues I've hit upon with git's CLI. For example: I don't see why annotated tags aren't the default. Or why non-annotated ones even exist at all. When I made

Re: Article: Running D without its runtime

2016-11-12 Thread Russel Winder via Digitalmars-d-announce
On Fri, 2016-11-11 at 22:51 +, Guillaume Piolat via Digitalmars-d- announce wrote: > On Thursday, 10 November 2016 at 06:52:12 UTC, Olivier Pisano  > wrote: > > I cannot read your website on Firefox 45 (no text is  > > displayed). It works on chromium anyway. > > FWIW it should work now

Re: VSCode D

2016-11-12 Thread bitwise via Digitalmars-d
On Saturday, 12 November 2016 at 20:33:14 UTC, WebFreak001 wrote: On Saturday, 12 November 2016 at 20:27:42 UTC, bitwise wrote: Not sure if anyone else noticed: https://code.visualstudio.com/updates#_format-document-format-selection See last of the 5 thumbnails.

[Issue 9391] Constant std.regex.regex

2016-11-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9391 Jakub Łabaj changed: What|Removed |Added CC||repeate...@gmail.com ---

Re: Is it possible to store different generic types in ex. an

2016-11-12 Thread Charles Hixson via Digitalmars-d-learn
On 11/09/2016 07:46 AM, Is it possible to store different generic types? via Digitalmars-d-learn wrote: On Wednesday, 9 November 2016 at 15:44:59 UTC, Is it possible to store different generic types? wrote: Is it possible to store different generic types in ex. somekind of container such as an

Re: [OT] Re: CTFE Status

2016-11-12 Thread Jacob Carlborg via Digitalmars-d
On 2016-11-10 06:31, Dicebot wrote: I think it is related, but is not necessary consequence. My understanding is that for a long time command line design was given zero thoughts on its own - it was directly exposing whatever git does internally with no usability considerations. Which is why it

Re: [OT] Re: CTFE Status

2016-11-12 Thread Nick Sabalausky via Digitalmars-d
On 11/12/2016 11:02 AM, Jacob Carlborg wrote: On 2016-11-09 20:07, Nick Sabalausky wrote: Although I have my doubts it would explain all the issues I've hit upon with git's CLI. For example: I don't see why annotated tags aren't the default. Or why non-annotated ones even exist at all. When I

Re: Variable-Length Bit-Level Encoding

2016-11-12 Thread Era Scarecrow via Digitalmars-d-learn
On Saturday, 12 November 2016 at 19:13:13 UTC, Nordlöw wrote: 0 => [0] 1 => [1,0] 2 => [1,1,0] is easy but assumes a too extreme input value distribution. Does anybody have a suggestion for an encoder that is more suitable for real-world values that are, for instance, normally distributed?

Re: SecureD - A simple cryptography library for D

2016-11-12 Thread Adam Wilson via Digitalmars-d-announce
Suliman wrote: Is its possible to make its wrap on botan instead of openssl? Some of developers have problems with openssl because it's require openssl lib. But botan is more native but much more lowlevel. So its hard to use. It might be possible. But it would not be without difficulties. It

[Issue 12125] Win64 phobos has hard references to LIBCMT

2016-11-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12125 --- Comment #3 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/60cd8d2aa70e1c9cfd7c58fa42bce7345fd00b77 Merge pull request #4891 from rainers/nodefaultlib

SecureD - A simple cryptography library for D

2016-11-12 Thread Adam Wilson via Digitalmars-d-announce
Hello DLang, I wanted to announce that I have completed the bulk of the work on my Cryptography library for D, SecureD. I was inspired to do this project by Stan Drapkin and his Inferno.NET project, however, the two projects NOT compatible. GitHub: https://github.com/LightBender/SecureD

Re: SecureD - A simple cryptography library for D

2016-11-12 Thread Suliman via Digitalmars-d-announce
Is its possible to make its wrap on botan instead of openssl? Some of developers have problems with openssl because it's require openssl lib. But botan is more native but much more lowlevel. So its hard to use.

{DMD-AST-Tool} For beginning DDMD hackers

2016-11-12 Thread Stefan Koch via Digitalmars-d
Hi Guys, I have written a small utility called dmd-ast-tool. It can be used to quickly generate boilerplate code for dmd-ast-visitors. Originally it was only written for my personal use, it used to work with a handwritten text-file representing dmds ast class hierarchy. However I recently

static array internal & dangling reference

2016-11-12 Thread Picaud Vincent via Digitalmars-d-learn
Hi all, Still learning... This time what surprised me is how static arrays work. I assume (is it true?) that for efficiency reason static size arrays like int[10] are on the stack and do not involve dynamic memory allocation: First surprise: it is possible to share a static array: void

GitHub now supports editing the target branch for PR

2016-11-12 Thread Sönke Ludwig via Digitalmars-d
Not sure if this is common knowledge already, but it was new for me. If you click the edit button at the top of a pull request on GitHub, you now get a drop down to change the base branch to which the request will be pulled. Really handy for PRs that should be targeted at a stable branch, but

Re: static array internal & dangling reference

2016-11-12 Thread cym13 via Digitalmars-d-learn
On Saturday, 12 November 2016 at 10:33:05 UTC, Picaud Vincent wrote: Hi all, Still learning... This time what surprised me is how static arrays work. I assume (is it true?) that for efficiency reason static size arrays like int[10] are on the stack and do not involve dynamic memory

Re: UFCS for arguments other than first?

2016-11-12 Thread Heisenberg via Digitalmars-d
On Saturday, 12 November 2016 at 06:42:24 UTC, Temtaime wrote: You are wrong. We can use n1 for the second parameter. int someNumber(int a, int b) { return a + b; } int main() { int n1 = 5; return (n1.someNumber = n1); // 10 } In this specific case, yes - however: int

Re: UFCS for arguments other than first?

2016-11-12 Thread Heisenberg via Digitalmars-d
On Friday, 11 November 2016 at 23:27:30 UTC, Jonathan M Davis wrote: Ultimately, the only technical benefit from UFCS is that it allows you to call a function without caring whether it's a member function or a free function, which is of great benefit to generic code and not really much else.

Re: static array internal & dangling reference

2016-11-12 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 12 November 2016 at 10:33:05 UTC, Picaud Vincent wrote: Hi all, Still learning... This time what surprised me is how static arrays work. I assume (is it true?) that for efficiency reason static size arrays like int[10] are on the stack and do not involve dynamic memory

Re: static array internal & dangling reference

2016-11-12 Thread Picaud Vincent via Digitalmars-d-learn
Thank you for your answer cym13. I reproduced your result for: On Saturday, 12 November 2016 at 10:45:23 UTC, cym13 wrote: void f_test() { auto sb=f(); sb[2] = 100; writeln(sb[2]); // prints 100 int test[100]; writeln(sb[2]); // prints 0 } now I am convinced of the

Re: static array internal & dangling reference

2016-11-12 Thread Picaud Vincent via Digitalmars-d-learn
On Saturday, 12 November 2016 at 11:03:31 UTC, Mike Parker wrote: Thank you very much for your clarifications & explanations, I am reassured to see that things work like in C. I will also look the links you provided, thank you again for your time. Vincent

[Issue 16682] New: [REG 2.072] "privatization" of symbols in std.stdio breaks DFMT

2016-11-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16682 Issue ID: 16682 Summary: [REG 2.072] "privatization" of symbols in std.stdio breaks DFMT Product: D Version: D2 Hardware: All OS: Windows Status: NEW

Re: static array internal & dangling reference

2016-11-12 Thread Andrew via Digitalmars-d-learn
On Saturday, 12 November 2016 at 11:03:31 UTC, Mike Parker wrote: [...] You *have* created a dangling pointer. It's just that for such a simple little program, the part of the stack where the original array was allocated isn't stomped at the point where you access it after the function

Re: Trailing catch on function?

2016-11-12 Thread Anonymouse via Digitalmars-d
On Wednesday, 9 November 2016 at 09:49:08 UTC, Daniel N wrote: On Tuesday, 8 November 2016 at 16:02:25 UTC, Manu wrote: scope(failure) doesn't catch... how is that function nothrow? Seems like you overlooked Anonymouse's comment? scope(failure) catches just fine. scope(failure) return -1;

Re: Release D 2.072.0

2016-11-12 Thread Basile B. via Digitalmars-d-announce
On Monday, 31 October 2016 at 01:27:08 UTC, Martin Nowak wrote: Glad to announce D 2.072.0. http://dlang.org/download.html This is the release ships with the latest version of dub (v1.1.0), comes with lots of phobos additions and native TLS on OSX. See the changelog for more details.

[Issue 16478] Don't allow to!T() in constraint

2016-11-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16478 Nick Treleaven changed: What|Removed |Added CC||n...@geany.org

[Issue 16478] Don't allow to!T() in constraint

2016-11-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16478 Nick Treleaven changed: What|Removed |Added Keywords||pull URL|

Re: D-issapointed after using C# for a while.

2016-11-12 Thread Era Scarecrow via Digitalmars-d
On Saturday, 12 November 2016 at 03:59:08 UTC, Jonathan M Davis wrote: It would definitely be possible to make it so that std.bitmanip.bitfields could handle UDAs, but I don't expect that it would be particularly fun to implement. e.g. the example which is getting a bit ugly IMHO. But it

Re: static array internal & dangling reference

2016-11-12 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 12 November 2016 at 12:16:02 UTC, Andrew wrote: Bear in mind that static arrays are implicitly sliced when passed to or returned from a function anywhere a dynamic array is expected. If you modify f() to look like this: int[] f() { int[10] sa; foreach(int i, ref sa_i;sa){

Re: static array internal & dangling reference

2016-11-12 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 12 November 2016 at 13:11:02 UTC, Mike Parker wrote: void func2(int[] foo) { foo ~= 10; } Sorry, this should be (ref int[] foo)