Re: Examples of dub use needed

2016-06-20 Thread Jacob Carlborg via Digitalmars-d
On 2016-06-21 06:42, Guido wrote: Dub doesn't really work like other package managers. When I load a package: dub fetch scriptlike It stores it someplace and doesn't say where. You have to run 'dub list' to figure out where. That's is very different than other packages. It deserves a bigger men

Re: Need DMD AST expertise

2016-06-20 Thread Jacob Carlborg via Digitalmars-d
On 2016-06-20 22:52, Guillaume Chatelet wrote: The TemplateInstance [1] gives me `tiargs` and `tdtypes`. // Array of Types/Expressions of template // instance arguments [int*, char, 10*10] Objects* tiargs; // Array of Types/Expressions corresponding // to TemplateDeclaratio

Re: Performance issue in struct initialization

2016-06-20 Thread Johannes Pfau via Digitalmars-d
Am Mon, 20 Jun 2016 20:34:12 + schrieb Basile B. : > On Monday, 20 June 2016 at 11:45:28 UTC, Johannes Pfau wrote: > > Am Sun, 19 Jun 2016 20:52:52 + > > schrieb deadalnix : > > > >> On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: > >> > On Saturday, 23 April 2016 at 13:37:31

Examples of dub use needed

2016-06-20 Thread Guido via Digitalmars-d
Dub doesn't really work like other package managers. When I load a package: dub fetch scriptlike It stores it someplace and doesn't say where. You have to run 'dub list' to figure out where. That's is very different than other packages. It deserves a bigger mention in the meager documentatio

Re: Possible bug in std.path?

2016-06-20 Thread Hugo via Digitalmars-d
On Monday, 20 June 2016 at 12:55:21 UTC, ag0aep6g wrote: On Monday, 20 June 2016 at 12:38:23 UTC, Hugo wrote: Not necessarily, cmd.exe is made in C/C++ AFAIK, most other console applications for Windows behave the same way too. As seen on MSDN, it's how "Microsoft C/C++ startup code" does it

Re: Phobos: __FILE__ as template default parameter

2016-06-20 Thread ZombineDev via Digitalmars-d
On Tuesday, 21 June 2016 at 02:59:44 UTC, ZombineDev wrote: On Monday, 20 June 2016 at 14:28:06 UTC, Jacob Carlborg wrote: On 2016-06-19 12:43, Dicebot wrote: Yes. It is necessary because runtime parameter list is variadic - template bloat in such cases is usually eliminated by forwarding to

Re: Phobos: __FILE__ as template default parameter

2016-06-20 Thread ZombineDev via Digitalmars-d
On Monday, 20 June 2016 at 14:28:06 UTC, Jacob Carlborg wrote: On 2016-06-19 12:43, Dicebot wrote: Yes. It is necessary because runtime parameter list is variadic - template bloat in such cases is usually eliminated by forwarding to another private method immediately turning file/line into fi

Re: Need DMD AST expertise

2016-06-20 Thread Guillaume Chatelet via Digitalmars-d
On Monday, 20 June 2016 at 18:59:09 UTC, Jacob Carlborg wrote: On 2016-06-20 14:33, Guillaume Chatelet wrote: Problem 2: -- Template arguments that are of basic types are mangled in a special way which requires to understand which 'int' is which. extern(C++) A foo(A, B)(B, A, B); st

Re: Performance issue in struct initialization

2016-06-20 Thread Basile B. via Digitalmars-d
On Monday, 20 June 2016 at 11:45:28 UTC, Johannes Pfau wrote: Am Sun, 19 Jun 2016 20:52:52 + schrieb deadalnix : On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: > On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei > Alexandrescu wrote: >> https://issues.dlang.org/show_bug.cgi?id=

Re: Fiber implementation questions

2016-06-20 Thread deadalnix via Digitalmars-d
On Monday, 20 June 2016 at 15:43:27 UTC, Ilya Yaroshenko wrote: Hello, I am thinking about faster event loop that vibe.d has (does not matter what driver are used). I want to implement (at least DIP) advanced Fiber yielding loop that can allow to eliminate context switching for all kind of ev

Re: Need DMD AST expertise

