Re: The hackathon week roundup

2015-05-03 Thread Walter Bright via Digitalmars-d-announce
On 5/2/2015 7:43 PM, Rikki Cattermole wrote: Shouldn't it be creative commons because it is more a creative work aka documentation? Everything else is boost licensed. Consistency.

Re: The hackathon week roundup

2015-05-03 Thread Walter Bright via Digitalmars-d
On 5/2/2015 7:43 PM, Rikki Cattermole wrote: Shouldn't it be creative commons because it is more a creative work aka documentation? Everything else is boost licensed. Consistency.

Re: DTiled: Tiled map loader

2015-05-03 Thread Dmitry via Digitalmars-d-announce
On Saturday, 2 May 2015 at 19:16:03 UTC, rcorre wrote: Any D game developers out there looking to create a tile-based game? DTiled aims to provide a quick and easy way to load maps created with Tiled Good! Thank you!

Re: DTiled: Tiled map loader

2015-05-03 Thread tired_eyes via Digitalmars-d-announce
Nice that you named Dgame on your repo. ;) As soon as it supports XML and CSV I would definitely use it. Everyone who starts a game in D calls it Dgame!

Re: Building DMD on SmartOS

2015-05-03 Thread Joakim via Digitalmars-d
On Thursday, 30 April 2015 at 17:39:02 UTC, flamencofantasy wrote: Hello, I would like to use D on SmartOS. Since there is no binary installer I tried to build DMD from source by following the instructions on this page; http://wiki.dlang.org/Building_DMD Unfortunately I get this error;

Re: std.random question

2015-05-03 Thread Dennis Ritchie via Digitalmars-d-learn
On Sunday, 3 May 2015 at 09:04:07 UTC, tired_eyes wrote: On Sunday, 3 May 2015 at 08:48:52 UTC, Dennis Ritchie wrote: On Sunday, 3 May 2015 at 08:42:57 UTC, tired_eyes wrote: Feels pretty silly, but I can't compile this: import std.random; auto i = uniform(0, 10); DMD spits this:

Re: The most awesome forward to member solution?

2015-05-03 Thread Meta via Digitalmars-d
On Sunday, 3 May 2015 at 05:49:52 UTC, Andrei Alexandrescu wrote: On 5/2/15 10:00 PM, Meta wrote: It seems like it'd be a lot cheaper and cleaner to just be able to alias the parent method. Yeh, that's the first solution that comes to mind. alias doesn't work here but of course we could

Re: The hackathon week roundup

2015-05-03 Thread Ilya Yaroshenko via Digitalmars-d
On Sunday, 3 May 2015 at 04:13:35 UTC, Andrei Alexandrescu wrote: On 5/2/15 6:27 PM, Walter Bright wrote: On 5/2/2015 5:12 PM, Andrei Alexandrescu wrote: On 5/2/15 4:50 PM, Ilya Yaroshenko wrote: * Tutorial: http://d.readthedocs.org (btw should we link that from the homepage?) May I

Re: The hackathon week roundup

2015-05-03 Thread Ilya Yaroshenko via Digitalmars-d-announce
On Sunday, 3 May 2015 at 04:13:35 UTC, Andrei Alexandrescu wrote: On 5/2/15 6:27 PM, Walter Bright wrote: On 5/2/2015 5:12 PM, Andrei Alexandrescu wrote: On 5/2/15 4:50 PM, Ilya Yaroshenko wrote: * Tutorial: http://d.readthedocs.org (btw should we link that from the homepage?) May I

Re: The most awesome forward to member solution?

2015-05-03 Thread Meta via Digitalmars-d
Wow, ParameterTypeTuple even works with ref arguments with no problem. That's impressive.

Re: Parameter storage class 'in' transitive like 'const'?

2015-05-03 Thread Jakob Ovrum via Digitalmars-d-learn
On Sunday, 3 May 2015 at 05:20:34 UTC, Ali Çehreli wrote: We know that 'in' is equivalent to const scope: http://dlang.org/function.html#parameters So, the constness of 'in' is transitive as well, right? Ali Of course, there's no concept of non-transitive const in D: struct S {

Re: The most awesome forward to member solution?

2015-05-03 Thread tcak via Digitalmars-d
On Sunday, 3 May 2015 at 00:25:13 UTC, Dicebot wrote: Sounds similar to http://dlang.org/phobos/std_typecons.html#.Proxy Great documentation by the way. I understood what it does with one read: Make proxy for a.

Re: compile time garbage collection

