Re: dmd 2.072.0 beta 2 no size because of forward reference

2016-10-21 Thread Kagamin via Digitalmars-d-learn
https://github.com/dlang/dmd/pull/5500 maybe this

Is this a bug ?

2016-10-21 Thread Basile B. via Digitalmars-d-learn
This very simple stuff: class Item { alias children this; Item[] children; void populate() { children ~= new Item; assert(children.length == 1); } } void main() { Item root = new Item; root.populate; } leads to an assertion failure. Am I too tired to

dmd 2.072.0 beta 2 no size because of forward reference

2016-10-21 Thread Eugene Wissner via Digitalmars-d-learn
Hey, the code bellow compiles with dmd 2.071.2, but doesn't compile with the same command with dmd 2.072.0 beta2. Maybe someone knows what's going wrong or whether it is a bug in 2.071.2/2.072.0 (it is a reduced part from memutils): app.d: import memutils.utils; struct HashMap(Key, Value)

Re: DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread Daniel Kozak via Digitalmars-d-learn
Dne 21.10.2016 v 21:03 DLearner via Digitalmars-d-learn napsal(a): On Friday, 21 October 2016 at 09:07:35 UTC, cym13 wrote: On Friday, 21 October 2016 at 08:58:50 UTC, DLearner wrote: [...] What makes you think that? It's hard to tell if you don't give any information. I pressed the

Phobos lacks a particular family of range functions...

2016-10-21 Thread Basile B. via Digitalmars-d-learn
They would have for constraint `if (isInputRange!Range && isInputRange!(ElementType!Range))` In case you wouldn't see directly what would they be used for, it's for tree-like structures. Each element in a Range is also an input range. I see 3 obvious functions/templates - the most

Re: DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread DLearner via Digitalmars-d-learn
On Friday, 21 October 2016 at 09:07:35 UTC, cym13 wrote: On Friday, 21 October 2016 at 08:58:50 UTC, DLearner wrote: [...] What makes you think that? It's hard to tell if you don't give any information. I pressed the 'Run' button and got the 'Hello World'. I pressed the 'Disassembly'

Re: DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread cym13 via Digitalmars-d-learn
On Friday, 21 October 2016 at 19:27:59 UTC, cym13 wrote: On Friday, 21 October 2016 at 19:03:30 UTC, DLearner wrote: [...] That's a problem about the debugger/disassembler that you use, not about D. We can't do anything else to help as you give no information. See my post: - I gave the

Re: DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread cym13 via Digitalmars-d-learn
On Friday, 21 October 2016 at 19:03:30 UTC, DLearner wrote: On Friday, 21 October 2016 at 09:07:35 UTC, cym13 wrote: On Friday, 21 October 2016 at 08:58:50 UTC, DLearner wrote: [...] What makes you think that? It's hard to tell if you don't give any information. I pressed the 'Run'

Re: Is this a bug ?

2016-10-21 Thread ag0aep6g via Digitalmars-d-learn
On 10/21/2016 06:55 PM, Basile B. wrote: This very simple stuff: class Item { alias children this; Item[] children; void populate() { children ~= new Item; assert(children.length == 1); } } void main() { Item root = new Item; root.populate; } leads

Re: Render SVG To Display And Update Periodically

2016-10-21 Thread Jason C. Wells via Digitalmars-d-learn
I've tinkered with what you proposed. In the process I've worked through a variety of errors and ended up doing things I don't think are a good solution like duplication directories so that a library can be found. Let me see if I understand how to piece together a build. Some combination of

Re: Render SVG To Display And Update Periodically

2016-10-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 22 October 2016 at 01:31:25 UTC, Mike Parker wrote: * They can be passed directly to the compiler along with your own source. This will cause them to be compiled and ultimately linked into the resulting binary. That's what I recommend. Just dmd yourfile.d yourotherfiles.d

Re: Render SVG To Display And Update Periodically

2016-10-21 Thread Mike Parker via Digitalmars-d-learn
On Friday, 21 October 2016 at 23:16:55 UTC, Jason C. Wells wrote: I've tinkered with what you proposed. In the process I've worked through a variety of errors and ended up doing things I don't think are a good solution like duplication directories so that a library can be found. Let me see

Re: New to D

2016-10-21 Thread rikki cattermole via Digitalmars-d-learn
On 22/10/2016 6:25 PM, Mark wrote: Hello, Im a 3rd year Comp Sci student in Edmonton Alberta, Canada. Ive learned how to use C, and dabbled in C++ in school. Im also in a Oop course using Java. I picked up the book The D Programming Language by Alexrei Alexandrescu a few years ago. Lately Im

Re: Render SVG To Display And Update Periodically

2016-10-21 Thread Jason C. Wells via Digitalmars-d-learn
First, thank you for taking the time to help me with something that should be trivial. I've done the above listing of file on the command line but I'm still stuck. I'm starting to think that I might actually be tripping over bugs, but I'm not confident enough to believe that without some

New to D

2016-10-21 Thread Mark via Digitalmars-d-learn
Hello, Im a 3rd year Comp Sci student in Edmonton Alberta, Canada. Ive learned how to use C, and dabbled in C++ in school. Im also in a Oop course using Java. I picked up the book The D Programming Language by Alexrei Alexandrescu a few years ago. Lately Im really wanting to get into D, as

Re: New to D

2016-10-21 Thread Mark via Digitalmars-d-learn
Thanks for the fast reply. That did work. But now the error is on the line: dictionary[word] = newId; I changed the value to 10, still errors. ?? everything else is as before. thanks.

