Re: [OT] Generating ddili.org with ddoc

2013-11-03 Thread Ali Çehreli
On 11/03/2013 09:44 PM, Philippe Sigaud wrote: >>COMMA = , >>DOLLAR = $ > > > I saw these and wondered what they were for. Why comma and dollar? Actual comma inside a macro is taken as argument separator. From src/ders/d.en/operator_overloading.d: $(ROW3 slice to some elements, opSlic

Re: Current size of GC memory

2013-11-03 Thread Rainer Schuetze
On 03.11.2013 19:53, Namespace wrote: On Sunday, 3 November 2013 at 13:05:08 UTC, Namespace wrote: Is there a way to find out how much memory the GC used currently? Does not seem to be possible. Would have been nice. There is an "unofficial" function gc_stats here: https://github.com/D-Pr

Re: [OT] Generating ddili.org with ddoc

2013-11-03 Thread Philippe Sigaud
On Mon, Nov 4, 2013 at 6:05 AM, Ali Çehreli wrote: > On 11/02/2013 01:34 AM, Philippe Sigaud wrote: > > > Any limitation you hit with Ddoc? > > One annoyance is with parentheses in code sections. Ddoc allows using ddoc > macros even in code section and I like it because I can highlight parts of >

Re: [OT] Generating ddili.org with ddoc

2013-11-03 Thread Ali Çehreli
On 11/02/2013 01:34 AM, Philippe Sigaud wrote: > Any limitation you hit with Ddoc? One annoyance is with parentheses in code sections. Ddoc allows using ddoc macros even in code section and I like it because I can highlight parts of code by a macro. However, that means that unbalanced parent

Public template types

2013-11-03 Thread bearophile
Sometimes I have to make a template type argument visible inside the instantiated type: struct Foo(T_) { alias T = T_; } void main() { Foo!int f; static assert(is(f.T == int)); } A little of syntax sugar could do the same, avoiding the need for a new name as "T_": struct Foo(pu

Re: parse int error

2013-11-03 Thread Peter Eisenhower
On Wednesday, 30 October 2013 at 18:19:13 UTC, Ali Çehreli wrote: On 10/29/2013 06:02 PM, Peter Eisenhower wrote: I am confused as to why I cannot pass the return of the tag attribute directly into the parse int. // This works string s = xml.tag.attr["key"]; int key = parse!int(s); // Compi

Re: Current size of GC memory

2013-11-03 Thread Namespace
On Sunday, 3 November 2013 at 13:05:08 UTC, Namespace wrote: Is there a way to find out how much memory the GC used currently? Does not seem to be possible. Would have been nice.

Re: How to iterate using foreach on a class?

2013-11-03 Thread Nicolas Sicard
On Friday, 1 November 2013 at 12:37:20 UTC, simendsjo wrote: On Friday, 1 November 2013 at 11:41:52 UTC, Jonathan M Davis wrote: On Friday, November 01, 2013 12:30:10 Gary Willoughby wrote: I have a class which contains an array as a core collection of data. I want to pass an instance of this c

Current size of GC memory

2013-11-03 Thread Namespace
Is there a way to find out how much memory the GC used currently?

Re: How to iterate using foreach on a class?

2013-11-03 Thread Johannes Pfau
Am Fri, 01 Nov 2013 08:50:19 -0700 schrieb Ali Çehreli : > On 11/01/2013 08:32 AM, Dmitry Olshansky wrote: > > > In short we have 2 ways: > > 1) Ranges > > 2) opApply > > As another shameless plug, those foreach methods are included in this > chapter: > >http://ddili.org/ders/d.en/foreach_

Re: [challenge] Lazy flatten/avoiding type forward reference with map

2013-11-03 Thread Timon Gehr
On 10/31/2013 10:19 PM, Ali Çehreli wrote: ... Y Combinator? (No, I have not solved it yet. :) ) http://rosettacode.org/wiki/Y_combinator#D Ali Oh my god, my eyes! auto y(S,T...)(S delegate(T) delegate(S delegate(T)) f){ struct F{ S delegate(T) delegate(F) f; alias f this; } ret

Re: Linker error regarding importing and unit tests. Is this a bug?

2013-11-03 Thread Gary Willoughby
On Friday, 1 November 2013 at 16:24:09 UTC, Gary Willoughby wrote: On Friday, 1 November 2013 at 15:32:54 UTC, Daniel Davidson wrote: An alternative is to move the import statements in test1.d out of the unittest block, which becomes a function, to file scope. Then if you have multiple unittest

Re: Figuring out the returntype opDipatch

2013-11-03 Thread Jacob Carlborg
On 2013-11-03 03:15, TheFlyingFiddle wrote: In the IReflectionable interface: interface IReflectionable { final P funcPtr(P)(string fun) if (is(P == delegate)) { //Using mangeling for overloads and type safety auto ptr = delPtr_impl(mangle!P(fun)); P del; del.

Re: Associative Array: reasonable limits?

2013-11-03 Thread Dmitry Olshansky
03-Nov-2013 02:37, Charles Hixson пишет: I'm contemplating an associative array that will eventually grow to be an estimated 64KB in size, assuming it's about half full. It would then be holding around 90,000 entries. Is this reasonable, or should I go with a sorted array, and do binary searche

Re: Type-specific overloads in Phobos

2013-11-03 Thread Joseph Rushton Wakeling
On 03/11/13 10:18, Dmitry Olshansky wrote: //this should work though: alias abs = std.math.abs; alias abs = std.bigint.abs; Yea, which makes sense -- any code that needs both should _know_ it needs both. Actually, abs itself is not really a problem here as std.math.abs should work for just ab

Re: Type-specific overloads in Phobos

2013-11-03 Thread Dmitry Olshansky
03-Nov-2013 13:07, Joseph Rushton Wakeling пишет: Hello all, There are various generic functions in Phobos that can benefit from type-specific overloads. For example, in std.math and std.numeric, functions that deal with integers may benefit from having specialized implementations to work with

Type-specific overloads in Phobos

2013-11-03 Thread Joseph Rushton Wakeling
Hello all, There are various generic functions in Phobos that can benefit from type-specific overloads. For example, in std.math and std.numeric, functions that deal with integers may benefit from having specialized implementations to work with BigInt. Question: what's the appropriate locat