2015-05-03 Thread via Digitalmars-d
On Sunday, 3 May 2015 at 04:46:52 UTC, ketmar wrote: i don't thing that such pass in general worth the efforts. D programmers tend to use structures for local and short-lived objects. if i did `new`, chances are that i really want it on heap, and it will not be optimisable This is where one

Re: Parameter storage class 'in' transitive like 'const'?

2015-05-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 02, 2015 22:20:33 Ali Çehreli via Digitalmars-d-learn wrote: We know that 'in' is equivalent to const scope: http://dlang.org/function.html#parameters So, the constness of 'in' is transitive as well, right? Of course. in is identical to const scope. It doesn't introduce

Re: compile time garbage collection

2015-05-03 Thread weaselcat via Digitalmars-d
On Sunday, 3 May 2015 at 08:02:37 UTC, Ola Fosheim Grøstad wrote: On Sunday, 3 May 2015 at 04:46:52 UTC, ketmar wrote: i don't thing that such pass in general worth the efforts. D programmers tend to use structures for local and short-lived objects. if i did `new`, chances are that i really

Re: The most awesome forward to member solution?

2015-05-03 Thread Jakob Ovrum via Digitalmars-d
On Sunday, 3 May 2015 at 07:55:30 UTC, tcak wrote: On Sunday, 3 May 2015 at 00:25:13 UTC, Dicebot wrote: Sounds similar to http://dlang.org/phobos/std_typecons.html#.Proxy Great documentation by the way. I understood what it does with one read: Make proxy for a.

Re: compile time garbage collection

2015-05-03 Thread via Digitalmars-d
On Sunday, 3 May 2015 at 08:22:31 UTC, weaselcat wrote: there's no guarantee GC allocated memory will _ever_ have their destructor ran, it's part of the spec. That would be very unfortunate, they have to either be called eventually or never called. I find no such description in the spec:

Re: Building DMD on SmartOS

2015-05-03 Thread Joakim via Digitalmars-d
On Sunday, 3 May 2015 at 07:04:17 UTC, Joakim wrote: I'll finish building phobos and mess around a bit with fixing those sections. I'll let you know if I get it to work. Alright, increasing the RAM in my VM got phobos to build. However, linking sample files and the tests still fail because

std.random question

2015-05-03 Thread tired_eyes via Digitalmars-d-learn
Feels pretty silly, but I can't compile this: import std.random; auto i = uniform(0, 10); DMD spits this: /usr/include/dmd/phobos/std/random.d(1188): Error: static variable initialized cannot be read at compile time /usr/include/dmd/phobos/std/random.d(1231):called from here:

Re: compile time garbage collection

2015-05-03 Thread weaselcat via Digitalmars-d
On Sunday, 3 May 2015 at 08:34:09 UTC, Ola Fosheim Grøstad wrote: On Sunday, 3 May 2015 at 08:22:31 UTC, weaselcat wrote: there's no guarantee GC allocated memory will _ever_ have their destructor ran, it's part of the spec. That would be very unfortunate, they have to either be called

Re: std.random question

2015-05-03 Thread Dennis Ritchie via Digitalmars-d-learn
On Sunday, 3 May 2015 at 08:42:57 UTC, tired_eyes wrote: Feels pretty silly, but I can't compile this: import std.random; auto i = uniform(0, 10); DMD spits this: /usr/include/dmd/phobos/std/random.d(1188): Error: static variable initialized cannot be read at compile time

Re: compile time garbage collection

2015-05-03 Thread via Digitalmars-d
On Sunday, 3 May 2015 at 08:41:04 UTC, weaselcat wrote: http://dlang.org/class.html#destructors Oh well, that should be described under GC too then, but it can improve collection speed so I guess it is ok if one requires classes to be marked @nogc if they have destructors. The inbetween

Re: std.random question

2015-05-03 Thread tired_eyes via Digitalmars-d-learn
On Sunday, 3 May 2015 at 08:48:52 UTC, Dennis Ritchie wrote: On Sunday, 3 May 2015 at 08:42:57 UTC, tired_eyes wrote: Feels pretty silly, but I can't compile this: import std.random; auto i = uniform(0, 10); DMD spits this: /usr/include/dmd/phobos/std/random.d(1188): Error: static

Re: UDA and ReturnType!(__traits...) doesn't work

2015-05-03 Thread Meta via Digitalmars-d-learn
On Sunday, 3 May 2015 at 17:22:00 UTC, filcuc wrote: Hi all, i'm working in the generation of the code but i'm failing in extracting a function return type when invoking the ReturnType!(T) type trait and mixing it with __traits(getMember) function. Can anyone help me? or explaining what is

Re: Classes. C++ to D

