Re: [Vala] Bug or feature? ***sorry for incomplete first message



Hi,

I can only speak for myself as I'm vala user, not developer, but I'd
say that you should just pay attention to the code that you're writing.

Vala is not a dynamically typed language, 'var' still has strictly
defined type. When some 'var' represents object, it is possible that
the object that will be assigned to it is sometimes of different type
than var. Var may (may?) be of interface type, or may be of type that
the object inherits.

But when you assign string or int, you can not assign different types
later. It's always known at the time of writing code what will be
assigned there. Introducing type information for all, even the most
simple types (like string) would in my opinion be overbloating.

The other situation is with compact classes - I really miss possibility
of having virtual functions in them. But they're... just compact.

Just use normal classes (don't have to inherit from GLib.Object) and
type information will be available.

best regards,

*** i accidentally pressed send, my sincere apologies for spamming

since i'm not versed in vala i'm kinda troubled with this since it differs
from any other language.

simplified example useless in real code

string s = "a";
var a = s;
if (a is string)

results in error type check expressions are not supported for compact
classes,struct and enums. "is" in any other language checks for every
type.

is there any way to get information about a if it is compact, struct or
enum? and how to get which one.

Object has get_type(), those don't have anything making var pretty
limited. it is not something terrible, but also not nice.

with regards
matjaz

_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list


-- 
Mój klucz publiczny o identyfikatorze 1024D/E12C5A4C znajduje się na
serwerze hkp://keys.gnupg.net

My public key with signature 1024D/E12C5A4C is on the server
hkp://keys.gnupg.net

Attachment: signature.asc
Description: PGP signature



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