Re: Code size without documentation comments and unittests

2017-02-25 Thread Jack Stouffer via Digitalmars-d
On Saturday, 25 February 2017 at 19:31:06 UTC, Andrei Alexandrescu wrote: What would be a simple way to count the "effective" lines in a module, i.e. excluding ddoc comments and unittests? Having a tool for that in tools/ would be neat. -- Andrei Fun fact I found out using this thread: 57.4%

Re: Code size without documentation comments and unittests

2017-02-25 Thread Jack Stouffer via Digitalmars-d
On Sunday, 26 February 2017 at 05:50:32 UTC, Andrei Alexandrescu wrote: What am I missing? I installed dscanner from my package manager (homebrew), so I don't get any of the extra dub noise at all.

Re: DConf 2017 Early Bird Registration expires Monday!

2017-02-25 Thread Walter Bright via Digitalmars-d-announce
On 2/25/2017 7:08 PM, Adam Wilson wrote: On 2/24/17 11:02 PM, Walter Bright wrote: http://dconf.org/2017/registration.html Don't forget, it goes up to $400 after Monday. What do we do if we purchased three pass via EventBrite? I didn't see anywhere to set name/company info... You have

Re: assert with format considered harmful

2017-02-25 Thread Seb via Digitalmars-d
On Sunday, 26 February 2017 at 06:34:07 UTC, Ali Çehreli wrote: So, obviously, assert message generation is not lazy. This is a WAT! for me but perhaps there is a good reason for it. FWIW imho we shouldn't need to write such messages at all. It shouldn't be to difficult to lower `assert (a

Re: Code size without documentation comments and unittests

2017-02-25 Thread Seb via Digitalmars-d
On Sunday, 26 February 2017 at 05:50:32 UTC, Andrei Alexandrescu wrote: I might be missing something, so bear with me. My current understanding is: * The usual way to run stuff gotten via dub is with "dub run", so that people don't need to deal with version directories and complex paths such

assert with format considered harmful

2017-02-25 Thread Ali Çehreli via Digitalmars-d
If the generation of the error message throws, then the program receives a FormatException, not the most import AssertError: import std.string; void foo(int i) { // In this case a %s is forgotten but it could be any other trivial error. assert(i == 42, format("Bad parameter:", i)); }

Re: CTFE Status 2

2017-02-25 Thread Stefan Koch via Digitalmars-d
On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote: [ ... ] Hi Guys, ref variable handing is coming soon! (only int/uint for now)... Also I have suspicions that there is a bug in my ctfe_evaluator in which the first default arguments can overridden with the this pointer :)

[Issue 17226] New: Exception during the generation of an assert message hides AssertError

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17226 Issue ID: 17226 Summary: Exception during the generation of an assert message hides AssertError Product: D Version: D2 Hardware: x86_64 OS: Linux

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 02/26/2017 12:17 AM, Ola Fosheim Grostad wrote: On Saturday, 25 February 2017 at 22:37:15 UTC, Chris Wright wrote: The undefined behavior is what happens after the would-be assertion failure occurs. The compiler is free to emit code as if the assertion passed, or if there is no way for the

Re: Code size without documentation comments and unittests

2017-02-25 Thread Andrei Alexandrescu via Digitalmars-d
On 2/25/17 2:55 PM, Timothee Cour via Digitalmars-d wrote: Try dscanner --sloc although IMO --tokenCount should be the most relevant metric (only caveat is mixin strings with which one could cheat to make token count smaller). Thanks, got that working with ease. The operation of dub has gotten

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Ola Fosheim Grostad via Digitalmars-d
On Saturday, 25 February 2017 at 22:37:15 UTC, Chris Wright wrote: The undefined behavior is what happens after the would-be assertion failure occurs. The compiler is free to emit code as if the assertion passed, or if there is no way for the assertion to pass, it is free to do anything it

[Issue 6760] Disallow disabled overrides

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6760 --- Comment #5 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/9441e5a68bf473d7780bb2cab0c993f6819dc9ad issue 6760 - deprecate `@disable` on overridden and deprecated

[Issue 6760] Disallow disabled overrides

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6760 Walter Bright changed: What|Removed |Added CC|

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 02/25/2017 04:49 PM, Chris Wright wrote: It says it doesn't emit code for assertions. Then it says assertion failures are undefined behavior. How does that even work? Obviously the would-be failure. No need for the docs to be pedantic about everything. It'd read like the average RFC,

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 02/24/2017 12:47 PM, H. S. Teoh via Digitalmars-d wrote: The elephant in the room is that the recent craze surrounding the "cloud" has conveniently collected large numbers of online services under a small number of umbrellas, thereby greatly expanding the impact of any bug that occurs in the

[Issue 10547] DMD accepts function templates with no body.

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10547 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 10233] [Tracker] Grammar issues

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10233 Issue 10233 depends on issue 10547, which changed state. Issue 10547 Summary: DMD accepts function templates with no body. https://issues.dlang.org/show_bug.cgi?id=10547 What|Removed |Added

[Issue 9096] comsub bug with chained function calls, optimization and attributes

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9096 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 9306] __function alias

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9306 b2.t...@gmx.com changed: What|Removed |Added CC||b2.t...@gmx.com --- Comment #1 from

Re: DConf 2017 Early Bird Registration expires Monday!

2017-02-25 Thread Adam Wilson via Digitalmars-d-announce
On 2/24/17 11:02 PM, Walter Bright wrote: http://dconf.org/2017/registration.html Don't forget, it goes up to $400 after Monday. What do we do if we purchased three pass via EventBrite? I didn't see anywhere to set name/company info... -- Adam Wilson IRC: LightBender import

Re: DMD JSON output

2017-02-25 Thread rikki cattermole via Digitalmars-d-learn
On 26/02/2017 4:01 PM, ANtlord wrote: Hello! I've encroutered intresting tool of DMD. It is dump of AST in JSON format (dmd -X main.d). But I it contains only declaration of methods, templates and structs. It doesn't contain statements like a variables or nested functions inside function's body.

DMD JSON output

2017-02-25 Thread ANtlord via Digitalmars-d-learn
Hello! I've encroutered intresting tool of DMD. It is dump of AST in JSON format (dmd -X main.d). But I it contains only declaration of methods, templates and structs. It doesn't contain statements like a variables or nested functions inside function's body. Is it possible to make dump with

scriptlike v0.10.1 - Another minor update

2017-02-25 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
Another minor, but this time slightly breaking update to Scriptlike (Utility library to help you write script-like programs in D). https://github.com/Abscissa/scriptlike v0.10.1 (changes since v0.9.7): - Change: Issue #33: Rename Path.toRawString to Path.raw. - Change: Deprecated

[Issue 6712] .init wrong when multiple functions declare the same typedef

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6712 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 6911] Built-in trait to tell functions that allocate from the GC heap

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6911 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

Re: DConf 2017 Early Bird Registration expires Monday!

2017-02-25 Thread Moritz Maxeiner via Digitalmars-d-announce
On Sunday, 26 February 2017 at 01:03:39 UTC, Walter Bright wrote: On 2/25/2017 5:25 AM, Moritz Maxeiner wrote: Just registered and was returned to http://dconf.org/2017/thankyou.html afterwards, which yields a 404 error. Not sure if I should laugh or cry. Your registration is confirmed. See

[Issue 17198] rdmd does not recompile when --extra-file is added

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17198 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/tools https://github.com/dlang/tools/commit/5ffca7b0e097644fbcffbee8ba755e4ae48c9d9f fix issue 17198 - rdmd does not recompile when

Re: DConf 2017 Early Bird Registration expires Monday!

2017-02-25 Thread Walter Bright via Digitalmars-d-announce
On 2/25/2017 5:25 AM, Moritz Maxeiner wrote: Just registered and was returned to http://dconf.org/2017/thankyou.html afterwards, which yields a 404 error. Not sure if I should laugh or cry. Your registration is confirmed. See you there!

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Ola Fosheim Grostad via Digitalmars-d
On Saturday, 25 February 2017 at 21:49:43 UTC, Chris Wright wrote: On Sat, 25 Feb 2017 22:12:13 +0100, Timon Gehr wrote: On 25.02.2017 15:38, Chris Wright wrote: On Sat, 25 Feb 2017 13:23:03 +0100, Timon Gehr wrote: If 'disable' (as can be reasonably expected) means the compiler will behave

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Chris Wright via Digitalmars-d
On Sat, 25 Feb 2017 21:49:43 +, Chris Wright wrote: > On Sat, 25 Feb 2017 22:12:13 +0100, Timon Gehr wrote: > >> On 25.02.2017 15:38, Chris Wright wrote: >>> On Sat, 25 Feb 2017 13:23:03 +0100, Timon Gehr wrote: If 'disable' (as can be reasonably expected) means the compiler will

Re: Recommend: IDE and GUI library

2017-02-25 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 25 February 2017 at 21:26:32 UTC, XavierAP wrote: It's not GUI projects that I would plan to work on, just something easy with basic functionality that I can use for my own utilities or test clients for libraries. And if there's anything with any kind of designer support (in which

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Chris Wright via Digitalmars-d
On Sat, 25 Feb 2017 22:12:13 +0100, Timon Gehr wrote: > On 25.02.2017 15:38, Chris Wright wrote: >> On Sat, 25 Feb 2017 13:23:03 +0100, Timon Gehr wrote: >>> If 'disable' (as can be reasonably expected) means the compiler will >>> behave as if they were never present, then it does not. >> >>

Re: trick to make throwing method @nogc

2017-02-25 Thread Profile Anaysis via Digitalmars-d-learn
On Saturday, 25 February 2017 at 19:59:29 UTC, ikod wrote: Hello, I have a method for range: struct Range { immutable(ubyte[]) _buffer; size_t _pos; @property void popFront() pure @safe { enforce(_pos < _buffer.length, "popFront from empty buffer");

Re: Recommend: IDE and GUI library

2017-02-25 Thread XavierAP via Digitalmars-d-learn
On Saturday, 25 February 2017 at 20:03:17 UTC, Jacob Carlborg wrote: There's no de factor library for creating GUIs in D. If you want a native look and feel, DWT is a good option. If you want the application to look the same on all platforms, there might be other better suited alternatives.

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Stefan Koch via Digitalmars-d
On Saturday, 25 February 2017 at 21:12:13 UTC, Timon Gehr wrote: I know my claim seems insane, but it is actually true. http://forum.dlang.org/post/lr4kek$2rd$1...@digitalmars.com The optimizer can currently not take advantage of it. and I don't see how that would change in the near future.

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Timon Gehr via Digitalmars-d
On 25.02.2017 15:38, Chris Wright wrote: On Sat, 25 Feb 2017 13:23:03 +0100, Timon Gehr wrote: If 'disable' (as can be reasonably expected) means the compiler will behave as if they were never present, then it does not. https://dlang.org/dmd-linux.html#switch-release This literally says

Re: trick to make throwing method @nogc

2017-02-25 Thread ikod via Digitalmars-d-learn
On Saturday, 25 February 2017 at 20:49:51 UTC, Adam D. Ruppe wrote: A wrapper that unifies these 4 steps like enforce is pretty easy to implement. yeah easy to use exception in @nogc as long as the catch knows to free it too. Alas, not my case. Exception can be catched not in my code.

Re: trick to make throwing method @nogc

2017-02-25 Thread Eugene Wissner via Digitalmars-d-learn
On Saturday, 25 February 2017 at 20:49:51 UTC, Adam D. Ruppe wrote: On Saturday, 25 February 2017 at 20:40:26 UTC, Eugene Wissner wrote: it builds and doesn't throw if I compile with: dmd -release though it causes a segfault, what is probably a dmd bug. No, that's by design. assert(0)

Re: trick to make throwing method @nogc

2017-02-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 25 February 2017 at 20:40:26 UTC, Eugene Wissner wrote: it builds and doesn't throw if I compile with: dmd -release though it causes a segfault, what is probably a dmd bug. No, that's by design. assert(0) compiles to a segfault instruction with -release. A wrapper that unifies

Re: trick to make throwing method @nogc

2017-02-25 Thread Eugene Wissner via Digitalmars-d-learn
On Saturday, 25 February 2017 at 20:02:56 UTC, ikod wrote: On Saturday, 25 February 2017 at 19:59:29 UTC, ikod wrote: Hello, I have a method for range: struct Range { immutable(ubyte[]) _buffer; size_t _pos; @property void popFront() pure @safe { enforce(_pos

Re: DConf 2017 Early Bird Registration expires Monday!

2017-02-25 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 2/25/17 8:25 AM, Moritz Maxeiner wrote: On Saturday, 25 February 2017 at 07:02:48 UTC, Walter Bright wrote: http://dconf.org/2017/registration.html Don't forget, it goes up to $400 after Monday. Just registered and was returned to http://dconf.org/2017/thankyou.html afterwards, which

Re: Recommend: IDE and GUI library

2017-02-25 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-02-24 23:44, XavierAP wrote: And second question, is DWT the de facto standard for creating GUIs? Or are there good competitors. There's no de factor library for creating GUIs in D. If you want a native look and feel, DWT is a good option. If you want the application to look the

Re: trick to make throwing method @nogc

2017-02-25 Thread ikod via Digitalmars-d-learn
On Saturday, 25 February 2017 at 19:59:29 UTC, ikod wrote: Hello, I have a method for range: struct Range { immutable(ubyte[]) _buffer; size_t _pos; @property void popFront() pure @safe { enforce(_pos < _buffer.length, "popFront from empty buffer");

Re: Serializer class

2017-02-25 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-02-24 19:10, houdoux09 wrote: The problem is that I can not retrieve the variables from the parent class. Cast the value to the type of the base class and run it through the same function. You can have a look at the Orange serialization library [1]. [1]

trick to make throwing method @nogc

2017-02-25 Thread ikod via Digitalmars-d-learn
Hello, I have a method for range: struct Range { immutable(ubyte[]) _buffer; size_t _pos; @property void popFront() pure @safe { enforce(_pos < _buffer.length, "popFront from empty buffer"); _pos++; } } I'd like to have @nogc here, but I can't

Re: Code size without documentation comments and unittests

2017-02-25 Thread Timothee Cour via Digitalmars-d
Try dscanner --sloc although IMO --tokenCount should be the most relevant metric (only caveat is mixin strings with which one could cheat to make token count smaller). TokenCount formatting invariant On Feb 25, 2017 11:36 AM, "Andrei Alexandrescu via Digitalmars-d" < digitalmars-d@puremagic.com>

Code size without documentation comments and unittests

2017-02-25 Thread Andrei Alexandrescu via Digitalmars-d
What would be a simple way to count the "effective" lines in a module, i.e. excluding ddoc comments and unittests? Having a tool for that in tools/ would be neat. -- Andrei

Re: DConf 2017 Early Bird Registration expires Monday!

2017-02-25 Thread Ali Çehreli via Digitalmars-d-announce
On 02/25/2017 05:25 AM, Moritz Maxeiner wrote: On Saturday, 25 February 2017 at 07:02:48 UTC, Walter Bright wrote: http://dconf.org/2017/registration.html Don't forget, it goes up to $400 after Monday. Just registered and was returned to http://dconf.org/2017/thankyou.html afterwards, which

Re: Voting for std.experimental.checkedint

2017-02-25 Thread Andrei Alexandrescu via Digitalmars-d
On 2/25/17 11:00 AM, Vladimir Panteleev wrote: On Saturday, 25 February 2017 at 15:21:10 UTC, Andrei Alexandrescu wrote: On 02/25/2017 10:17 AM, rumbu wrote: A lot of bloat code for something extremely basic. If you can do it with less code, I'm all ears. Thanks! -- Andrei Perhaps a

[Issue 17215] [Reg 2.073] ICE(cgcod.c:findreg) with SIMD and -O -inline

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17215 --- Comment #7 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/46d1948f4c4f05143729f9849b4edefe01b1a02e fix Issue 17215 - ICE(cgcod.c:findreg) with SIMD and -O

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Jerry via Digitalmars-d
On Friday, 24 February 2017 at 14:35:44 UTC, Jack Stouffer wrote: Why is it that test CIs catch bugs when people should be running tests locally? CI tests all platforms, not just the one a user is on. It does it simultaneously as well. In the case of something like DMD, it's a pain in the

[Issue 6760] Disallow disabled overrides

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6760 b2.t...@gmx.com changed: What|Removed |Added CC||jesse.k.phillip...@gmail.co

[Issue 5171] Prevent compiling of class when @disable is used on an overriding function

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5171 b2.t...@gmx.com changed: What|Removed |Added Status|REOPENED|RESOLVED CC|

Re: Step into in debugging.

2017-02-25 Thread drug via Digitalmars-d
hmm.. I didn't change my nickname. It was my answer.

Re: Step into in debugging.

2017-02-25 Thread digitalmars via Digitalmars-d
Of course no. When I have some problem I google a solution and often I find it. I'm sure that sharing your solution may be useful for somebody else. But very often people that have solved theirs problem do not share solution - they think something like who cares and so on. You didn't shy to

[Issue 17049] [scope] member methods not escape checked like free functions

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17049 Martin Nowak changed: What|Removed |Added Summary|[scope] class references|[scope] member methods not

Re: Calling destroy on struct pointer

2017-02-25 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 25 February 2017 at 15:13:27 UTC, Radu wrote: Here is sample on how destroy fails with a fwd decl error: struct A { B b; C c; } struct B { Wrap!A val; } struct C { Wrap!A val; } struct Wrap(T) { this(bool b) { t = cast(T*) malloc(T.sizeof);

Re: Calling destroy on struct pointer

2017-02-25 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 25 February 2017 at 15:21:56 UTC, Radu wrote: The correct way of doing it using deref would to look like: struct A { int i; } auto a = cast (A*) malloc(A.sizeof); // Allocate emplace(a, 42); // Construct destroy(*a); // Destruct A

[Issue 5558] opIn_r not detected as method for 'in' in pointed struct

2017-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5558 b2.t...@gmx.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

Re: Voting for std.experimental.checkedint

2017-02-25 Thread Vladimir Panteleev via Digitalmars-d
On Saturday, 25 February 2017 at 15:21:10 UTC, Andrei Alexandrescu wrote: On 02/25/2017 10:17 AM, rumbu wrote: A lot of bloat code for something extremely basic. If you can do it with less code, I'm all ears. Thanks! -- Andrei Perhaps a simpler example for the most basic use case could be

Re: Voting for std.experimental.checkedint

2017-02-25 Thread Andrei Alexandrescu via Digitalmars-d
On 02/25/2017 10:17 AM, rumbu wrote: A lot of bloat code for something extremely basic. If you can do it with less code, I'm all ears. Thanks! -- Andrei

Re: Calling destroy on struct pointer

2017-02-25 Thread Radu via Digitalmars-d-learn
On Saturday, 25 February 2017 at 13:18:21 UTC, Moritz Maxeiner wrote: On Saturday, 25 February 2017 at 13:14:24 UTC, Moritz Maxeiner wrote: --- struct A {} auto a = cast (A*) malloc(A.sizeof); // Allocate emplace(a, 42); // Construct destroy(a);

Re: Voting for std.experimental.checkedint

2017-02-25 Thread rumbu via Digitalmars-d
On Friday, 24 February 2017 at 20:37:28 UTC, Dmitry Olshansky wrote: On 2/24/17 4:20 PM, Robert burner Schadek wrote: checkedint got voted in. With 2 Yes and 2 yes with remarks. Remarkably unpopular vote we have here. If I read it right it implies that nobody cares for checked integers. A

Re: Calling destroy on struct pointer

2017-02-25 Thread Radu via Digitalmars-d-learn
On Saturday, 25 February 2017 at 13:14:24 UTC, Moritz Maxeiner wrote: On Saturday, 25 February 2017 at 10:44:07 UTC, Radu wrote: On Saturday, 25 February 2017 at 08:36:02 UTC, Ali Çehreli wrote: On 02/25/2017 12:17 AM, Radu wrote: > destroy(cc) -> does c = C.init > destroy(*cc); -> calls the

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Ola Fosheim Grøstad via Digitalmars-d
On Saturday, 25 February 2017 at 14:38:33 UTC, Chris Wright wrote: On Sat, 25 Feb 2017 13:23:03 +0100, Timon Gehr wrote: If 'disable' (as can be reasonably expected) means the compiler will behave as if they were never present, then it does not.

Re: [Beginner]Variable length arrays

2017-02-25 Thread helxi via Digitalmars-d-learn
On Saturday, 25 February 2017 at 14:34:31 UTC, rikki cattermole wrote: On 26/02/2017 3:31 AM, helxi wrote: I am trying to create an array which has a user defined size. However the following program is not compiling: import std.stdio; void main(){ write("Enter your array size: ");

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Chris Wright via Digitalmars-d
On Sat, 25 Feb 2017 13:23:03 +0100, Timon Gehr wrote: > If 'disable' (as can be reasonably expected) means the compiler will > behave as if they were never present, then it does not. https://dlang.org/dmd-linux.html#switch-release Plus I actually tested it. > Ketmar described the removal of

D for BigData: the first BetterC library by Tamediadigital

2017-02-25 Thread Ilya Yaroshenko via Digitalmars-d-announce
HyperLogLog++ is advanced cardinality estimation algorithm with normal and compressed sparse representations. It can be used to estimate approximate number of unique elements in an unordered set. hll-d [1, 2] is written in D. It can be used as betterC library without linking with DRuntime.

Re: [Beginner]Variable length arrays

2017-02-25 Thread rikki cattermole via Digitalmars-d-learn
On 26/02/2017 3:31 AM, helxi wrote: I am trying to create an array which has a user defined size. However the following program is not compiling: import std.stdio; void main(){ write("Enter your array size: "); int n; readf(" %s", ); int[n] arr; //<-Error: variable input cannot

[Beginner]Variable length arrays

2017-02-25 Thread helxi via Digitalmars-d-learn
I am trying to create an array which has a user defined size. However the following program is not compiling: import std.stdio; void main(){ write("Enter your array size: "); int n; readf(" %s", ); int[n] arr; //<-Error: variable input cannot be read at compile time

Re: DConf 2017 Early Bird Registration expires Monday!

2017-02-25 Thread Moritz Maxeiner via Digitalmars-d-announce
On Saturday, 25 February 2017 at 07:02:48 UTC, Walter Bright wrote: http://dconf.org/2017/registration.html Don't forget, it goes up to $400 after Monday. Just registered and was returned to http://dconf.org/2017/thankyou.html afterwards, which yields a 404 error. Not sure if I should laugh

Re: Pointers vs functional or array semantics

2017-02-25 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 25 February 2017 at 11:06:28 UTC, data pulverizer wrote: I have noticed that some numerical packages written in D use pointer semantics heavily (not referring to packages that link to C libraries). I am in the process of writing code for a numerical computing library and would

Re: Calling destroy on struct pointer

2017-02-25 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 25 February 2017 at 13:14:24 UTC, Moritz Maxeiner wrote: --- struct A {} auto a = cast (A*) malloc(A.sizeof); // Allocate emplace(a, 42); // Construct destroy(a); // Destruct free(a); // Deallocate ---

Re: Calling destroy on struct pointer

2017-02-25 Thread Moritz Maxeiner via Digitalmars-d-learn
On Saturday, 25 February 2017 at 10:44:07 UTC, Radu wrote: On Saturday, 25 February 2017 at 08:36:02 UTC, Ali Çehreli wrote: On 02/25/2017 12:17 AM, Radu wrote: > destroy(cc) -> does c = C.init > destroy(*cc); -> calls the C dtor > > Is this by design? If so - how can I destroy and get the

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Timon Gehr via Digitalmars-d
On 25.02.2017 01:50, Chris Wright wrote: On Fri, 24 Feb 2017 21:16:28 +0100, Timon Gehr wrote: On 24.02.2017 16:29, Chris Wright wrote: On Fri, 24 Feb 2017 09:14:24 +0200, ketmar wrote: forget about "-release" dmd arg. forget about "-boundscheck=off". no, really, they won't do you any good.

Re: If you needed any more evidence that memory safety is the future...

2017-02-25 Thread Timon Gehr via Digitalmars-d
On 25.02.2017 04:12, Chris M wrote: On Friday, 24 February 2017 at 20:16:28 UTC, Timon Gehr wrote: On 24.02.2017 16:29, Chris Wright wrote: On Fri, 24 Feb 2017 09:14:24 +0200, ketmar wrote: forget about "-release" dmd arg. forget about "-boundscheck=off". no, really, they won't do you any

Re: Pointers vs functional or array semantics

2017-02-25 Thread data pulverizer via Digitalmars-d-learn
On Saturday, 25 February 2017 at 11:15:53 UTC, ketmar wrote: data pulverizer wrote: I have noticed that some numerical packages written in D use pointer semantics heavily (not referring to packages that link to C libraries). I am in the process of writing code for a numerical computing

Re: Pointers vs functional or array semantics

2017-02-25 Thread ketmar via Digitalmars-d-learn
data pulverizer wrote: I have noticed that some numerical packages written in D use pointer semantics heavily (not referring to packages that link to C libraries). I am in the process of writing code for a numerical computing library and would like to know whether there times when addressing

Pointers vs functional or array semantics

2017-02-25 Thread data pulverizer via Digitalmars-d-learn
I have noticed that some numerical packages written in D use pointer semantics heavily (not referring to packages that link to C libraries). I am in the process of writing code for a numerical computing library and would like to know whether there times when addressing an array using pointers

Re: Calling destroy on struct pointer

2017-02-25 Thread Radu via Digitalmars-d-learn
On Saturday, 25 February 2017 at 08:36:02 UTC, Ali Çehreli wrote: On 02/25/2017 12:17 AM, Radu wrote: > destroy(cc) -> does c = C.init > destroy(*cc); -> calls the C dtor > > Is this by design? If so - how can I destroy and get the dtor called > without dereferencing the pointer? It's by

Re: Calling destroy on struct pointer

2017-02-25 Thread Ali Çehreli via Digitalmars-d-learn
On 02/25/2017 12:17 AM, Radu wrote: > destroy(cc) -> does c = C.init > destroy(*cc); -> calls the C dtor > > Is this by design? If so - how can I destroy and get the dtor called > without dereferencing the pointer? It's by design because setting a pointer to null can be considered as

Calling destroy on struct pointer

2017-02-25 Thread Radu via Digitalmars-d-learn
I'm puzzled by the way destroy works when passed a pointer to a struct, observe: --code.d-- int i; struct C { this(ref int i) { ++i; ii = } ~this() {