2015-05-03 Thread Meta via Digitalmars-d-learn
On Sunday, 3 May 2015 at 17:35:42 UTC, Dennis Ritchie wrote: Hi, How can I rewrite this code to the D? - #include string #include iostream class A { public: std::string a() { return std::string(foo); } }; class B { public: std::string b(){ return

Re: UDA and ReturnType!(__traits...) doesn't work

2015-05-03 Thread ketmar via Digitalmars-d-learn
On Sun, 03 May 2015 17:21:58 +, filcuc wrote: Hi all, i'm working in the generation of the code but i'm failing in extracting a function return type when invoking the ReturnType!(T) type trait and mixing it with __traits(getMember) function. Can anyone help me? or explaining what is

Re: std.xml2 (collecting features)

2015-05-03 Thread Robert burner Schadek via Digitalmars-d
- CTS to disable parsing location (line,column)

Re: std.xml2 (collecting features)

2015-05-03 Thread Joakim via Digitalmars-d
On Sunday, 3 May 2015 at 17:39:48 UTC, Robert burner Schadek wrote: std.xml has been considered not up to specs nearly 3 years now. Time to build a successor. I currently plan the following featues for it: - SAX and DOM parser - in-situ / slicing parsing when possible (forward range?) -

Re: std.xml2 (collecting features)

2015-05-03 Thread Walter Bright via Digitalmars-d
On 5/3/2015 10:39 AM, Robert burner Schadek wrote: Please post you feature requests, and please keep the posts DRY and on topic. Pipeline range interface, for example: source.xmlparse(configuration).whatever();

Re: The hackathon week roundup

2015-05-03 Thread Ilya Yaroshenko via Digitalmars-d
On Sunday, 3 May 2015 at 04:13:35 UTC, Andrei Alexandrescu wrote: On 5/2/15 6:27 PM, Walter Bright wrote: On 5/2/2015 5:12 PM, Andrei Alexandrescu wrote: On 5/2/15 4:50 PM, Ilya Yaroshenko wrote: * Tutorial: http://d.readthedocs.org (btw should we link that from the homepage?) May I

Re: The hackathon week roundup

2015-05-03 Thread Ilya Yaroshenko via Digitalmars-d-announce
On Sunday, 3 May 2015 at 04:13:35 UTC, Andrei Alexandrescu wrote: On 5/2/15 6:27 PM, Walter Bright wrote: On 5/2/2015 5:12 PM, Andrei Alexandrescu wrote: On 5/2/15 4:50 PM, Ilya Yaroshenko wrote: * Tutorial: http://d.readthedocs.org (btw should we link that from the homepage?) May I

Re: Building DMD on SmartOS

2015-05-03 Thread Jason King via Digitalmars-d
It's not broken, dmd is emitting an arguably invalid elf section. On Sun, May 3, 2015 at 12:34 PM, Joakim via Digitalmars-d digitalmars-d@puremagic.com wrote: On Sunday, 3 May 2015 at 16:02:54 UTC, Joakim wrote: On Sunday, 3 May 2015 at 15:06:24 UTC, flamencofantasy wrote: Thanks everyone

Re: The most awesome forward to member solution?

2015-05-03 Thread Meta via Digitalmars-d
On Sunday, 3 May 2015 at 23:54:49 UTC, Andrei Alexandrescu wrote: On 5/3/15 4:20 PM, Meta wrote: On Sunday, 3 May 2015 at 20:25:45 UTC, Andrei Alexandrescu wrote: OK, here's what I have now - two templates that are self contained and work well: The first uses opDispatch to dispatch to a

Re: The most awesome forward to member solution?

2015-05-03 Thread Andrei Alexandrescu via Digitalmars-d
On 5/3/15 11:54 AM, Andrei Alexandrescu wrote: On 5/3/15 12:18 AM, Meta wrote: On Sunday, 3 May 2015 at 05:49:52 UTC, Andrei Alexandrescu wrote: On 5/2/15 10:00 PM, Meta wrote: It seems like it'd be a lot cheaper and cleaner to just be able to alias the parent method. Yeh, that's the first

Re: The most awesome forward to member solution?

2015-05-03 Thread Andrei Alexandrescu via Digitalmars-d
On 5/3/15 12:04 PM, Dicebot wrote: On Sunday, 3 May 2015 at 18:54:45 UTC, Andrei Alexandrescu wrote: I think it should go in std.functional. All similar utilities are currently in std.typecons worksforme -- Andrei

Re: The most awesome forward to member solution?

