[Vala] delegates in vala

2013-02-13 Thread Albert Hopkins
Some background: I'm currently learning vala by way of C#. Basically I'm learning C# and translating what I learn to vala. So I've come across delegates. From the C# book I'm reading they give the example that looks basically like this: MyDel del; ... del = randValue 50 ? new

Re: [Vala] delegates in vala

2013-02-13 Thread Albert Hopkins
On Wed, Feb 13, 2013, at 01:49 PM, Albert Hopkins wrote: [...] MyDel del; ... del = randValue 50 ? program.PrintLow : program.PrintHigh; However this gives me a compile error: delegate.vala:21.32-21.47: error: Assignment: Cannot convert from `Program.PrintLow' to

Re: [Vala] delegates in vala

2013-02-13 Thread Jim Nelson
Although the compiler messages have changed, there is a long-standing bug with delegates and the ternary operator: https://bugzilla.gnome.org/show_bug.cgi?id=599349 -- Jim On Wed, Feb 13, 2013 at 11:48 AM, Albert Hopkins mar...@letterboxes.org wrote: On Wed, Feb 13, 2013, at 01:49 PM, Albert

Re: [Vala] delegates in vala

2013-02-13 Thread Andrea Bolognani
On Wed, Feb 13, 2013 at 01:49:37PM -0500, Albert Hopkins wrote: So is the problem with the ternary expression? I also tried putting the conditional expression in parens but that didn't make any difference. Did you also try this? del = (randValue 50 ? program.PrintLow :