2016-06-20 Thread Jacob Carlborg via Digitalmars-d
On 2016-06-20 14:33, Guillaume Chatelet wrote: Problem 2: -- Template arguments that are of basic types are mangled in a special way which requires to understand which 'int' is which. extern(C++) A foo(A, B)(B, A, B); static assert(foo!(int,int).mangleof == "_Z3fooIiiET_T0_S0_S1_");

Re: UTF-8 Everywhere

2016-06-20 Thread Charles Hixson via Digitalmars-d
On 06/19/2016 11:44 PM, Walter Bright via Digitalmars-d wrote: On 6/19/2016 11:36 PM, Charles Hixson via Digitalmars-d wrote: To me it seems that a lot of the time processing is more efficient with UCS-4 (what I call utf-32). Storage is clearly more efficient with utf-8, but access is more dir

Re: Fiber implementation questions

2016-06-20 Thread Dicebot via Digitalmars-d
On 06/20/2016 06:43 PM, Ilya Yaroshenko wrote: > Hello, > > I am thinking about faster event loop that vibe.d has (does not matter > what driver are used). I want to implement (at least DIP) advanced Fiber > yielding loop that can allow to eliminate context switching for all kind > of event waiter

Re: Phobos: __FILE__ as template default parameter

2016-06-20 Thread Simen Kjaeraas via Digitalmars-d
On Monday, 20 June 2016 at 14:28:06 UTC, Jacob Carlborg wrote: Would it be a bad idea to allow this in the compiler: void foo(Args...)(Args args, string file = __FILE__, size_t line = __LINE__); It wouldn't be possible to pass "file" or "line" when calling "foo". But it's useful for the spe

Re: More suggestions for find()

2016-06-20 Thread qznc via Digitalmars-d
On Monday, 20 June 2016 at 13:27:59 UTC, Jack Stouffer wrote: On Monday, 20 June 2016 at 12:34:55 UTC, qznc wrote: On Sunday, 19 June 2016 at 10:38:27 UTC, qznc wrote: On Saturday, 18 June 2016 at 18:54:28 UTC, Andrei Alexandrescu wrote: Got this link from the reddit discussion around the blog

Re: Fiber implementation questions

2016-06-20 Thread Sönke Ludwig via Digitalmars-d
Am 20.06.2016 um 17:43 schrieb Ilya Yaroshenko: Hello, I am thinking about faster event loop that vibe.d has (does not matter what driver are used). I want to implement (at least DIP) advanced Fiber yielding loop that can allow to eliminate context switching for all kind of event waiters. I'm

Fiber implementation questions

2016-06-20 Thread Ilya Yaroshenko via Digitalmars-d
Hello, I am thinking about faster event loop that vibe.d has (does not matter what driver are used). I want to implement (at least DIP) advanced Fiber yielding loop that can allow to eliminate context switching for all kind of event waiters. Q1: Is it save to detach Fiber context from one th

Re: More suggestions for find()

2016-06-20 Thread Andrei Alexandrescu via Digitalmars-d
On 6/20/16 8:34 AM, qznc wrote: On Sunday, 19 June 2016 at 10:38:27 UTC, qznc wrote: On Saturday, 18 June 2016 at 18:54:28 UTC, Andrei Alexandrescu wrote: Got this link from the reddit discussion around the blog article: http://effbot.org/zone/stringlib.htm. The Bloom-filter-style trick looks q

Re: Need DMD AST expertise

2016-06-20 Thread Johan Engelen via Digitalmars-d
On Monday, 20 June 2016 at 14:06:57 UTC, Guillaume Chatelet wrote: Thx Johan. I'm confused though Sorry for misreading your question.

Re: inout and opApply

2016-06-20 Thread Steven Schveighoffer via Digitalmars-d
On 6/20/16 9:55 AM, Dicebot wrote: On 06/20/2016 04:47 PM, Shachar Shemesh wrote: Please consider the following program: struct V(T) { int opApply(scope int delegate(ref T value) dg) { return 0; } int opApply(scope int delegate(ref const T value) dg) const { return 0

Re: Need DMD AST expertise

2016-06-20 Thread Guillaume Chatelet via Digitalmars-d
On Monday, 20 June 2016 at 14:42:22 UTC, Jacob Carlborg wrote: On 2016-06-20 16:06, Guillaume Chatelet wrote: Thx Johan. I'm confused though: `FuncDeclaration.linkage` is the linkage for the function (which I already know is C++ function since I'm mangling it) but I need the linkage for the Pa

Re: Need DMD AST expertise

2016-06-20 Thread Jacob Carlborg via Digitalmars-d
On 2016-06-20 16:06, Guillaume Chatelet wrote: Thx Johan. I'm confused though: `FuncDeclaration.linkage` is the linkage for the function (which I already know is C++ function since I'm mangling it) but I need the linkage for the Parameter. Parameter has a Type but I can't get the linkage from he