2015-05-03 Thread Andrei Alexandrescu via Digitalmars-d
OK, here's what I have now - two templates that are self contained and work well: The first uses opDispatch to dispatch to a member. The second is a simple string function that generates the appropriate code. As discussed the latter composes but the former doesn't. mixin template

Re: The most awesome forward to member solution?

2015-05-03 Thread Meta via Digitalmars-d
On Sunday, 3 May 2015 at 20:25:45 UTC, Andrei Alexandrescu wrote: OK, here's what I have now - two templates that are self contained and work well: The first uses opDispatch to dispatch to a member. The second is a simple string function that generates the appropriate code. As discussed the

Re: std.xml2 (collecting features)

2015-05-03 Thread Walter Bright via Digitalmars-d
On 5/3/2015 10:39 AM, Robert burner Schadek wrote: - CTS for encoding (ubyte(ASCII), char(utf8), ... ) Encoding schemes should be handled by adapter algorithms, not in the XML parser itself, which should only handle UTF8.

Re: std.xml2 (collecting features)

2015-05-03 Thread Ilya Yaroshenko via Digitalmars-d
Can it lazily reads huge files (files greater than memory)?

Re: The most awesome forward to member solution?

2015-05-03 Thread Andrei Alexandrescu via Digitalmars-d
On 5/3/15 4:20 PM, Meta wrote: On Sunday, 3 May 2015 at 20:25:45 UTC, Andrei Alexandrescu wrote: OK, here's what I have now - two templates that are self contained and work well: The first uses opDispatch to dispatch to a member. The second is a simple string function that generates the

Adding a read primitive to ranges

