Re: Can we get unitests to not run with program start ?

2016-10-26 Thread Basile B. via Digitalmars-d
On Wednesday, 26 October 2016 at 09:22:23 UTC, pineapple wrote: On Wednesday, 26 October 2016 at 08:15:44 UTC, Basile B. wrote: What would be possible is a "-fdmain" switch (force dummy main). Its role would be: if a functionDeclaration named "main" is present then this normal "main" is not

Re: Can we get unitests to not run with program start ?

2016-10-26 Thread Basile B. via Digitalmars-d
On Wednesday, 26 October 2016 at 05:24:45 UTC, deadalnix wrote: Seriously that makes no sense, almost everybody has it own hack to have a different main when building for unitests, and we look like clown. [...] Can I have my unittest build do not complain if there is no main and not run main

Re: Phobos lacks a particular family of range functions...

2016-10-22 Thread Basile B. via Digitalmars-d-learn
On Friday, 21 October 2016 at 19:41:00 UTC, Basile B. wrote: They would have for constraint `if (isInputRange!Range && isInputRange!(ElementType!Range))` In case you wouldn't see directly what would they be used for, it's for tree-like structures. Each element in a Range is also an input

Phobos lacks a particular family of range functions...

2016-10-21 Thread Basile B. via Digitalmars-d-learn
They would have for constraint `if (isInputRange!Range && isInputRange!(ElementType!Range))` In case you wouldn't see directly what would they be used for, it's for tree-like structures. Each element in a Range is also an input range. I see 3 obvious functions/templates - the most

Is this a bug ?

2016-10-21 Thread Basile B. via Digitalmars-d-learn
This very simple stuff: class Item { alias children this; Item[] children; void populate() { children ~= new Item; assert(children.length == 1); } } void main() { Item root = new Item; root.populate; } leads to an assertion failure. Am I too tired to

Re: List defined version specifications

