Re: [Vala] out, ref and GError parameters.



On 3/14/07, Jürg Billeter <j bitron ch> wrote:
On Mit, 2007-03-14 at 18:10 -0300, Alexandre Moreira wrote:
> I'd love to have pointer support, this is basically "THE" thing I miss
> in Vala, not that I would use it that much... just that I like the
> Error support in GLib and wouldn't feel like using an exception
> handling mechanism ...

Could you explain why you wouldn't like try, catch, throw syntax for
GError?

Not anything wrong with try catch, but it all comes down to the kind
of code it would generate. What I like with GError as it is in C Api
is that not much (pretty much nothing, actually) happens under the
hood. That way I can always rely on what is going on simply by reading
the code.

I still have to take into consideration the fact that not many
developers are familiar with Vala and I'd like to gather a few bare
Gtk+ developers to help me in the project I'm trying Vala with... and
one day I might be forced (because of the need for help) to fall back
to pure C and find those "puritans" Gtk+ programmers to help me.

I have to work daily with C#.Net and I really like the overall syntax
of Vala, as I like C#. It is just that I am quite familiar with pure C
also, and don't want to get too much abstraction between my Vala code
and the related C code.

*THE* nice thing I love about Vala is that it maps so beautifully to
pure C code, so I am sure I can count on my C skills to easily debug
generated code if I think something is not doing right. Unfortunately
I expect try/catch to break a bit of this beauty of generated code.
Thats all.




> If I'm allowed to ask: PLEASE, add pointer support :) It shouldn't be
> the preferred way to do things but I'd love to have it available to
> solve the problems one might face.

Yes, it probably makes sense, at least to make it easier to bind some
non-GObject libraries. I can imagine that parsing the pointer syntax
will be a bit tedious but the rest shouldn't be that hard.

I don't think we'd need too much stuff for pointer syntax here. I
mean, since this is not the preferred way of working in Vala, it would
be a simple matter of being able to declare a pointer, assign a
reference to it (and I think that ref already works pretty well for
that matter) and having an operator for dereferencing the pointer. No
-> or stuff like that would be needed.

It's great to see that this is being thought off... Think I'll get
back to the paper and keep modeling the further iterations of my
software, since the very first class I need to implement needs to use
GError's... please let me know when we have a pointer syntax so I can
start implementing it all :)


Best regards, and many thanks for the great piece of software and for
your quick response,
Alexandre Moreira.

Jürg





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]