2015-05-03 Thread Freddy via Digitalmars-d
Would it be a bad idea to add a read primitive to ranges for streaming? struct ReadRange(T){ size_t read(T[] buffer); //and | or T[] read(size_t request); /+ empty,front,popFront,etc +/ }

Re: Classes. C++ to D

2015-05-03 Thread Dennis Ritchie via Digitalmars-d-learn
On Sunday, 3 May 2015 at 17:46:54 UTC, Meta wrote: This is not really doable right now in D. You can forward the function calls to a and b easily enough, but you can't inherit from more than one class. Once the multiple alias this patch gets merged you will be able to do this in D. On

dmd -profile=gc

2015-05-03 Thread Walter Bright via Digitalmars-d
Just merged in is a new compiler switch that instruments generated code to collect statistics on memory allocation usage and generates a report upon program termination. (Much like how -profile works.) This was based on a prototype Andrei had written earlier. Andrei and I suspect it can be of

Re: std.xml2 (collecting features)

2015-05-03 Thread Michel Fortin via Digitalmars-d
On 2015-05-03 17:39:46 +, Robert burner Schadek rburn...@gmail.com said: std.xml has been considered not up to specs nearly 3 years now. Time to build a successor. I currently plan the following featues for it: - SAX and DOM parser - in-situ / slicing parsing when possible (forward

Re: std.xml2 (collecting features)

2015-05-03 Thread wobbles via Digitalmars-d
On Sunday, 3 May 2015 at 17:39:48 UTC, Robert burner Schadek wrote: std.xml has been considered not up to specs nearly 3 years now. Time to build a successor. I currently plan the following featues for it: - SAX and DOM parser - in-situ / slicing parsing when possible (forward range?) -

Re: std.xml2 (collecting features)

2015-05-03 Thread Walter Bright via Digitalmars-d
On 5/3/2015 10:39 AM, Robert burner Schadek wrote: Please post you feature requests, and please keep the posts DRY and on topic. Try to design the interface to it so it does not inherently require the implementation to allocate GC memory.

CTFE template predicates

2015-05-03 Thread Robert M. Münch via Digitalmars-d-learn
Hi, I have now played a around couple of hours (reading everything I could find) to get something to work, but I think I'm missing some basic concepts/understanding. Maybe someone can enlighten me how these things work. I thought that some code from David Nadlinger is what I'm searching for

Re: std.xml2 (collecting features)

2015-05-03 Thread Walter Bright via Digitalmars-d
On 5/3/2015 2:31 PM, Ilya Yaroshenko wrote: Can it lazily reads huge files (files greater than memory)? If a range interface is used, it doesn't need to be aware of where the data is coming from. In fact, the xml package should NOT be doing I/O.

Re: CTFE template predicates

2015-05-03 Thread anonymous via Digitalmars-d-learn
On Sunday, 3 May 2015 at 21:46:11 UTC, Robert M. Münch wrote: Hi, I have now played a around couple of hours (reading everything I could find) to get something to work, but I think I'm missing some basic concepts/understanding. Maybe someone can enlighten me how these things work. I thought

Re: CTFE template predicates

2015-05-03 Thread Dicebot via Digitalmars-d-learn
On Sunday, 3 May 2015 at 21:46:11 UTC, Robert M. Münch wrote: 3. TupleType is a very missleading name when you are learning these things, because the tuple can hold values as well. Or is there a more extensive explanation for the name I don't get? Legacy we are trying to get rid of. See also:

Is this expected? default to public members in private class

2015-05-03 Thread Dan Olson via Digitalmars-d-learn
It seems a private class or struct defaults to public members. Just curious if this is intended. I would have expected private all the way down unless overriden. --- plugh.d module plugh; auto makeFoo() {return new Foo;} private: class Foo { void maybepriv() {} private void priv() {}

Struct lifetime wrt function return?

2015-05-03 Thread rsw0x via Digitalmars-d-learn
I remember reading that guaranteed RVO was part of the D standard, but I am completely unable to find anything on it in the specification. I'm also unable to find anything in it that explicitly states the lifetime of returning a stack-local struct from a function. However, it does state

Converting (casting?) a dynamic array to a fixed array?

2015-05-03 Thread WhatMeWorry via Digitalmars-d-learn
This following code works fine. A triangle is displayed. GLfloat[6] verts = [ 0.0, 1.0, -1.0, -1.0, 1.0, -1.0 ]; glGenBuffers(1, vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); // Some of the types are:

Re: Converting (casting?) a dynamic array to a fixed array?

2015-05-03 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 4 May 2015 at 02:47:24 UTC, WhatMeWorry wrote: glBufferData(GL_ARRAY_BUFFER, verts.sizeof, verts, GL_STATIC_DRAW); Try (GL_ARRAY_BUFFER, verts.length, verts.ptr, GL_STATIC_DRAW) or maybe: (GL_ARRAY_BUFFER, verts.length * verts[0].sizeof, verts.ptr, GL_STATIC_DRAW) I'm

Re: Converting (casting?) a dynamic array to a fixed array?

2015-05-03 Thread rsw0x via Digitalmars-d-learn
On Monday, 4 May 2015 at 02:47:24 UTC, WhatMeWorry wrote: This following code works fine. A triangle is displayed. GLfloat[6] verts = [ 0.0, 1.0, -1.0, -1.0, 1.0, -1.0 ]; glGenBuffers(1, vbo);

Re: Efficiently passing structs

2015-05-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, May 03, 2015 21:58:12 bitwise via Digitalmars-d-learn wrote: If I have a large struct that needs to be passed around, like a 4x4 matrix for example, how do I do that efficiently in D? In std.datetime, in is used for most struct parameters, but I'm confused by the docs for function

[Issue 11003] Improve .di generation

2015-05-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11003 --- Comment #3 from Kenji Hara k.hara...@gmail.com --- One more case: enum isInt(T) = is(T == int); For that, the generated di still uses old verbose style: template isInt(T) { enum isInt = is(T == int); } --

Re: This Week in D #15: hackathon, mem management, ARM, tip for C coders

2015-05-03 Thread ketmar via Digitalmars-d-announce
On Mon, 04 May 2015 03:23:07 +, Adam D. Ruppe wrote: So I guess it is more a peeve of mine than anything else, but I wanted to talk about it anyway and used the tip of the week as my vehicle. D code that looks like C isn't a bad thing, indeed, I think it is a selling point. i found that

Re: What wrong?

2015-05-03 Thread Fyodor Ustinov via Digitalmars-d-learn
On Saturday, 2 May 2015 at 20:46:32 UTC, Dennis Ritchie wrote: On Saturday, 2 May 2015 at 19:38:01 UTC, Fyodor Ustinov wrote: I see it by the lack of 42. :) But why is this receive breaks down? Report, please, about it (D)evepopers :) https://issues.dlang.org/ I'm not sure that it's not my

[Issue 277] Named mixin operator resolution

2015-05-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=277 Vlad Levenfeld vlevenf...@gmail.com changed: What|Removed |Added CC||vlevenf...@gmail.com --

Re: Efficiently passing structs

2015-05-03 Thread Baz via Digitalmars-d-learn
On Monday, 4 May 2015 at 01:58:12 UTC, bitwise wrote: The documentation doesn't say anything about in being a reference, but it doesn't say that out parameters are references either, even though it's usage in the example clearly shows that it is. Thanks, Bit

Re: Adding a read primitive to ranges

2015-05-03 Thread ketmar via Digitalmars-d
On Mon, 04 May 2015 00:07:25 +, Freddy wrote: Would it be a bad idea to add a read primitive to ranges for streaming? struct ReadRange(T){ size_t read(T[] buffer); //and | or T[] read(size_t request); /+ empty,front,popFront,etc +/ } if you want to add such

Re: Struct lifetime wrt function return?

2015-05-03 Thread ketmar via Digitalmars-d-learn
On Mon, 04 May 2015 02:29:19 +, rsw0x wrote: This says Goodbye! exactly once, indicating(?) that S was NRVO'd which means the scope of s went from foo to main. However, is this a guarantee by the standard? Is an implementation allowed to define foo such that it returns by copy and calls a

Re: Is it safe to reset HOLD fiber?

2015-05-03 Thread Dzugaru via Digitalmars-d-learn
On Sunday, 3 May 2015 at 14:36:04 UTC, Martin Nowak wrote: On Sunday, 3 May 2015 at 12:33:36 UTC, Dzugaru wrote: Actually the documentation answers your question, please help to improve it if you don't find it clear enough. http://dlang.org/phobos/core_thread.html#.Fiber.reset Created a

Re: The most awesome forward to member solution?

2015-05-03 Thread Meta via Digitalmars-d
On Monday, 4 May 2015 at 01:01:05 UTC, Andrei Alexandrescu wrote: Hmm, I didn't try it assuming it won't work (thought __traits(getMember, member, sym) would fail with opDispatch). Tried it just now, it does work like a charm. Thanks! Andrei So is a function that generates a string mixin

This Week in D #15: hackathon, mem management, ARM, tip for C coders

2015-05-03 Thread Adam D. Ruppe via Digitalmars-d-announce
I covered two weeks this time, as I missed last week. http://arsdnet.net/this-week-in-d/may-03.html The tip this week might be a bit controversial but I actually feel kinda strongly about this. So many times, I see people asking questions about how to do task X in D. I think that's the

Re: Efficiently passing structs

2015-05-03 Thread rsw0x via Digitalmars-d-learn
On Monday, 4 May 2015 at 03:57:04 UTC, bitwise wrote: I'll probably go with in ref. I think escape proof is probably a good default. Not to mention, easier to type ;) FYI I'm unsure how well `scope` storage class is currently implemented because it's in a state of flux at the moment as far

Re: The most awesome forward to member solution?

2015-05-03 Thread Andrei Alexandrescu via Digitalmars-d
On 5/3/15 8:13 PM, Meta wrote: On Monday, 4 May 2015 at 01:01:05 UTC, Andrei Alexandrescu wrote: Hmm, I didn't try it assuming it won't work (thought __traits(getMember, member, sym) would fail with opDispatch). Tried it just now, it does work like a charm. Thanks! Andrei So is a function

Re: A slice can lose capacity simply by calling a function

2015-05-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, May 03, 2015 15:21:15 Andrew Godfrey via Digitalmars-d-learn wrote: I really don't think that it's an issue in general, but if you do want to guarantee that nothing affects the capacity of your array, then you're going to need to either wrap all access to it I agree with

Re: The most awesome forward to member solution?

2015-05-03 Thread Andrei Alexandrescu via Digitalmars-d
On 5/3/15 5:29 PM, Meta wrote: On Sunday, 3 May 2015 at 23:54:49 UTC, Andrei Alexandrescu wrote: On 5/3/15 4:20 PM, Meta wrote: On Sunday, 3 May 2015 at 20:25:45 UTC, Andrei Alexandrescu wrote: OK, here's what I have now - two templates that are self contained and work well: The first uses

Re: What wrong?

2015-05-03 Thread Dennis Ritchie via Digitalmars-d-learn
On Monday, 4 May 2015 at 01:03:43 UTC, Fyodor Ustinov wrote: I'm not sure that it's not my fault. So I hope that will come by knowledgeable people and say Hey, buddy, your mistake is... :) OK. But if one does not come within three days :), duplicate topic in this section:

