Re: Regex multiple matches

2017-04-13 Thread rikki cattermole via Digitalmars-d-learn
On 14/04/2017 3:54 AM, Jethro wrote: using the rule (?Pregex) e.g., (?P\w*)* how do we get at all the matches, e.g., Joe Bob Buddy? When I access the results captures they are are not arrays and I only ever get the first match even when I'm using matchAll. Pseudo code: foreach(result; match

Regex multiple matches

2017-04-13 Thread Jethro via Digitalmars-d-learn
using the rule (?Pregex) e.g., (?P\w*)* how do we get at all the matches, e.g., Joe Bob Buddy? When I access the results captures they are are not arrays and I only ever get the first match even when I'm using matchAll.

Re: a newbie problem regarding splitter()

2017-04-13 Thread alex via Digitalmars-d-learn
On Thursday, 13 April 2017 at 06:42:30 UTC, Ali Çehreli wrote: On 04/12/2017 11:33 PM, alex wrote: > Hello, > "The D Programming Language" by Andrei Alexandrescu. Great book but a lot has changed in D since the book was written in 2010. Your issue is in the book's errata: http://erdani.com/

Re: ordered Associative array

2017-04-13 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Apr 14, 2017 at 12:29:34AM +, Jethro via Digitalmars-d-learn wrote: > Is there a way to retain the ordering of an associative array? When > the elements are added then looped over using a foreach, the order is > different. An AA is implemented as an unordered hash. So the insertion ord

Re: ordered Associative array

2017-04-13 Thread solidstate1991 via Digitalmars-d-learn
On Friday, 14 April 2017 at 00:29:34 UTC, Jethro wrote: Is there a way to retain the ordering of an associative array? When the elements are added then looped over using a foreach, the order is different. Use a separate array to store the keys, order them all time when you add a new one, etc.

ordered Associative array

2017-04-13 Thread Jethro via Digitalmars-d-learn
Is there a way to retain the ordering of an associative array? When the elements are added then looped over using a foreach, the order is different.

Re: Generating switch at Compile Time

2017-04-13 Thread ag0aep6g via Digitalmars-d-learn
On 04/13/2017 11:06 PM, Jesse Phillips wrote: - [...] private static immutable list = AliasSeq!( tuple("a", "q"), tuple("b", "r"), ); [...] switch(search) { --->foreach(li; list) { // li initialization is skipped

Generating switch at Compile Time

2017-04-13 Thread Jesse Phillips via Digitalmars-d-learn
I realize that this is likely really pushing the compile time generation but a recent change to the switch statement[1] is surfacing because of this usage. uninitswitch2.d(13): Deprecation: 'switch' skips declaration of variable uninits witch2.main.li at uninitswitch2.d(14) -

using joyent manta public cloud storage service

2017-04-13 Thread flamencofantasy via Digitalmars-d-learn
hello, I'm trying to use the joyent manta storage service via their REST api. https://apidocs.joyent.com/manta/api.html For that i need to implement http signature over TLS. Here is a shell function that does that; function manta { local alg=rsa-sha256 local keyId=/$MANTA_USER/keys/$MANTA_KEY_

Re: ctRegex with variable?

2017-04-13 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 12 April 2017 at 21:25:40 UTC, 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}") As mentioned by Ali, benchmark for your use case. If var has common values (e

Re: ndslice summary please

2017-04-13 Thread 9il via Digitalmars-d-learn
On Thursday, 13 April 2017 at 15:22:46 UTC, Martin Tschierschke wrote: On Thursday, 13 April 2017 at 08:47:16 UTC, Ali Çehreli wrote: I haven't played with ndslice nor followed its deprecation discussions. Could someone summarize it for us please. Also, is it still used outside Phobos or is Ily

Re: ndslice summary please

2017-04-13 Thread 9il via Digitalmars-d-learn
On Thursday, 13 April 2017 at 15:22:46 UTC, Martin Tschierschke wrote: On Thursday, 13 April 2017 at 08:47:16 UTC, Ali Çehreli wrote: I haven't played with ndslice nor followed its deprecation discussions. Could someone summarize it for us please. Also, is it still used outside Phobos or is Ily

Re: How to continue after the book?

2017-04-13 Thread Vasudev Ram via Digitalmars-d-learn
On Tuesday, 28 March 2017 at 07:27:31 UTC, I Lindström wrote: After getting the basics down, how did you continue when learning programming in general? Many other good suggestions here already. 1. Another idea: pick some small tools or utilities that you would like to create, and write them i

Re: ndslice summary please

2017-04-13 Thread Martin Tschierschke via Digitalmars-d-learn
On Thursday, 13 April 2017 at 08:47:16 UTC, Ali Çehreli wrote: I haven't played with ndslice nor followed its deprecation discussions. Could someone summarize it for us please. Also, is it still used outside Phobos or is Ilya or someone else rewriting it? Ali We should additionally mention

Re: ndslice summary please

2017-04-13 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 13 April 2017 at 15:00:16 UTC, Dejan Lekic wrote: On Thursday, 13 April 2017 at 10:00:43 UTC, 9il wrote: On Thursday, 13 April 2017 at 08:47:16 UTC, Ali Çehreli wrote: [...] The reasons to use mir-algorithm instead of std.range, std.algorithm, std.functional (when applicable):

Re: ndslice summary please

2017-04-13 Thread Dejan Lekic via Digitalmars-d-learn
On Thursday, 13 April 2017 at 10:00:43 UTC, 9il wrote: On Thursday, 13 April 2017 at 08:47:16 UTC, Ali Çehreli wrote: I haven't played with ndslice nor followed its deprecation discussions. Could someone summarize it for us please. Also, is it still used outside Phobos or is Ilya or someone els

Re: ndslice summary please

2017-04-13 Thread 9il via Digitalmars-d-learn
On Thursday, 13 April 2017 at 08:47:16 UTC, Ali Çehreli wrote: I haven't played with ndslice nor followed its deprecation discussions. Could someone summarize it for us please. Also, is it still used outside Phobos or is Ilya or someone else rewriting it? Ali The reasons to use mir-algorith

Re: ndslice summary please

2017-04-13 Thread 9il via Digitalmars-d-learn
On Thursday, 13 April 2017 at 08:47:16 UTC, Ali Çehreli wrote: I haven't played with ndslice nor followed its deprecation discussions. Could someone summarize it for us please. Also, is it still used outside Phobos or is Ilya or someone else rewriting it? Ali Hello Ali, ndslice was removed

ndslice summary please

2017-04-13 Thread Ali Çehreli via Digitalmars-d-learn
I haven't played with ndslice nor followed its deprecation discussions. Could someone summarize it for us please. Also, is it still used outside Phobos or is Ilya or someone else rewriting it? Ali