Re: Phobos: __FILE__ as template default parameter

2016-06-20 Thread Jacob Carlborg via Digitalmars-d
On 2016-06-19 12:43, Dicebot wrote: Yes. It is necessary because runtime parameter list is variadic - template bloat in such cases is usually eliminated by forwarding to another private method immediately turning file/line into first runtime argument instead. Would it be a bad idea to allow th

Re: Need DMD AST expertise

2016-06-20 Thread Guillaume Chatelet via Digitalmars-d
On Monday, 20 June 2016 at 13:50:45 UTC, Johan Engelen wrote: On Monday, 20 June 2016 at 12:33:31 UTC, Guillaume Chatelet wrote: class Expression; extern(C++) void foo(Expression); Question: - - How to I get the linkage for Expression from a FunDeclaration? This will ensure the adde

Re: inout and opApply

2016-06-20 Thread Dicebot via Digitalmars-d
On 06/20/2016 04:47 PM, Shachar Shemesh wrote: > Please consider the following program: > > struct V(T) { > int opApply(scope int delegate(ref T value) dg) { > return 0; > } > int opApply(scope int delegate(ref const T value) dg) const { > return 0; > } > } > > str

Re: Need DMD AST expertise

2016-06-20 Thread Johan Engelen via Digitalmars-d
On Monday, 20 June 2016 at 12:33:31 UTC, Guillaume Chatelet wrote: class Expression; extern(C++) void foo(Expression); Question: - - How to I get the linkage for Expression from a FunDeclaration? This will ensure the added indirection is put only for the D classes, not the C++ ones.

inout and opApply