Efficiently passing structs

2015-05-03 Thread bitwise via Digitalmars-d-learn
If I have a large struct that needs to be passed around, like a 4x4 matrix for example, how do I do that efficiently in D? In std.datetime, in is used for most struct parameters, but I'm confused by the docs for function parameter storage classes[1]. In C++, I would pass a large struct as

[Issue 14542] New: Table of contents in specification PDF is broken

2015-05-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14542 Issue ID: 14542 Summary: Table of contents in specification PDF is broken Product: D Version: unspecified Hardware: All OS: All Status: NEW Severity: minor

Re: Efficiently passing structs

2015-05-03 Thread rsw0x via Digitalmars-d-learn
On Monday, 4 May 2015 at 01:58:12 UTC, bitwise wrote: If I have a large struct that needs to be passed around, like a 4x4 matrix for example, how do I do that efficiently in D? In std.datetime, in is used for most struct parameters, but I'm confused by the docs for function parameter storage

Re: CTFE template predicates

2015-05-03 Thread Rikki Cattermole via Digitalmars-d-learn
On 4/05/2015 9:46 a.m., Robert M. Münch wrote: Hi, I have now played a around couple of hours (reading everything I could find) to get something to work, but I think I'm missing some basic concepts/understanding. Maybe someone can enlighten me how these things work. I thought that some code from

