Re: Removing items from an Array

2012-02-20 Thread James Miller
On 18 February 2012 05:30, Jonathan M Davis wrote: > On Friday, February 17, 2012 14:44:42 Mars wrote: >> On Friday, 17 February 2012 at 13:33:25 UTC, James Miller wrote: >> > AAs don't keep the key order, so when you delete something out >> > of it, >> > what ever system iterates to the next poin

Re: std.regex named matches

2012-02-20 Thread James Miller
On 20 February 2012 21:34, Dmitry Olshansky wrote: > 08.02.2012 13:07, James Miller пишет: >> >> Hi, >> >> I am using std.regex and using the named matches. I would like to be >> able to get at the names that have matched, since this is library >> code. >> >> e.g. >> >>     auto m = match("test/2"

Re: A inner pure function problem

2012-02-20 Thread bearophile
Timon Gehr: > T outer(T)(T function(in T) pure foo) pure { > immutable fooTick = foo; > pure int inner() { > return fooTick(5); // line 3 > } > return inner(); > } > int sqr(in int x) pure { > return x * x; > } > void main() { > assert(outer(&sqr) == 25); /

Re: Problems linking libdl?

2012-02-20 Thread simendsjo
On Mon, 20 Feb 2012 22:26:58 +0100, Mike Wey wrote: On 02/20/2012 09:49 PM, simendsjo wrote: On Mon, 20 Feb 2012 21:41:45 +0100, simendsjo wrote: I've tried the following using dmd 58 and trunk - both -m64 on kubuntu. Any idea what I'm doing wrong? import std.loader; void main(string[]

Re: Problems linking libdl?

2012-02-20 Thread Mike Wey
On 02/20/2012 09:49 PM, simendsjo wrote: On Mon, 20 Feb 2012 21:41:45 +0100, simendsjo wrote: I've tried the following using dmd 58 and trunk - both -m64 on kubuntu. Any idea what I'm doing wrong? import std.loader; void main(string[] args) { auto res = ExeModule_Init(); assert(res == 0); sc

Re: Problems linking libdl?

2012-02-20 Thread simendsjo
On Mon, 20 Feb 2012 21:41:45 +0100, simendsjo wrote: I've tried the following using dmd 58 and trunk - both -m64 on kubuntu. Any idea what I'm doing wrong? import std.loader; void main(string[] args) { auto res = ExeModule_Init(); assert(res == 0); scope(exit) ExeModule_Uninit(

Problems linking libdl?

2012-02-20 Thread simendsjo
I've tried the following using dmd 58 and trunk - both -m64 on kubuntu. Any idea what I'm doing wrong? import std.loader; void main(string[] args) { auto res = ExeModule_Init(); assert(res == 0); scope(exit) ExeModule_Uninit(); auto mod = ExeModule_Load("./libtcod.so"); } $ dmd-

Re: A inner pure function problem

2012-02-20 Thread Timon Gehr
On 02/20/2012 02:26 PM, bearophile wrote: This code looks interesting (maybe this code is also able to spot a bug in DMD, or it is able to show something I have not fully understood in D). Do you know if there are interesting ways to compile it? T outer(T)(T function(in T) pure foo) pure {

A inner pure function problem

2012-02-20 Thread bearophile
This code looks interesting (maybe this code is also able to spot a bug in DMD, or it is able to show something I have not fully understood in D). Do you know if there are interesting ways to compile it? T outer(T)(T function(in T) pure foo) pure { pure int inner() { return foo(5);

Re: Everything on the Stack

2012-02-20 Thread bearophile
Janthinidae: > Thanks to a reddit thread I stumbled over D and thought I should give > it a chance. Welcome here then. Your post is quite interesting, your questions are complex. > I'm currently working on project where hard RT > requirements matter. In most places the GC is not suitable. Plea

Re: Compiling DMD on MAC OS X

2012-02-20 Thread Tyro[a.c.edwards]
On Sunday, 19 February 2012 at 11:39:15 UTC, kraybourne wrote: On 2/19/12 09:20 , Tyro[a.c.edwards] wrote: Hi all, I've just installed DMD 2.058 and attempted to compile a little script but was greeted with the following error: gcc: Invalid argument I used the .dmg installer from http://ww

Re: vim tips for D development

2012-02-20 Thread simendsjo
On Sun, 19 Feb 2012 23:02:21 +0100, Kiith-Sa <4...@theanswer.com> wrote: On Sunday, 19 February 2012 at 20:09:58 UTC, simendsjo wrote: On Sun, 19 Feb 2012 17:00:37 +0100, Kiith-Sa <4...@theanswer.com> wrote: Thanks. supertab and autoComplPop seems really nice. A couple of other stuff to add

Re: Everything on the Stack

2012-02-20 Thread Trass3r
scope auto e1 = new EntryInt(); Foo = e1.toFoo(); You don't need auto there. And scope is deprecated, use std.typecons' scoped

Re: std.regex named matches

2012-02-20 Thread Dmitry Olshansky
08.02.2012 13:07, James Miller пишет: Hi, I am using std.regex and using the named matches. I would like to be able to get at the names that have matched, since this is library code. e.g. auto m = match("test/2", regex(r"(?P\w+)/(?P\d)")); //either auto names = m.names; //o