Re: [Vala] Libgee problem



On Wed, 09 Dec 2009 21:26:04 -0500, 
Jamie McCracken <jamie mccrack googlemail com> wrote:

I haven't really looked at genie...  But I'm curious, where these
differences come in, what exactly is genie's relationship to vala?
I'd sort of assumed it was just an alternative source file parser
with the same compiler back-end.  
it is only at the parser level that it is different. We simply add in
the default string hash if the parsed key is a string, or int hash if
int or direct address for everything else. Of course the user can
still override these defaults and provide hash functions themselves
(EG if you wanted to make the string hash function case insensitive)
but for most cases the defaults are fine so Genie avoids the extra
tedious coding that you currently have to do in vala when you dont
require custom hashes

Cool...  So I do have a clue after all.


Anyone know if it's on the Vala todo list at all...?  Equality testing,
hashing, and "to string" for every class, is a mighty handy thing.
I'm guessing it'd require some sort of compile-time "if method exists"
operator, though, so probably not.

On the other hand, Vala adds an object for int, and GValue (I think it
was) already has support for plugging in converters for types.  Would
it be possible to generalise the idea, and have Hash (and friends)
attempt to look up the appropriate hash/equality function if it's not
explicitly given one?

Someone's probably already thought of all this, in which case just
ignore me.  :)

-- 
Fredderic

Debian/unstable (LC#384816) on i686 2.6.30-1-686 2009 (up 10 days,
14:23)

Attachment: signature.asc
Description: PGP signature



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