Re: Efficiently passing structs

2015-05-03 Thread bitwise via Digitalmars-d-learn
On Sun, 03 May 2015 22:37:52 -0400, rsw0x anonym...@anonymous.com wrote: Use the ref storage class. You can use more than one storage class i.e, foo(in ref int x) Thanks, this should work. On Sun, 03 May 2015 23:29:59 -0400, Baz bb.t...@gmx.com wrote: it's specified in

Re: std.xml2 (collecting features)

2015-05-03 Thread Rikki Cattermole via Digitalmars-d
On 4/05/2015 5:39 a.m., Robert burner Schadek wrote: std.xml has been considered not up to specs nearly 3 years now. Time to build a successor. I currently plan the following featues for it: - SAX and DOM parser - in-situ / slicing parsing when possible (forward range?) - compile time switch

Re: Is this expected? default to public members in private class

2015-05-03 Thread ketmar via Digitalmars-d-learn
On Sun, 03 May 2015 18:07:20 -0700, Dan Olson wrote: It seems a private class or struct defaults to public members. Just curious if this is intended. I would have expected private all the way down unless overriden. i bet it is intended. protection of struct/class members is independed of

Re: UDA and ReturnType!(__traits...) doesn't work

2015-05-03 Thread ketmar via Digitalmars-d-learn
On Sun, 03 May 2015 18:02:37 +, filcuc wrote: Yep sorry, i'm still learning :) i'm not blaming you at all. what i mean i that i'm bad at explanations, so you'd better read one of the D books to better understand my cryptic don't do that, do this comments. ;-) signature.asc Description:

Re: Building DMD on SmartOS

2015-05-03 Thread Kai Nacke via Digitalmars-d
On Sunday, 3 May 2015 at 07:04:17 UTC, Joakim wrote: On Thursday, 30 April 2015 at 17:39:02 UTC, flamencofantasy wrote: Hello, I would like to use D on SmartOS. Since there is no binary installer I tried to build DMD from source by following the instructions on this page;

Re: The most awesome forward to member solution?

2015-05-03 Thread Jacob Carlborg via Digitalmars-d
On 2015-05-03 06:20, Andrei Alexandrescu wrote: Is this a common thing people wanna do? Put in Phobos? Yes, I would think so. Although, I would prefer a regular template mixin and taking the member as an alias parameter instead of a string, if possible. -- /Jacob Carlborg

Re: Closure capture loop variables

2015-05-03 Thread via Digitalmars-d
On Saturday, 2 May 2015 at 18:02:34 UTC, Idan Arye wrote: On Friday, 1 May 2015 at 21:42:22 UTC, deadalnix wrote: On Friday, 1 May 2015 at 17:51:05 UTC, Walter Bright wrote: On 4/30/2015 5:55 AM, Vladimir Panteleev wrote: I think Freddy's programs are working as designed. Yes, they are. D

Desktopfile library

2015-05-03 Thread FreeSlave via Digitalmars-d-announce
dub package: http://code.dlang.org/packages/desktopfile Implementation of Desktop Entry Specification in D. Note that currently it's not fully compliant to spec, though it should work in the most cases.

[Issue 14539] New: +508KB (684KB - 1191KB) filesize increase Hello, world binary

2015-05-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14539 Issue ID: 14539 Summary: +508KB (684KB - 1191KB) filesize increase Hello, world binary Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Re: Read and write gzip files easily.

2015-05-03 Thread Russel Winder via Digitalmars-d
And there is Zipios++ http://zipios.sourceforge.net/ On Sun, 2015-05-03 at 14:33 +, via Digitalmars-d wrote: On Thursday, 20 February 2014 at 10:35:50 UTC, Stephan Schiffels wrote: Hi Kamil, I am glad someone has the exact same problem as I had. I actually solved this, inspired by

Re: A slice can lose capacity simply by calling a function

2015-05-03 Thread Andrew Godfrey via Digitalmars-d-learn
I really don't think that it's an issue in general, but if you do want to guarantee that nothing affects the capacity of your array, then you're going to need to either wrap all access to it I agree with everything Jonathan said in both threads EXCEPT that this is not an issue. The