Re: New to D

2016-10-21 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 22 October 2016 at 05:41:34 UTC, Mark wrote: Thanks for the fast reply. That did work. But now the error is on the line: dictionary[word] = newId; I changed the value to 10, still errors. ?? everything else is as before. thanks. For simple single file experiments

Re: Dustmite can't handle my memory segfault

2016-10-21 Thread Nordlöw via Digitalmars-d-learn
Next try: dustmite --no-redirect src "dmd -main -unittest -g -debug array_ex container_traits searching_ex && { ./array_ex; } > grep SIGABRT log" but that fails too as Loading src/w3c.html None => /bin/sh: 1: Syntax error: Bad fd number No object.Exception@dustmite.d(270): Initial test

Re: Reflection: Order of fields guaranteed?

2016-10-21 Thread Stefan Koch via Digitalmars-d-learn
On Friday, 21 October 2016 at 01:34:44 UTC, Nick Sabalausky wrote: When using reflection to obtain the fields of a class/struct, is there any guarantee that the order is the same as the order the fields are defined? Yes they should always come in lexical order.

Re: Meta-programming detecting anonymous unions inside structs.

2016-10-21 Thread rikki cattermole via Digitalmars-d-learn
On 21/10/2016 8:55 PM, TheFlyingFiddle wrote: I am trying to port a serialization library I wrote in Lua some time ago. I've ran into a problem relating to types with anonymous unions inside. Given this code: enum Kind { none = 0, array, integer, floating, } struct Foo { Kind

Meta-programming detecting anonymous unions inside structs.

2016-10-21 Thread TheFlyingFiddle via Digitalmars-d-learn
I am trying to port a serialization library I wrote in Lua some time ago. I've ran into a problem relating to types with anonymous unions inside. Given this code: enum Kind { none = 0, array, integer, floating, } struct Foo { Kind type; union { ulong integer;

Re: Meta-programming detecting anonymous unions inside structs.

2016-10-21 Thread rikki cattermole via Digitalmars-d-learn
On 21/10/2016 9:13 PM, TheFlyingFiddle wrote: On Friday, 21 October 2016 at 07:56:27 UTC, rikki cattermole wrote: You're gonna have to use UDA's for that. Yes, to do the serialization you're right. But my usecase for this is for error reporting. Basically any struct that contains unions

Re: Meta-programming detecting anonymous unions inside structs.

2016-10-21 Thread TheFlyingFiddle via Digitalmars-d-learn
On Friday, 21 October 2016 at 08:18:58 UTC, rikki cattermole wrote: On 21/10/2016 9:13 PM, TheFlyingFiddle wrote: On Friday, 21 October 2016 at 07:56:27 UTC, rikki cattermole wrote: You're gonna have to use UDA's for that. Yes, to do the serialization you're right. But my usecase for this

DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread DLearner via Digitalmars-d-learn
Code ran with expected output, but Disassembly seemed to go in a loop?

Re: DLang/Wiki/'Hello World'/Run Code/Disassembly

2016-10-21 Thread cym13 via Digitalmars-d-learn
On Friday, 21 October 2016 at 08:58:50 UTC, DLearner wrote: Code ran with expected output, but Disassembly seemed to go in a loop? What makes you think that? It's hard to tell if you don't give any information. Let's do that! I'll use only naive flags and all and use radare2 to disassemble

Reflection: Order of fields guaranteed?

2016-10-21 Thread Nick Sabalausky via Digitalmars-d-learn
When using reflection to obtain the fields of a class/struct, is there any guarantee that the order is the same as the order the fields are defined?

Re: Dustmite can't handle my memory segfault

2016-10-21 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 20 October 2016 at 22:18:20 UTC, Vladimir Panteleev wrote: On Thursday, 20 October 2016 at 21:33:59 UTC, Nordlöw wrote: I need your help here, I'm complete stuck. Vladimir? The exit status of the `./array_ex` call (as seen from bash) is 134. How do I, in Bash, map that exit

Re: Static Length Propagation of Ranges

2016-10-21 Thread ZombineDev via Digitalmars-d-learn
On Thursday, 20 October 2016 at 12:38:40 UTC, Nordlöw wrote: On Wednesday, 19 October 2016 at 19:39:46 UTC, Nordlöw wrote: On Wednesday, 19 October 2016 at 19:01:50 UTC, Meta wrote: https://goo.gl/t9m3YK I'm actually pretty impressed that this kind of code can be written in D. Thanks! Add

Re: Dustmite can't handle my memory segfault

2016-10-21 Thread Nordlöw via Digitalmars-d-learn
On Friday, 21 October 2016 at 06:44:54 UTC, Nordlöw wrote: On Thursday, 20 October 2016 at 22:18:20 UTC, Vladimir Panteleev wrote: On Thursday, 20 October 2016 at 21:33:59 UTC, Nordlöw wrote: I need your help here, I'm complete stuck. Vladimir? The exit status of the `./array_ex` call (as

Re: SQLite

2016-10-21 Thread Vadim Lopatin via Digitalmars-d-learn
On Wednesday, 19 October 2016 at 16:01:37 UTC, Alfred Newman wrote: Hello, I am trying to handle a SQLite3 table with D. During my researchs, I discovered the lib https://dlang.org/phobos/etc_c_sqlite3.html. However, for any reason, there is no code snippets or sample codes available