2016-10-19 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 19 October 2016 at 10:25:51 UTC, Lodovico Giaretta wrote: Hi! A simple question: is there a way to list all defined version specifications? Something like: pragma(msg, __traits(allVersions)); Example output (DMD on Ubuntu x64, release build): [all,

Re: std.experimental.allocator and GC.addRange

2016-10-19 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 19 October 2016 at 08:34:57 UTC, Benjamin Thaut wrote: Lets assume I have a allocator which cains together multiple building blocks from std.experimental.allocator and at the end there is a mallocator providing the underlying memory. Now I alloacte a type which contains a pointer

Re: TIL: auto struct members

2016-10-18 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 22:12:47 UTC, Ali Çehreli wrote: It may be embarrassing to discover this fact so late but you can define struct members as 'auto': import std.range; import std.algorithm; struct S { auto r = only("a", "b").cycle;// <-- WOW! } pragma(msg, typeof(S.r));

Re: Render SVG To Display And Update Periodically

2016-10-18 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 18 October 2016 at 21:00:12 UTC, Karabuta wrote: On Monday, 17 October 2016 at 07:18:40 UTC, ketmar wrote: On Monday, 17 October 2016 at 07:05:24 UTC, ketmar wrote: [...] oops, forgot to give some links. ;-) nanovg and nanosvg ports: http://repo.or.cz/iv.d.git/tree/HEAD:/nanovg

Re: About debugging (again)

2016-10-17 Thread Basile B. via Digitalmars-d-learn
On Monday, 17 October 2016 at 19:14:49 UTC, ANtlord wrote: On Monday, 17 October 2016 at 17:57:19 UTC, Martin Krejcirik wrote: On Monday, 17 October 2016 at 15:45:56 UTC, ANtlord wrote: GDB 7.7.1 Use latest GDB, 7.10 has got much better D support. Tested on GDB 7.11.1. Same case :(

Re: Range violation with AAs

2016-10-17 Thread Basile B. via Digitalmars-d-learn
On Monday, 17 October 2016 at 17:43:19 UTC, Nordlöw wrote: At https://github.com/nordlow/phobos-next/blob/master/src/array_ex.d I have an array container. Everything works as expected in all unittests except for the line at

Re: About debugging (again)

2016-10-17 Thread Basile B. via Digitalmars-d-learn
On Monday, 17 October 2016 at 17:46:05 UTC, Basile B. wrote: On Monday, 17 October 2016 at 15:45:56 UTC, ANtlord wrote: On Monday, 17 October 2016 at 15:43:32 UTC, ANtlord wrote: [...] Oh Sorry, I've forgotten about pointing technical parameters. Ubuntu 14.04 GDB 7.7.1 DMD64 D Compiler

Re: About debugging (again)

2016-10-17 Thread Basile B. via Digitalmars-d-learn
On Monday, 17 October 2016 at 15:45:56 UTC, ANtlord wrote: On Monday, 17 October 2016 at 15:43:32 UTC, ANtlord wrote: Hello! I've met an issue related to debugging by GDB. Directly when I try to show call stack I get like this http://pastebin.com/kRFRqznq. How can I make name of methods more

Re: how to understand different attribute styles?

2016-10-17 Thread Basile B. via Digitalmars-d-learn
On Monday, 17 October 2016 at 14:12:33 UTC, timepp wrote: there is "@disable", using @ as prefix; there is "__gshared", using __ as prefix; there is also "align", not using prefix. I failed to summarize a rule here. Can anyone tell the underlined philosophy? It's an inconsistency of the

Re: Bug or case of hijacking protection ?

2016-10-17 Thread Basile B. via Digitalmars-d-learn
On Monday, 17 October 2016 at 14:01:26 UTC, Basile B. wrote: Is this a bug or a case of hijacking protection ? struct S { void test(void*, size_t){} } void test(ref S,void[]){} void main() { ubyte[] a; (*new S).test(a); }

Bug or case of hijacking protection ?

2016-10-17 Thread Basile B. via Digitalmars-d-learn
Is this a bug or a case of hijacking protection ? struct S { void test(void*, size_t){} } void test(ref S,void[]){} void main() { ubyte[] a; (*new S).test(a); }

Re: UDA and trait for non-GC managed pointers

2016-10-16 Thread Basile B. via Digitalmars-d
On Saturday, 15 October 2016 at 19:36:19 UTC, Nordlöw wrote: On Saturday, 15 October 2016 at 17:48:13 UTC, Basile B. wrote: I agree. We are several people to do it already. I've started to during last spring (see https://forum.dlang.org/post/ficbsdfokvbvslatm...@forum.dlang.org). So far I use

[OT] Re: UDA and trait for non-GC managed pointers

2016-10-16 Thread Basile B. via Digitalmars-d
On Saturday, 15 October 2016 at 18:03:54 UTC, Nordlöw wrote: On Saturday, 15 October 2016 at 17:48:13 UTC, Basile B. wrote: To be honest I find this system way more useful that the function attribute @nogc. My trait is here (https://github.com/BBasile/iz/blob/master/import/iz/memory.d#L145)

Re: UDA and trait for non-GC managed pointers

2016-10-16 Thread Basile B. via Digitalmars-d
On Saturday, 15 October 2016 at 16:22:35 UTC, Nordlöw wrote: Is there a way to check if a pointer is supposed to point to non-GC allocated memory? I presume not. This is needed to prevent unnecessary calls to `GC.addRange` in containers with elements of a type that in turn is a container-like

Re: [OT] Re: New team member: Lucia

2016-10-14 Thread Basile B. via Digitalmars-d-announce
On Friday, 14 October 2016 at 05:57:27 UTC, Basile B. wrote: On Thursday, 13 October 2016 at 20:02:14 UTC, Andrei Alexandrescu wrote: On 10/13/2016 03:51 PM, Basile B. wrote: On Thursday, 13 October 2016 at 18:18:40 UTC, Andrei Alexandrescu wrote: On 10/13/2016 02:15 PM, Andrei Alexandrescu

[OT] Re: New team member: Lucia

2016-10-14 Thread Basile B. via Digitalmars-d-announce
On Thursday, 13 October 2016 at 20:02:14 UTC, Andrei Alexandrescu wrote: On 10/13/2016 03:51 PM, Basile B. wrote: On Thursday, 13 October 2016 at 18:18:40 UTC, Andrei Alexandrescu wrote: On 10/13/2016 02:15 PM, Andrei Alexandrescu wrote: Please join me in welcoming Lucia Lucia Cojocaru to our

Re: New team member: Lucia

2016-10-13 Thread Basile B. via Digitalmars-d-announce
On Thursday, 13 October 2016 at 18:18:40 UTC, Andrei Alexandrescu wrote: On 10/13/2016 02:15 PM, Andrei Alexandrescu wrote: Please join me in welcoming Lucia Lucia Cojocaru to our team. Lucia is a Pardon the typo: Lucia Madalina Cojocaru. -- Andrei Just a stupid question...does she live in

Re: Determining if a class has a template function

2016-10-12 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 11 October 2016 at 20:17:19 UTC, Straivers wrote: I have a class T with a templated function foo(string name)(int, int, float) that will be mixed in via template, and I want to determine if that class has mixed it in such that foo(name = "bar"). How could I go about this? Thanks.

Re: Examples Wanted: Usages of "body" as a Symbol Name

2016-10-05 Thread Basile B. via Digitalmars-d
On Wednesday, 5 October 2016 at 19:30:27 UTC, pineapple wrote: On Wednesday, 5 October 2016 at 19:02:02 UTC, Basile B. wrote: On Wednesday, 5 October 2016 at 18:41:02 UTC, Jacob Carlborg wrote: On 2016-10-05 19:14, Matthias Klumpp wrote: Agreed - I have exactly the same problem with

Re: Examples Wanted: Usages of "body" as a Symbol Name

2016-10-05 Thread Basile B. via Digitalmars-d
On Wednesday, 5 October 2016 at 18:41:02 UTC, Jacob Carlborg wrote: On 2016-10-05 19:14, Matthias Klumpp wrote: Agreed - I have exactly the same problem with "version", which is also really common for, well, to hold a version number of a component. Body is annoying too. But, can keywords

Re: Examples Wanted: Usages of "body" as a Symbol Name

2016-10-05 Thread Basile B. via Digitalmars-d
On Wednesday, 5 October 2016 at 02:11:14 UTC, Meta wrote: I'm currently writing up a DIP to propose removing `body` as a keyword to allow it to be used for variable names, functions, etc. I'm looking for examples and contexts where `body` would normally be used as a variable, function name,

Re: Please say hello to Alexandru

2016-10-05 Thread Basile B. via Digitalmars-d-announce
Welcome, I can't wait to see your first commits to ... compiler | library | runtime ?

Re: obscure messages relating to linking and imports in 2.071.1

2016-10-05 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 5 October 2016 at 12:12:24 UTC, Basile B. wrote: On Wednesday, 5 October 2016 at 11:45:49 UTC, Laeeth Isharc wrote: I noticed the problem before - previously it was my fault. I had a circulator dependency where A imported B, B did a selective import of C and C imported A

Re: obscure messages relating to linking and imports in 2.071.1

2016-10-05 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 5 October 2016 at 11:45:49 UTC, Laeeth Isharc wrote: I noticed the problem before - previously it was my fault. I had a circulator dependency where A imported B, B did a selective import of C and C imported A selectively. That led to link problems with module constructors.

Re: URI parsing

2016-10-05 Thread Basile B. via Digitalmars-d
On Wednesday, 5 October 2016 at 10:19:08 UTC, John C wrote: What packages do people use when they want to parse URIs? I rolled my own but it's incomplete and as it's a fairly common need there must be one out there? In fact, I'm surprised there isn't one in Phobos yet. It's not easy to make

Re: D and Secure Programming

2016-10-02 Thread Basile B. via Digitalmars-d
On Monday, 3 October 2016 at 03:50:29 UTC, Jacob wrote: import std.stdio; struct SomeStruct { int value; void func() { writeln(value); } } void main() { SomeStruct someStruct; someStruct.value = 333;

Re: Class attributes

2016-10-02 Thread Basile B. via Digitalmars-d-learn
On Sunday, 2 October 2016 at 15:54:38 UTC, Satoshi wrote: Hello, why pure @safe nothrow @nogc struct Point { } isn't same as struct Point { pure: @safe: nothrow: @nogc: } ?? This is not specified but attributes aren't applied to the scope created by the declaration. Which is a good thing,

Re: Beta 2.072.0-b1

2016-10-02 Thread Basile B. via Digitalmars-d-announce
On Sunday, 2 October 2016 at 15:04:06 UTC, Martin Nowak wrote: On Sunday, 2 October 2016 at 13:33:58 UTC, Basile B. wrote: Does any change related to protection attributes would be able to trigger them ? Such a breakage is really hardly believable (it's very basic OOP). Please file a bug

Re: Beta 2.072.0-b1

2016-10-02 Thread Basile B. via Digitalmars-d-announce
On Sunday, 2 October 2016 at 12:43:00 UTC, Martin Nowak wrote: On Sunday, 2 October 2016 at 00:18:23 UTC, Basile B. wrote: It was compiling fine with 2.071.2. I cant say if this is a regression or not. If not it would mean that the previous management of the static ctor hided a problem ?

Re: Beta 2.072.0-b1

2016-10-01 Thread Basile B. via Digitalmars-d-announce
On Saturday, 1 October 2016 at 20:57:17 UTC, Martin Nowak wrote: First beta for the 2.072.0 release. This release comes with many new phobos features, native TLS support on OSX, the first bunch of @safety enhancements (try -transition=safe), and a few smaller language and compiler additions.

Re: Is there any way to have [] overloads use compile-time indexes as is currently done for Tuples?

2016-09-27 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 27 September 2016 at 09:21:04 UTC, pineapple wrote: I'd really like to define my own types that accept indexes for opIndex and opSlice as template arguments. Is there any way to do this? If not, this seems like an obvious thing to add to the language - what's been holding it back?

Re: Linking D code into existing C programs

2016-09-27 Thread Basile B. via Digitalmars-d
On Monday, 26 September 2016 at 23:32:05 UTC, Walter Bright wrote: Linking C libraries and object code into D programs has always worked easily in D. The other way around, not so well. [...] Produces: bar.o:(.eh_frame+0x13): undefined reference to `__dmd_personality_v0' bar.o: In

Re: Should #line create a new namespace ?

2016-09-26 Thread Basile B. via Digitalmars-d
On Monday, 26 September 2016 at 11:37:51 UTC, Basile B. wrote: On Monday, 26 September 2016 at 10:19:09 UTC, Kagamin wrote: On Sunday, 25 September 2016 at 07:30:49 UTC, Basile B. wrote: Also since no more special token sequence would exist in the language, special token sequence could be

Re: Should #line create a new namespace ?

2016-09-26 Thread Basile B. via Digitalmars-d
On Monday, 26 September 2016 at 10:19:09 UTC, Kagamin wrote: On Sunday, 25 September 2016 at 07:30:49 UTC, Basile B. wrote: Also since no more special token sequence would exist in the language, special token sequence could be removed completely. That's

Re: how to access struct member using [] operator?

2016-09-25 Thread Basile B. via Digitalmars-d-learn
On Sunday, 25 September 2016 at 16:26:11 UTC, Basile B. wrote: On Sunday, 25 September 2016 at 16:07:59 UTC, Basile B. wrote: On Sunday, 25 September 2016 at 09:01:44 UTC, Namespace wrote: On Sunday, 25 September 2016 at 04:54:31 UTC, grampus wrote: Dear all For example, I have a struct

Re: how to access struct member using [] operator?

2016-09-25 Thread Basile B. via Digitalmars-d-learn
On Sunday, 25 September 2016 at 16:07:59 UTC, Basile B. wrote: On Sunday, 25 September 2016 at 09:01:44 UTC, Namespace wrote: On Sunday, 25 September 2016 at 04:54:31 UTC, grampus wrote: Dear all For example, I have a struct struct point{int x;int y} point a; Is there an easy way to access x

Re: how to access struct member using [] operator?

2016-09-25 Thread Basile B. via Digitalmars-d-learn
On Sunday, 25 September 2016 at 09:01:44 UTC, Namespace wrote: On Sunday, 25 September 2016 at 04:54:31 UTC, grampus wrote: Dear all For example, I have a struct struct point{int x;int y} point a; Is there an easy way to access x and y by using a["x"] and a["y"] I guess I need to overload

Re: The XML and JSON library

2016-09-25 Thread Basile B. via Digitalmars-d
On Sunday, 25 September 2016 at 08:19:22 UTC, Szabo Bogdan wrote: Hi! I think that there are a few years since, the phobos support for XML and JSON were kind of drooped. The xml library it's deprecated and I am not sure if I should use it... I guess not... I guess there is nobody working for

Re: how to access struct member using [] operator?

2016-09-25 Thread Basile B. via Digitalmars-d-learn
On Sunday, 25 September 2016 at 04:54:31 UTC, grampus wrote: Dear all For example, I have a struct struct point{int x;int y} point a; Is there an easy way to access x and y by using a["x"] and a["y"] I guess I need to overload [], but can't figure out how. Someone can help? Thank you very

Re: Should #line create a new namespace ?

2016-09-25 Thread Basile B. via Digitalmars-d
On Saturday, 24 September 2016 at 09:23:38 UTC, Dicebot wrote: On 09/24/2016 10:14 AM, Basile B. wrote: When the file is specified, Shouldn't #line create a new module ? [...] Currently this is not allowed, but what's the value added by the filename then ? It was used to easier debug string

Re: Lazily evaluated property pointing to read only object

2016-09-24 Thread Basile B. via Digitalmars-d-learn
On Saturday, 24 September 2016 at 10:59:50 UTC, mikey wrote: On Saturday, 24 September 2016 at 10:16:34 UTC, Basile B. wrote: You don't need to cast, from "mutable" to "const" is implicit: https://dlang.org/spec/const3.html#implicit_conversions Ok, but using const would be an accepted way of

Re: Lazily evaluated property pointing to read only object

2016-09-24 Thread Basile B. via Digitalmars-d-learn
On Saturday, 24 September 2016 at 09:08:52 UTC, mikey wrote: I'm trying to figure out how to best write a class with a property that is only evaluated when it's called for the first time. And that returns an object which shouldn't be modifiable a part of the owning class. I've had a go at

Should #line create a new namespace ?

2016-09-24 Thread Basile B. via Digitalmars-d
When the file is specified, Shouldn't #line create a new module ? === module m; int a; #line 0 "other.d" int a; === Currently this is not allowed, but what's the value added by the filename then ?

Re: How to link *.a file on Windows?

2016-09-23 Thread Basile B. via Digitalmars-d
On Friday, 23 September 2016 at 06:27:20 UTC, Brian wrote: how to static link libmemcached.lib? Just pass the filename to the compiler as if it's a ".d" source and put the path to the sources root with -I dmd app.d libmemcached.lib -Ipath/to/memcached/interface/

Re: How to link *.a file on Windows?

2016-09-22 Thread Basile B. via Digitalmars-d
On Thursday, 22 September 2016 at 17:09:38 UTC, Brian wrote: I use cygwin build a C++ lib file: libmemcached.a but, how to link it to my dub project? should be a .lib under windows. *.a is an archive of object files (aka a static library) for Posix systems. *.lib is the same but for

Re: module std.stream is deprecated

2016-09-22 Thread Basile B. via Digitalmars-d
On Thursday, 22 September 2016 at 17:09:51 UTC, Basile B. wrote: On Thursday, 22 September 2016 at 15:36:30 UTC, eugene wrote: Hello everyone, i get message: "Deprecation: module std.stream is deprecated - It will be removed from Phobos in October 2016..." What can i use instead of

Re: module std.stream is deprecated

2016-09-22 Thread Basile B. via Digitalmars-d
On Thursday, 22 September 2016 at 15:36:30 UTC, eugene wrote: Hello everyone, i get message: "Deprecation: module std.stream is deprecated - It will be removed from Phobos in October 2016..." What can i use instead of std.stream? https://code.dlang.org/search?q=stream I think that you can

Re: D and math, can you isolate this ?

2016-09-21 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 20 September 2016 at 12:35:18 UTC, Basile B. wrote: The problem is here: https://github.com/BBasile/iz/blob/master/import/iz/math.d#L849 - f(x,c) = 1.0 - pow(1.0 - pow(x, 2.0/c), c * 0.5); - c(f0.5)) = ? Which means that I ask you if you can isolate c for y = 1.0 - pow(1.0 -

Re: D and math, can you isolate this ?

2016-09-21 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 21 September 2016 at 01:34:06 UTC, Nicholas Wilson wrote: On Tuesday, 20 September 2016 at 12:35:18 UTC, Basile B. wrote: I've recently started an easing/interpolation family of function in my D user library. It's based on something I know well since I've already used them in

Re: D and math, can you isolate this ?

2016-09-20 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 20 September 2016 at 16:22:19 UTC, H. S. Teoh wrote: On Tue, Sep 20, 2016 at 12:35:18PM +, Basile B. via Digitalmars-d-learn wrote: [...] The problem is here: https://github.com/BBasile/iz/blob/master/import/iz/math.d#L849 - f(x,c) = 1.0 - pow(1.0 - pow(x, 2.0/c), c * 0.5); - c

Re: Replace/Rename DWT forum with GUIs forum?

2016-09-20 Thread Basile B. via Digitalmars-d
On Tuesday, 20 September 2016 at 14:39:23 UTC, Sai wrote: On Sunday, 18 September 2016 at 23:21:26 UTC, Gerald wrote: I would like to suggest that the existing DWT forum be renamed or replaced with a more generic GUIs forum. As far as I can tell, the DWT forum doesn't get much traffic these

Re: D and math, can you isolate this ?

2016-09-20 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 20 September 2016 at 12:35:18 UTC, Basile B. wrote: I've recently started an easing/interpolation family of function in my D user library. It's based on something I know well since I've already used them in 2012 in a VST plugin called GrainPlot (RIP). However for one of the

D and math, can you isolate this ?

2016-09-20 Thread Basile B. via Digitalmars-d-learn
I've recently started an easing/interpolation family of function in my D user library. It's based on something I know well since I've already used them in 2012 in a VST plugin called GrainPlot (RIP). However for one of the function, I can't manage to get the inverse. A function that's

Re: Default Template Instantiation

2016-09-19 Thread Basile B. via Digitalmars-d
On Monday, 19 September 2016 at 19:38:37 UTC, Jonathan Marler wrote: If you have a template where: 1) All parameters are optional 2) The parameters cannot be deduced Would it be reasonable to instantiate the template with the default parameter values? For example: template Foo(string str =

Re: GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 September 2016 at 15:40:09 UTC, Basile B. wrote: Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on linux x86_64, GDB 7.8 If I send to GDB "break _d_assert" it will break correctly on "assert(false);" so I can jump over. But the

Re: GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 September 2016 at 15:48:27 UTC, Basile B. wrote: On Sunday, 18 September 2016 at 15:40:55 UTC, Guillaume Piolat wrote: On Sunday, 18 September 2016 at 15:40:09 UTC, Basile B. wrote: Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on

Re: GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 September 2016 at 15:48:27 UTC, Basile B. wrote: On Sunday, 18 September 2016 at 15:40:55 UTC, Guillaume Piolat wrote: On Sunday, 18 September 2016 at 15:40:09 UTC, Basile B. wrote: Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on

Re: GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Basile B. via Digitalmars-d-learn
On Sunday, 18 September 2016 at 15:40:55 UTC, Guillaume Piolat wrote: On Sunday, 18 September 2016 at 15:40:09 UTC, Basile B. wrote: Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on linux x86_64, GDB 7.8 If I send to GDB "break _d_assert" it

GDB, cant break on _d_throwc anymore !

2016-09-18 Thread Basile B. via Digitalmars-d-learn
Hello, I'm sure it was working last time I've tried (I can't say when, maybe > 6 months). I'm on linux x86_64, GDB 7.8 If I send to GDB "break _d_assert" it will break correctly on "assert(false);" so I can jump over. But the equivalent for _d_throwc doesn't work anymore ! Any idea ?

Re: Lint D code while you type in Vim

2016-09-16 Thread Basile B. via Digitalmars-d
On Friday, 16 September 2016 at 22:12:58 UTC, w0rp wrote: I have been working on a plugin for Vim 8 and NeoVim which runs linters while you type in Vim, which is an improvement over the plugins for Vim so far which can only lint after you save a file back to disk. So far my plugin seems to

Re: Project Highlight: Timur Gafarov

2016-09-16 Thread Basile B. via Digitalmars-d-announce
On Friday, 16 September 2016 at 14:12:49 UTC, c-v-i wrote: On Friday, 16 September 2016 at 12:53:44 UTC, Mike Parker wrote: What started out as a highlight of Timur's open source game, Atrium, turned into an introduction to several of his D projects. And it looks like I've managed to make this

Re: I hate new DUB config format

2016-09-16 Thread Basile B. via Digitalmars-d
On Friday, 16 September 2016 at 14:48:30 UTC, Chris wrote: Do we have a converter tool by now? SDL to JSON is available in the results of `dub describe` (in the "packages" array, usually the first item is the JSON for the SDL you describe).

Re: I hate new DUB config format

2016-09-16 Thread Basile B via Digitalmars-d
On Wednesday, 14 September 2016 at 11:54:56 UTC, Suliman wrote: Sönke Ludwig, really sorry. It's look my big mistake. I looked at SDL more detail, and this format is much better than JSON. I hope a lot of people is changed their position too. The main diff I see is that in JSON you can have

Re: Critque of Rust's collection types

2016-09-13 Thread Basile B. via Digitalmars-d
On Wednesday, 14 September 2016 at 00:36:39 UTC, Walter Bright wrote: On 9/13/2016 4:47 PM, Walter Bright wrote: http://ticki.github.io/blog/horrible/ Some worthwhile insights into what makes a good collection type. https://news.ycombinator.com/item?id=12488233 Of particular interest is

Re: Discarding all forum drafts at once

2016-09-13 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 13 September 2016 at 18:15:56 UTC, Nordlöw wrote: I have lots of unsent drafts I would like to discard all at once. Is this possible somehow? Delete the cookies.

Re: Copy a struct and its context

2016-09-13 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 13 September 2016 at 01:32:19 UTC, Steven Schveighoffer wrote: On 9/12/16 4:11 PM, Ali Çehreli wrote: On 09/10/2016 10:44 PM, Yuxuan Shui wrote: I recently noticed nested struct capture its context by reference (which, BTW, is not mentioned at all here:

Re: colour lib needs reviewers

2016-09-13 Thread Basile B. via Digitalmars-d
On Tuesday, 13 September 2016 at 02:00:44 UTC, Manu wrote: What is the worth of storing alpha data if it's uniform 0xFF anyway? He he, that's the big problem with classic image formats. When a graphic is described in term of vector, fill, stroke, gradient, layer, etc (not to name SVG)

Re: iasm, unexpectedly slower than DMD production

2016-09-12 Thread Basile B. via Digitalmars-d-learn
On Monday, 12 September 2016 at 00:46:16 UTC, Basile B. wrote: I have this function, written in iasm: ° T foo(T)(T x, T c) if (is(T == float) || is(T == double)) { version(none) { return x*x*x - x*x*c + x*c; } else asm {

Re: colour lib needs reviewers

2016-09-12 Thread Basile B. via Digitalmars-d
On Monday, 12 September 2016 at 04:14:27 UTC, Manu wrote: I think I'm about as happy with my colour lib as I'm going to be. It really needs reviews. I'm not sure what else should be in the scope of this lib. PR: https://github.com/dlang/phobos/pull/2845 dub:

iasm, unexpectedly slower than DMD production

2016-09-11 Thread Basile B. via Digitalmars-d-learn
I have this function, written in iasm: ° T foo(T)(T x, T c) if (is(T == float) || is(T == double)) { version(none) { return x*x*x - x*x*c + x*c; } else asm { naked; movsd XMM3, XMM1; mulsd XMM0,

Re: Voldemort Types on Reddit

2016-09-11 Thread Basile B. via Digitalmars-d
On Sunday, 11 September 2016 at 11:31:55 UTC, Walter Bright wrote: On 9/11/2016 3:11 AM, Jack Stouffer wrote: On Saturday, 10 September 2016 at 20:39:39 UTC, Walter Bright I just like a D post with 1166 upvotes! I think that's a record for us, but maybe one of Andrei's got more? And I do

Re: Reading hexidecimal from a file

2016-09-10 Thread Basile B. via Digitalmars-d-learn
On Saturday, 10 September 2016 at 12:18:22 UTC, Basile B. wrote: On Saturday, 10 September 2016 at 12:12:28 UTC, Basile B. wrote: On Saturday, 10 September 2016 at 12:04:08 UTC, Neurone wrote: Hi, I want to read a text file that contains sha1 hashes in hexidecimal, then convert the hashes

Re: Reading hexidecimal from a file

2016-09-10 Thread Basile B. via Digitalmars-d-learn
On Saturday, 10 September 2016 at 12:04:08 UTC, Neurone wrote: Hi, I want to read a text file that contains sha1 hashes in hexidecimal, then convert the hashes back into ubyte[20]. Examples of some lines: E9785DC5 D43B5F67 F1B7D1CB 33279B7C 284E2593 04150E8F 1840BCA2 972BE1C5 2DE81039

Re: @nogc hash

2016-09-09 Thread Basile B. via Digitalmars-d
On Friday, 9 September 2016 at 11:35:58 UTC, Guillaume Piolat wrote: On Friday, 9 September 2016 at 11:16:19 UTC, Marco Leise wrote: It does not /allocate/ with the GC, but the methods are not /annotated/ @nogc, e.g. insert():

Re: Functions, nothrow and assert

2016-09-08 Thread Basile B. via Digitalmars-d-learn
On Thursday, 8 September 2016 at 11:40:17 UTC, Russel Winder wrote: Is the fact that: void f() nothrow { assert(1 == 0); } int main() { f(); return 0; } compiles fine but at run time f does indeed throw an exception what should happen? If

Re: Usability of "allMembers and derivedMembers traits now only return visible symbols"

2016-09-07 Thread Basile B. via Digitalmars-d
On Wednesday, 7 September 2016 at 15:08:17 UTC, Johan Engelen wrote: Note that the spec tells us: "The .tupleof property returns an ExpressionTuple of all the fields in the class, __excluding__ the hidden fields and __the fields in the base class__." (emphasis mine) So then you have to do

Re: Performance issue with GC

2016-09-07 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 21:20:30 UTC, Yuxuan Shui wrote: I have a little data processing program which makes heavy use of associative arrays, and GC almost doubles the runtime of it (~2m with GC disabled -> ~4m). I just want to ask what's the best practice in this situation? Do I

Re: We need to enhance the standard library!

2016-09-07 Thread Basile B. via Digitalmars-d
On Wednesday, 7 September 2016 at 05:58:37 UTC, Brian wrote: Standard library thin! The lack of a lot of commonly used functions! For example, HTTP client, database abstraction layer, mail delivery, Mathematical calculation standard library. We can refer to the implementation of some of the

Re: dependency analysis for makefile construction

2016-09-06 Thread Basile B. via Digitalmars-d-learn
On Monday, 5 September 2016 at 18:49:25 UTC, Basile B. wrote: On Monday, 5 September 2016 at 18:22:08 UTC, ag0aep6g wrote: On 09/04/2016 12:07 AM, dan wrote: Are there any FOSS tools for doing dependency analysis of [...] [...] I'm not aware of a standalone tool that does something like

Re: TryElseExpression DIP

2016-09-05 Thread Basile B. via Digitalmars-d
On Monday, 5 September 2016 at 20:04:43 UTC, pineapple wrote: On Monday, 5 September 2016 at 19:12:02 UTC, Jacob Carlborg wrote: [...] On 2016-09-05 20:57, pineapple wrote: Which is easier to read and to write? Which is more maintainable? Which is less prone to programmer errors? This?

Re: dependency analysis for makefile construction

2016-09-05 Thread Basile B. via Digitalmars-d-learn
On Monday, 5 September 2016 at 18:22:08 UTC, ag0aep6g wrote: On 09/04/2016 12:07 AM, dan wrote: Are there any FOSS tools for doing dependency analysis of [...] [...] I'm not aware of a standalone tool that does something like this. If you want to write one, you could do like rdmd and use

Re: Assign any event kind to a single templatized function ?

2016-09-05 Thread Basile B. via Digitalmars-d-learn
On Monday, 5 September 2016 at 14:00:04 UTC, ag0aep6g wrote: On 09/05/2016 03:44 PM, Basile B. wrote: [...] You can pass the delegate type itself by alias. Then Parameters carries over the ref. Not sure if that's well-defined or if it just happens to work. void

Re: Assign any event kind to a single templatized function ?

2016-09-05 Thread Basile B. via Digitalmars-d-learn
On Monday, 5 September 2016 at 13:44:53 UTC, Basile B. wrote: Typo, last line should be: foo.event3 = !(Parameters!(foo.event3)); But it still doesnt work.

Assign any event kind to a single templatized function ?

2016-09-05 Thread Basile B. via Digitalmars-d-learn
It's almost a "yeah". However this doesn't work with ref parameters. Any idea how to make this work, keeping the simplicity of the concept ? °° module runnable; import std.stdio; struct Foo { void delegate(int) event1; void delegate(int,int) event2;

Re: Usability of "allMembers and derivedMembers traits now only return visible symbols"

2016-09-04 Thread Basile B. via Digitalmars-d
On Sunday, 4 September 2016 at 08:42:43 UTC, Martin Nowak wrote: On Sunday, 4 September 2016 at 07:24:42 UTC, Basile B. wrote: The introspection creates a special structure for each property annotated with @Set, @Get, or @SetGet. This is a kind of interface for serialization/binding/object

Re: Usability of "allMembers and derivedMembers traits now only return visible symbols"

2016-09-04 Thread Basile B. via Digitalmars-d
On Sunday, 4 September 2016 at 03:45:50 UTC, Martin Nowak wrote: On Saturday, 3 September 2016 at 17:23:53 UTC, Basile B. wrote: On Saturday, 3 September 2016 at 16:52:50 UTC, Martin Nowak wrote: On Tuesday, 30 August 2016 at 22:24:12 UTC, Ali Çehreli wrote: I don't agree with the current

Re: Usability of "allMembers and derivedMembers traits now only return visible symbols"

2016-09-03 Thread Basile B. via Digitalmars-d
On Saturday, 3 September 2016 at 20:54:19 UTC, Andrei Alexandrescu wrote: On 9/3/16 10:50 PM, Basile B. wrote: On Saturday, 3 September 2016 at 20:40:57 UTC, Andrei Alexandrescu wrote: Martin, any chance we can undo this change to the language? The problem is deeper. If he undoes the change

Re: Usability of "allMembers and derivedMembers traits now only return visible symbols"

2016-09-03 Thread Basile B. via Digitalmars-d
On Saturday, 3 September 2016 at 20:40:57 UTC, Andrei Alexandrescu wrote: Martin, any chance we can undo this change to the language? The problem is deeper. If he undoes the change then what will happen again is that the results of allMembers won't be usable by the other traits, e.g

Re: Usability of "allMembers and derivedMembers traits now only return visible symbols"

2016-09-03 Thread Basile B. via Digitalmars-d
On Saturday, 3 September 2016 at 16:52:50 UTC, Martin Nowak wrote: On Tuesday, 30 August 2016 at 22:24:12 UTC, Ali Çehreli wrote: I don't agree with the current solution: Well let's come up with a better solution then. Let's start by finding some proper use-cases that require introspection

Re: Hash table element existence check

2016-09-03 Thread Basile B. via Digitalmars-d-learn
On Friday, 2 September 2016 at 19:38:34 UTC, Illuminati wrote: I am trying to create a hash table and would like an efficient way to be able to know if an element exists to test for collisions. I could keep a bitarray, but wasting around 12% space. I could use pointers(null check) to

Re: Beta D 2.071.2-b3

2016-09-02 Thread Basile B. via Digitalmars-d-announce
On Friday, 2 September 2016 at 10:29:41 UTC, David Nadlinger wrote: On Friday, 2 September 2016 at 08:57:14 UTC, Basile B. wrote: On Friday, 2 September 2016 at 08:15:53 UTC, ketmar wrote: std.traits wrappers should use __traits to build *safe* things (declaring that @trusted in the end).

Re: Beta D 2.071.2-b3

2016-09-02 Thread Basile B. via Digitalmars-d-announce
On Friday, 2 September 2016 at 08:15:53 UTC, ketmar wrote: std.traits wrappers should use __traits to build *safe* things (declaring that @trusted in the end). This has nothing to do with memory safety. It's just that protection attributes were invented for OOP and when applied to template

Re: DUB, link automatically right object for platform and archi

2016-09-02 Thread Basile B. via Digitalmars-d-learn
On Friday, 2 September 2016 at 03:24:58 UTC, rikki cattermole wrote: On 02/09/2016 6:01 AM, Basile B. wrote: [...] What's wrong in my description ? For starters Ouch... buildSettings is just a name given to a group of properties. It doesn't actually go INTO the dub file. Thx much, this

Re: DUB, link automatically right object for platform and archi

2016-09-01 Thread Basile B. via Digitalmars-d-learn
On Thursday, 1 September 2016 at 18:01:19 UTC, Basile B. wrote: I've converted this section: [...] to: "buildSettings" : { "dflags-linux-x86" : ["objects/coff32/beaengine.o"], "dflags-linux-x86_64" : ["objects/coff64/beaengine.o"], "dflags-windows-x86" :

Re: Usability of "allMembers and derivedMembers traits now only return visible symbols"

2016-09-01 Thread Basile B. via Digitalmars-d
On Wednesday, 31 August 2016 at 13:29:52 UTC, Basile B. wrote: On Wednesday, 31 August 2016 at 13:12:30 UTC, Adam D. Ruppe wrote: Ugh, it really should just give everything and have getMember bypass it. That won't even break any code! you're right. "allMembers" means "all" after all. Another

<    5   6   7   8   9   10   11   12   13   14   >