Re: [hackathon] ARE WE SLIM YET?

2015-05-03 Thread Vladimir Panteleev via Digitalmars-d-announce
On Sunday, 3 May 2015 at 13:20:03 UTC, cym13 wrote: I got a parsererror for data/data.json, Unrecognized token '?' Please try Chrome or Firefox.

Re: Read and write gzip files easily.

2015-05-03 Thread via Digitalmars-d
On Thursday, 20 February 2014 at 10:35:50 UTC, Stephan Schiffels wrote: Hi Kamil, I am glad someone has the exact same problem as I had. I actually solved this, inspired by the python API you quoted above. I wrote these classes: GzipInputRange, GzipByLine, and GzipOut. Here is how I can now

Re: Is it safe to reset HOLD fiber?

2015-05-03 Thread Martin Nowak via Digitalmars-d-learn
On Sunday, 3 May 2015 at 12:42:23 UTC, Dzugaru wrote: Just did another test and it seems its not safe at all. Reusing the fibers with reset without properly exiting the function leads to eventual stack overflow. It won't cleanup the old stack, so it may leak resources. It will properly reset

[Issue 14523] New Windows Application uses incorrect initialization/termination code

2015-05-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14523 Rainer Schuetze r.sagita...@gmx.de changed: What|Removed |Added CC||r.sagita...@gmx.de ---

Re: Merging one Array with Another

2015-05-03 Thread via Digitalmars-d-learn
On Saturday, 2 May 2015 at 04:08:04 UTC, Ali Çehreli wrote: Interesting idea. I have defined a simple algorithm below to see how it could work (my skipped() function instead of uniq()). That's a bit above my current D experience to decide. What about just tweaking uniq() for now to propagate

Re: D 2.067.1

2015-05-03 Thread extrawurst via Digitalmars-d-announce
On Sunday, 26 April 2015 at 17:53:07 UTC, Martin Nowak wrote: We're glad to announce dmd 2.067.1 which includes several regression and bug fixes over 2.067.0. http://dlang.org/changelog.html#2.067.1 Please report any bug you encounter at https://issues.dlang.org/. travis-ci still uses

Re: std.random question

2015-05-03 Thread tired_eyes via Digitalmars-d-learn
import std.random; struct Mystruct { int id; static opCall() { Mystruct s; s.id = uniform(0, 10); return s; } } void main() { auto s = Mystruct(); // whatever } --- This make sense, thant you for the

Is it safe to reset HOLD fiber?

2015-05-03 Thread Dzugaru via Digitalmars-d-learn
Documentation says This fiber must be in state TERM. but in the core.thread I see In contract only on reset without parameters (bug maybe?) and with HOLD condition too: assert( m_state == State.TERM || m_state == State.HOLD ); Does that mean its ok to reset the fiber if I'm not using things

[Issue 14540] New: +~30% increase in compilation time of Hello, world program

2015-05-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14540 Issue ID: 14540 Summary: +~30% increase in compilation time of Hello, world program Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

[Issue 14524] Right clicking in solution explorer to add folders does not work as expected

2015-05-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14524 Rainer Schuetze r.sagita...@gmx.de changed: What|Removed |Added CC||r.sagita...@gmx.de ---

Re: Building DMD on SmartOS

2015-05-03 Thread flamencofantasy via Digitalmars-d
Thanks everyone for spending the time on this! I followed the steps and I got to the same point, that is I have built DMD, druntime and phobos successfully but linking fails as pointed out previously. My version of binutils is; binutils-2.24nb3;GNU binary utilities The latest version seems

Re: ARM Cortex-M Microcontroller startup files

2015-05-03 Thread Martin Nowak via Digitalmars-d
On Sunday, 3 May 2015 at 01:57:45 UTC, Jens Bauer wrote: I'll not be working much on a malloc, but I will be thinking a little about a size-optimized / well-performing malloc could be written (approximately). Perhaps I could combine my MiniMalloc with clusters of small blocks. Newlib already

Re: Is it safe to reset HOLD fiber?

2015-05-03 Thread Dzugaru via Digitalmars-d-learn
Just did another test and it seems its not safe at all. Reusing the fibers with reset without properly exiting the function leads to eventual stack overflow.

[Issue 14538] New: ICE(cast.c, typeMerge) - Assertion failed: (t1-ty == t2-ty)

2015-05-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14538 Issue ID: 14538 Summary: ICE(cast.c, typeMerge) - Assertion failed: (t1-ty == t2-ty) Product: D Version: D2 Hardware: All OS: All Status: NEW

  1   2   >