Re: [Vala] Getting corrupted results when returning array of strings

2012-08-30 Thread Dennis Möhlmann
Thanks for the help. Key and value both need to accept null, so I think "string?" is required. The issue wasn't value being null but rather that it referenced invalid/freed memory. I usually got two or three random letters instead of my input string along with an occasional "glibc detected *** doub

Re: [Vala] Getting corrupted results when returning array of strings

2012-08-28 Thread Dennis Möhlmann
Thanks, but no luck. The application dies before the "root-scope" is left, so there is no parent yet and the if-block that would cause the parent recursion isn't entered. Anyway, I've removed every weak/un/owned keyword from the code to start from the beginning. Since I only use GObject based clas

[Vala] Getting corrupted results when returning array of strings

2012-08-27 Thread Dennis Möhlmann
Good morning (where applicable), I'm trying to return an array of strings (collected from a linked list) but keep getting corrupted results. I assume it's an ownership issue but I'm not sure where to begin asking questions, so I'm adding the relevant parts of my buggy code. Scope is supposed to h

Re: [Vala] Type.from_name() / unregistered types

2012-08-24 Thread Dennis Möhlmann
> On Thu, 2012-08-23 at 12:20 +0200, Dennis Möhlmann wrote: >> Hello, >> >> I'm looking for a way to to create instances of a class (all subclasses >> of a common parent) by its class-name (string, not identifier). >> Type.from_name() + Object.new() seem to work

[Vala] Type.from_name() / unregistered types

2012-08-23 Thread Dennis Möhlmann
Hello, I'm looking for a way to to create instances of a class (all subclasses of a common parent) by its class-name (string, not identifier). Type.from_name() + Object.new() seem to work well, but only if the type has been used before (i.e. instanced or typeof()'ed). Otherwise the result is Type.

Re: [Vala] foreach / Gee.Tree/HashMap

2012-08-21 Thread Dennis Möhlmann
Hello, thank you for the explanation. Pretty bad pitfall though. Regards, Dennis Am 21.08.2012 08:41, schrieb Luca Bruno: > On Tue, Aug 21, 2012 at 5:34 AM, Dennis Möhlmann <mailto:in@nyda.info>> wrote: > > Hello, > > I was running into an issue with Ge

[Vala] foreach / Gee.Tree/HashMap

2012-08-20 Thread Dennis Möhlmann
Hello, I was running into an issue with Gee Maps and was wondering if this is intended behaviour. Here's a minimal sample: var map = new HashMap(); map[1] = "first"; map[2] = "second"; foreach (var value in map) { stdout.printf((value ?? "null") + "\n"); } stdout.printf("--\n"); foreach (v

[Vala] Defining a new type

2012-04-22 Thread Dennis Möhlmann
Hello, I'm trying to define a new type from a HashTable. The Vala tutorial has an example on this, but it seems disfunctional/incomplete and is not explained. Based on the example, I tried this: class LexerDefinition: HashTable { [CCode (has_construct_function = false)]// ??