Re: Command Line Parsing

2017-04-12 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder wrote: Are Argon https://github.com/markuslaker/Argon or darg https://github. com/jasonwhite/darg getting traction as the default command line handling system for D or are they just peripheral and everyone just uses std.getopt

Command Line Parsing

2017-04-12 Thread Russel Winder via Digitalmars-d-learn
Are Argon https://github.com/markuslaker/Argon or darg https://github. com/jasonwhite/darg getting traction as the default command line handling system for D or are they just peripheral and everyone just uses std.getopt https://dlang.org/phobos/std_getopt.html ? -- Russel.

Re: Command Line Parsing

2017-04-12 Thread rikki cattermole via Digitalmars-d-learn
On 12/04/2017 10:51 AM, Russel Winder via Digitalmars-d-learn wrote: Are Argon https://github.com/markuslaker/Argon or darg https://github. com/jasonwhite/darg getting traction as the default command line handling system for D or are they just peripheral and everyone just uses std.getopt

Re: Command Line Parsing

2017-04-12 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder wrote: Are Argon https://github.com/markuslaker/Argon or darg https://github. com/jasonwhite/darg getting traction as the default command line handling system for D or are they just peripheral and everyone just uses std.getopt

Practical difference between template "alias" arguments/normal generic arguments in this case?

2017-04-12 Thread Juanjo Alvarez via Digitalmars-d-learn
Hi! With "alias this" accepting runtime variables I'm struggling to understand the difference between a generic function with an "alias this" parameter and another one with a "runtime" parameter of template type. Example: // example code import std.stdio: writeln; void

Re: CTFE using of replaceAll from std.regex posible?

2017-04-12 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 12:00:27 UTC, Martin Tschierschke wrote: It there a way to use "replaceAll" at compile time? Regards mt. Not yet :) I assume it would bring the current system to it's needs. I you want to experiment you could replace malloc with new.

Re: ctfe append too slow, but can't speed up

2017-04-12 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 11 April 2017 at 02:20:37 UTC, Jethro wrote: ctfe string appending is way to slow, I have tried the suggested methods and nothing works and slows down by at least an order of magnitude. I need a drop in replacement(no other changes) that can take over the duties of string and

Re: Use of "T"

2017-04-12 Thread solidstate1991 via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 13:54:11 UTC, qznc wrote: On Wednesday, 12 April 2017 at 13:17:42 UTC, solidstate1991 wrote: How can I make use of T? I've seen it being used many times for this application. What "T"? This letter is often used as a generic template parameter. Are you talking

Use of "T"

2017-04-12 Thread solidstate1991 via Digitalmars-d-learn
Some utilities of my game engine needs a two-way "dictionary", mainly for increasing the readability of configuration files, but I was thinking on letting the end-user to use it for certain things and I don't want to recreate the encode/decode/load from SDLang file functions every time I have

Re: Use of "T"

2017-04-12 Thread qznc via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 13:17:42 UTC, solidstate1991 wrote: How can I make use of T? I've seen it being used many times for this application. What "T"? This letter is often used as a generic template parameter. Are you talking about templates? Maybe you can give some examples of the

Re: Use of "T"

2017-04-12 Thread XavierAP via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 14:46:20 UTC, solidstate1991 wrote: Yes, templates. I've looked this up a bit, and I found it. I want to use it to use the dictionaries for different things than string<->int conversion. T is just the common name of a (type) parameter, mostly whenever the

CTFE using of replaceAll from std.regex posible?

2017-04-12 Thread Martin Tschierschke via Digitalmars-d-learn
Hello, when trying to process an string at compile time with ... auto reg = ctRegex!`as\ [a-z]+`; enum replaced = replaceAll(call,reg,""); I get: /usr/include/dmd/phobos/std/regex/package.d(708,34): Error: malloc cannot be interpreted at compile time, because it has no available source code

Re: Practical difference between template "alias" arguments/normal generic arguments in this case?

2017-04-12 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 11:06:13 UTC, Juanjo Alvarez wrote: Hi! With "alias this" accepting runtime variables I'm struggling to FYI, you are not talking about "alias this", but "alias template parameters", two very different concepts. understand the difference between a generic

Re: Practical difference between template "alias" arguments/normal generic arguments in this case?

2017-04-12 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 11:06:13 UTC, Juanjo Alvarez wrote: Hi! With "alias this" accepting runtime variables I'm struggling to understand the difference between a generic function with an "alias this" parameter and another one with a "runtime" parameter of template type. Example:

Re: Practical difference between template "alias" arguments/normal generic arguments in this case?

2017-04-12 Thread Juanjo Alvarez via Digitalmars-d-learn
Thanks to both, I got it. Type templates for generic types, and alias for other things knowing that the instantiation is by symbol. Yes, the "alias this" in my message was a (double) brainfart, I actually wanted to write "alias template". In this case both functions had the same assembler

Re: warning: pointer not aligned at address

2017-04-12 Thread Andrew Edwards via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 03:18:32 UTC, Matt Whisenhunt wrote: ld: warning: pointer not aligned at address 0x100050C7D Are you running macOS and recently installed an update to Xcode? I ran into this today as well. Looks like other have too:

ctRegex with variable?

2017-04-12 Thread Jethro via Digitalmars-d-learn
Can regex's have variables in them? I'd like to create a ctRegex but match on runtime strings that are known at runtime. e.g., auto c = ctRegex~("x{var}") where var is a variable that is passed at runtime. e.g., match(s, c, "test") will replace var with test. The reason is I basically have

Re: Use of "T"

2017-04-12 Thread solidstate1991 via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 16:05:23 UTC, XavierAP wrote: On Wednesday, 12 April 2017 at 14:46:20 UTC, solidstate1991 wrote: T is just the common name of a (type) parameter, mostly whenever the template is more generic that you can't think of a more informative (template) parameter

Re: ctRegex with variable?

2017-04-12 Thread Ali Çehreli via Digitalmars-d-learn
On 04/12/2017 02:25 PM, Jethro wrote: Can regex's have variables in them? I'd like to create a ctRegex but match on runtime strings that are known at runtime. e.g., auto c = ctRegex~("x{var}") where var is a variable that is passed at runtime. e.g., match(s, c, "test") will replace var with

Re: Use of "T"

2017-04-12 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 22:56:25 UTC, solidstate1991 wrote: I know the existence of those and I'm frequently using them, however I need a two-way one. (Might be using two hash-tables instead if I can't find a better solution) So, you're looking for a generic way to store objects of