2016-06-20 Thread Shachar Shemesh via Digitalmars-d
Please consider the following program: struct V(T) { int opApply(scope int delegate(ref T value) dg) { return 0; } int opApply(scope int delegate(ref const T value) dg) const { return 0; } } struct V1(T) { int opApply(scope int delegate(ref inout T value) dg)

Re: More suggestions for find()

2016-06-20 Thread Jack Stouffer via Digitalmars-d
On Monday, 20 June 2016 at 12:34:55 UTC, qznc wrote: On Sunday, 19 June 2016 at 10:38:27 UTC, qznc wrote: On Saturday, 18 June 2016 at 18:54:28 UTC, Andrei Alexandrescu wrote: Got this link from the reddit discussion around the blog article: http://effbot.org/zone/stringlib.htm. The Bloom-filt

Re: problem using ldc 1.0.0 as D compiler

2016-06-20 Thread David Nadlinger via Digitalmars-d
Hi Antonio, On Monday, 20 June 2016 at 11:28:58 UTC, Antonio Corbi wrote: ./ldcfail Fatal Error while loading '/usr/lib/libphobos2-ldc.so.70': The module 'std.regex.internal.parser' is already defined in './ldcfail'. […] Is this a bug in ldc or is it somehow related to my code? Thank

Re: Possible bug in std.path?

2016-06-20 Thread ag0aep6g via Digitalmars-d
On Monday, 20 June 2016 at 12:38:23 UTC, Hugo wrote: Not necessarily, cmd.exe is made in C/C++ AFAIK, most other console applications for Windows behave the same way too. As seen on MSDN, it's how "Microsoft C/C++ startup code" does it. It's what you get in a C main's argv. Populating a D mai

Re: Phobos Action Items

2016-06-20 Thread qznc via Digitalmars-d
On Saturday, 18 June 2016 at 20:04:50 UTC, Walter Bright wrote: Starting a new thread with this, as requested. There are things here for all skill levels and time commitments. 3. use -cov to improve code coverage of Phobos unittests 4. make sure every function in Phobos has an example 5. make

Re: Possible bug in std.path?

2016-06-20 Thread Hugo via Digitalmars-d
On Monday, 20 June 2016 at 10:01:25 UTC, ag0aep6g wrote: On the other hand, the way D gets the arguments is the same as in C/C++. Doing it differently than that would be unusual, too. Not necessarily, cmd.exe is made in C/C++ AFAIK, most other console applications for Windows behave the same w

Re: More suggestions for find()

2016-06-20 Thread qznc via Digitalmars-d
On Sunday, 19 June 2016 at 10:38:27 UTC, qznc wrote: On Saturday, 18 June 2016 at 18:54:28 UTC, Andrei Alexandrescu wrote: Got this link from the reddit discussion around the blog article: http://effbot.org/zone/stringlib.htm. The Bloom-filter-style trick looks quite cool. Anyone interested in

Need DMD AST expertise

2016-06-20 Thread Guillaume Chatelet via Digitalmars-d
Context: I'm working on a more correct implementation of the C++ name mangling for Linux/OSX. This is needed for the integration with C++/STL. Problem 1: -- In the following D code 'Expression' is a D class, 'foo' is a C++

Re: Performance issue in struct initialization

2016-06-20 Thread Johannes Pfau via Digitalmars-d
Am Sun, 19 Jun 2016 20:52:52 + schrieb deadalnix : > On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: > > On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu > > wrote: > >> https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few > >> obvious cases, but finding

Re: Performance issue in struct initialization

2016-06-20 Thread Johannes Pfau via Digitalmars-d
Am Sat, 28 May 2016 07:08:52 + schrieb Era Scarecrow : > On Friday, 27 May 2016 at 09:02:17 UTC, Johan Engelen wrote: > > That language guarantee prevents optimization of the > > initialization (in this case, the optimized result would be no > > initialization at all). So a breaking language

problem using ldc 1.0.0 as D compiler

2016-06-20 Thread Antonio Corbi via Digitalmars-d
Hi folks! I'm using ldc version: LDC - the LLVM D compiler (1.0.0): based on DMD v2.070.2 and LLVM 3.8.0 built with DMD64 D Compiler v2.071.0 Default target: x86_64-unknown-linux-gnu Host CPU: core2 And when trying to run this code (it compiles ok): import std.regex; void main(string[]

Re: Parameterized inheritence issues, bug or ignorance?

2016-06-20 Thread Kagamin via Digitalmars-d
On Monday, 20 June 2016 at 00:01:58 UTC, Joerg Joergonson wrote: I have a gui based on the following classes: public class Widget { Widget Parent; } public class Item : Widget; public class Button(T : ButtonItem) : Widget { T[] Items; ... } public class ButtonItem : Item { void Do() { auto par

Re: Possible bug in std.path?

2016-06-20 Thread ag0aep6g via Digitalmars-d
On Monday, 20 June 2016 at 02:19:22 UTC, Hugo wrote: Perhaps I should have said unusual rather than non-standard. But if you want to understand better what I mean, try doing this in the command line, it works correctly: cd \ mkdir test cd test\ mkdir "..\second test\" cd "..\second test\" On

Re: Possible bug in std.path?

2016-06-20 Thread Hugo via Digitalmars-d
On Monday, 20 June 2016 at 05:44:53 UTC, Mike Parker wrote: It shouldn't hurt to use the A variant, as Windows will do the necessary conversions under the hood. However, I'd love to know what the problem is with converting wchar* to a string type. This also prints an address: auto foo = "I'm

Re: Phobos: __FILE__ as template default parameter

2016-06-20 Thread Dicebot via Digitalmars-d
On 06/20/2016 01:13 AM, Johan Engelen wrote: > On Sunday, 19 June 2016 at 21:40:20 UTC, David Nadlinger wrote: >> On Sunday, 19 June 2016 at 21:13:00 UTC, Johan Engelen wrote: >>> On Sunday, 19 June 2016 at 21:11:59 UTC, Johan Engelen wrote: (I think we can pretty much inline anything the user

Re: Phobos Action Items

2016-06-20 Thread Andrea Fontana via Digitalmars-d
On Saturday, 18 June 2016 at 20:04:50 UTC, Walter Bright wrote: 6. replace std.xml with something we can be proud of that is second to none in performance (Robert burner Schadek is mentoring on this https://github.com/lodo1995/experimental.xml) I hope it will support html and xpath too. Andr