Re: [Vala] Vala Journal, Issue #1

2010-02-01 Thread Luca Bruno
On Mon, Feb 01, 2010 at 02:15:38AM +0100, Jiří Zárevúcky wrote: Hello everyone. Seeing the subject of this message, you probably started to wonder what the heck this is. Here's the plan: Each weekend, I'm going to sumarize what is going on around Vala. This includes recently included features,

Re: [Vala] using InetAddress

2010-03-11 Thread Luca Bruno
On Thu, Mar 11, 2010 at 10:47:14AM +0100, Cyrille Colin wrote: Hi, i would like to understand how uchar InetAddress.to_bytes() works. As it returns a uchar instead of a uchar[] how i can retrieve the array ? thanks, Cyrille. It must be uchar*, it's a bug in the bindings. --

Re: [Vala] [PATCH] Vala does not register string[] properties

2010-03-30 Thread Luca Bruno
00:00:00 2001 From: Luca Bruno lethalma...@gmail.com Date: Tue, 30 Mar 2010 12:40:56 +0200 Subject: [PATCH] Support string[] (G_TYPE_STRV) properties for GObject. --- codegen/valagobjectmodule.vala | 45 +-- codegen/valagtypemodule.vala |3 ++ 2 files

Re: [Vala] How to check what a Gee.List contains

2010-04-04 Thread Luca Bruno
On Sun, Apr 04, 2010 at 10:09:24AM -0700, Tristin Celestin wrote: Is there a means to figure out what kinds of variables a Gee.List stores? The following doesn't work because if I call mystery_list.get(0), I get the compiler error: has no member named ‘g_destroy_func’. using Gee; public

Re: [Vala] ellipsis forwarding

2010-04-16 Thread Luca Bruno
On Fri, Apr 16, 2010 at 02:27:24PM +0200, JM wrote: Hello Is there anybody who made has some experiences with ellipsis? I wrote the following code: void add_vals(string first_property_name, ...) { var l = va_list(); print(\n1:\t%s-%s\n\t%s-%s\n\n,first_property_name,

Re: [Vala] Binding a function that return a structure, not a pointer

2010-04-26 Thread Luca Bruno
On Mon, Apr 26, 2010 at 02:57:43PM -0700, Darren Warner wrote: I have a more complete, though surely less tested libexif.vapi if anyone is interested (vala-gen-introspect created a respectable .gi file even though libexif is not GObject-based). I'm happy to maintain these files until they

Re: [Vala] 16-bit properties, bug?

2010-04-29 Thread Luca Bruno
On Wed, Apr 28, 2010 at 10:35:17PM +0200, Rafael Monica wrote: Hi, I'm having a problem with 16-bit properties. I think it's a bug but since I'm new to Vala I'm not 100% sure. So I ask here. (Code compiles fine if I use uint32) You can't have gobject properties for those types because there's

Re: [Vala] gtkaml 0.2.10 released

2010-05-15 Thread Luca Bruno
On Sat, May 15, 2010 at 09:56:12PM +0300, Vlad Grecescu wrote: Gtkaml is an markup language that reuses the Vala compiler to write Gtk+ widgets through casual XML. HBox homogeneous=false Label label=_Hello with-mnemonic=true expand=false fill=false/ Entry g:public=my_entry

Re: [Vala] gtkaml 0.2.10 released

2010-05-15 Thread Luca Bruno
On Sun, May 16, 2010 at 12:09:53AM +0300, Vlad Grecescu wrote: This: is generated at compile time - and it has a univoque mapping with Vala code. (The new version I'm working on will generate directly Vala code nodes, not source files.) Plus, Gtkaml uses exactly the symbol names as found in

Re: [Vala] modify simpletype with methods in vapi

2010-05-30 Thread Luca Bruno
On Sun, May 30, 2010 at 03:10:47PM +0200, pancake wrote: Yep you are right. It takes no sense to have such a method in a simpletype. I would suggest that vala errors in this situation. To avoid create invalid and no-op methods. Ugh! this = null in a object instance scares me. This should

Re: [Vala] Incorrect type inference for application of generic types

2010-06-05 Thread Luca Bruno
On Fri, Jun 04, 2010 at 08:02:36PM +0200, Thomas Peikenkamp wrote: Is it a known bug that translation of the following program produces type warnings (during C compilation step) although the program is type correct? Vala does not support specialization, the problem is that the compiler gives

Re: [Vala] Detailed Signals

2010-06-07 Thread Luca Bruno
On Mon, Jun 07, 2010 at 09:55:36PM -0400, Michael Terry wrote: I notice that the release notes for 0.3.4 said support was added for detailed signals [1]. What's the syntax for it? Super-obvious attempts at using them didn't work. [1] You know, a signal like changed::foobar

Re: [Vala] Detailed Signals

2010-06-08 Thread Luca Bruno
On Tue, Jun 08, 2010 at 04:23:31AM -0400, Nate Stedman wrote: On this subject, is it possible to use a detailed name that is not a string literal? I would like to pass a function an object and a property to set the handler on, like this: obj.notify[prop].connect(notify); When compiling

Re: [Vala] Redundant C code

2010-06-08 Thread Luca Bruno
On Wed, Jun 09, 2010 at 12:27:31AM +0900, Kentaro NAKAZAWA wrote: Hello. (sorry, my English is not so good ;) When I convert the following code into C language. It is converted into a redundant following C code. I think enough by one. I think this can be avoided, would report a bug

Re: [Vala] Interface order

2010-06-10 Thread Luca Bruno
On Wed, Jun 09, 2010 at 10:21:06PM -0400, tecywiz121 wrote: (process:13513): GLib-GObject-WARNING **: cannot add interface type `int1' to type `TestClass' which does not conform to prerequisite `int2' I'm wondering if valac should generate an error when the interfaces are out of order. Yes

Re: [Vala] Abstract properties in Concrete Class

2010-06-10 Thread Luca Bruno
On Wed, Jun 09, 2010 at 10:25:37PM -0400, tecywiz121 wrote: Hello again, This is the second snippet I was curious about. Basically, valac should not allow the following code to compile since IMHO, its completely wrong. Just checking whether I should file a bug report or not.

Re: [Vala] How to abort sorting in Gee.ArrayList?

2010-07-06 Thread Luca Bruno
On Mon, Jul 05, 2010 at 11:17:59PM +0200, Didier 'Ptitjes' wrote: [Hum, guess that should go to the list too...] Hi Christer, Could you open a feature-request ticket in Gee bug-tracker for that ? Does it means there's a possibility to add a gio dependency to gee? Or creating a thread-safe

Re: [Vala] strings find

2010-07-06 Thread Luca Bruno
On Mon, Jul 05, 2010 at 10:05:28PM -0600, Mark wrote: I've noticed that there appears to be no 'find' method available within the string class. .str() (strstr in C) method returns a pointer to the position or null (s.str(something)-s gives you the integer position). although in C itself it

Re: [Vala] Error in GLib.EnumClass binding (Re: Display values of an enum.)

2010-07-11 Thread Luca Bruno
On Sun, Jul 11, 2010 at 07:03:16AM +, Peterpaul Klein Haneveld wrote: The warning can be safely ignored I believe (though it is a bug in valac -- it should know to emit correct cast). The error is caused by error in the bindings. The GLib.EnumClass.values member in gobject-2.0.vapi

Re: [Vala] Convert from byte to character offset in string

2010-07-14 Thread Luca Bruno
On Wed, Jul 14, 2010 at 12:00:58PM +0930, James Moschou wrote: Hello, Is there a convenient way to convert from a byte index in a string to its character offset and vice-versa? I know string has pointer_to_offset(string pos), but that's for pointers, I have the value of a byte index, i.e.

Re: [Vala] Convert from byte to character offset in string

2010-07-14 Thread Luca Bruno
On Wed, Jul 14, 2010 at 08:45:54PM +0930, James Moschou wrote: I'm sorry I don't see how this is what I want. My problem is that I am implementing a text view with a cursor that works in characters. However I use Pango to figure out where to draw the cursor, and Pango works in bytes, so I need

Re: [Vala] [ANNOUNCE] Vala 0.9.3 - Compiler for the GObject type system

2010-07-15 Thread Luca Bruno
On Wed, Jul 14, 2010 at 10:06:11PM -0500, Sandino Flores Moreno wrote: Congrats! But... what is a main block? A sort of implicit main(), for scripts you can do something like: print(test); And then run the program by vala yourprogram.vala. -- http://www.debian.org - The Universal

Re: [Vala] Compilation errors when inheriting from Object

2010-07-19 Thread Luca Bruno
On Mon, Jul 19, 2010 at 11:54:22PM +0200, Jan-Jaap van der Geer wrote: namespace TestNS { [CCode (cname = testtype, cheader_filename = test.h)] public struct TestType : uint { } } Try adding has_type_id = false to the CCode -- http://www.debian.org - The Universal Operating System

Re: [Vala] Compilation errors when inheriting from Object

2010-07-19 Thread Luca Bruno
On Mon, Jul 19, 2010 at 11:54:22PM +0200, Jan-Jaap van der Geer wrote: namespace TestNS { [CCode (cname = testtype, cheader_filename = test.h)] public struct TestType : uint { } } You might want to add [SimpleType] and [IntegerType], look at glib-2.0.vapi for binding integers. --

Re: [Vala] Blindings

2010-07-24 Thread Luca Bruno
On Sat, Jul 24, 2010 at 09:26:39PM +0200, Borja Varela Brea wrote: I compile the vala file with this comand with the console in the directory proyects: C:/vala-0.9.3/Proyectsvalac --vapidir=./Vapis --pkg=Operations test.vala There is no package named Operations unless you provide a

Re: [Vala] valac 64-bit compatibility issues?

2010-07-29 Thread Luca Bruno
On Thu, Jul 29, 2010 at 03:59:24PM -0700, Nigel Griffin wrote: Hi, I'm running on a 64-bit (Ubuntu 10.04) machine, and I get the following types of warning from valac: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 2 has type ‘guint64’ I'm guessing 'long

Re: [Vala] static member variable intialization

2010-07-30 Thread Luca Bruno
On Fri, Jul 30, 2010 at 11:08:06AM -0700, Nigel Griffin wrote: Hi, I have a vala class which contains only static methods. I need some corresponding static member variables (some of which are objects) initialized before any of the static member methods are invoked. Is this possible in

Re: [Vala] [ANNOUNCE] Vala 0.9.6 - Compiler for the GObject type system

2010-08-18 Thread Luca Bruno
On Wed, Aug 18, 2010 at 11:11:26PM +0200, JM wrote: Hello Thanks for reply! Is it really the solution to manually set LD_LIBRARY_PATH every time? This is not recommended from various sources (e.g. http://linuxmafia.com/faq/Admin/ld-lib-path.html) Also this wasn't necessary in the past. So

[Vala] Proposed Vala Logo

2010-08-30 Thread Luca Bruno
Hello, I'm no good in graphics. I thought about the colors (like gtk, gstreamer, fluendo, flumotion, ...) to be red/green/blue and finding a cool font (LMMathSymbols9). I ended up to this: http://tinyurl.com/353vbwy It's not perfect but I wanted to launch the idea. I've attached the inkscape svg

Re: [Vala] Proposed Vala Logo

2010-08-30 Thread Luca Bruno
On Mon, Aug 30, 2010 at 06:19:39PM +0100, Andrew wrote: Looks very nice! (is it just me or do I see a similarity with the Wordpress logo?) Huh, didn't think about it, I go tmostly inspired by the gtk colors. Could you try a version with a G (for Genie), then we could have two logos that are

Re: [Vala] Convert string to int

2010-09-08 Thread Luca Bruno
On Fri, Sep 03, 2010 at 12:12:19AM +0300, Chriss Kalogeropoulos wrote: Hi all, i just started to play with vala and i find it very interesting and promising project. How can i validate that the string conversion to int has actually happened ? It does not throw any exceptions and it seems

Re: [Vala] Vala compilation fails

2010-09-18 Thread Luca Bruno
On Fri, Sep 17, 2010 at 06:39:05PM -0700, Anatol Pomozov wrote: It seems that master is broken. I checked out 0.10 tag and now it compiles fine, although it fails on make check http://pastie.org/1166017 Expected if you don't have latest glib development installed. Tests target glib 2.26

Re: [Vala] [Genie] I can't create a new widget Gtk.Switch (from Gtk3) Vala 0.11.7

2011-03-16 Thread Luca Bruno
On Thu, Mar 17, 2011 at 01:11:45AM +0200, Dmitriy Kovalenko wrote: /home/dmitriy/source/valagenie/gtk3switch.c:93: error: ‘GtkSwitch’ undeclared (first use in this function) /home/dmitriy/source/valagenie/gtk3switch.c:93: error: (Each undeclared identifier is reported only once

Re: [Vala] probably silly question about vala objects

2011-03-18 Thread Luca Bruno
On Fri, Mar 18, 2011 at 10:23:00AM +0100, Luca Dionisi wrote: How can I store in an ArrayList objects of any type, including simple types? Suppose that at run-time I always know which type the next element really is. Is that possible? I am not an expert of C, but I think in C that would

Re: [Vala] Debugging

2011-03-23 Thread Luca Bruno
On Wed, Mar 23, 2011 at 09:22:07AM +0100, Guenther Wutz wrote: Hi all, i try to debug a Vala-program. Normally i use nemiver for this job. I compile my program with $ valac MaxteilSum.vala -g --save-temps $ nemiver MaxteilSum but nemiver (version 8.1) uses not the .vala file for

Re: [Vala] How to receive error message which vala's compiler output.

2011-03-24 Thread Luca Bruno
On Thu, Mar 24, 2011 at 11:01:24AM +0900, san hoi wrote: Sorry for sending next one more question to list. I try to receive error message which vala's compiler output. f=file(data.out, w) cmd = valac -v hello.vala p=subprocess.Popen(cmd, shell=True, stdout=f, stderr=subprocess.PIPE)

Re: [Vala] libmemcached bindings and release of vala-vapis-0.1

2011-03-28 Thread Luca Bruno
On Mon, Mar 28, 2011 at 02:25:41PM +0200, pancake wrote: This weekend I spend some time having fun with memcache.. and the fun end up writing the bindings for Vala. I have published a simple hello world using it at valaide.org http://code.valaide.org/content/libmemcached-example I

Re: [Vala] [newbie] Help editing PNG images with Vala?

2011-03-29 Thread Luca Bruno
On Tue, Mar 29, 2011 at 02:26:00PM -0400, Adam wrote: Hi! I've been trying to learn Vala, and I've assigned myself a few tasks to get started. I'm pretty fluent in C# (.NET), so Vala syntax hasn't been much of a problem. Currently, I'm trying to move beyond some of the basics, and write a

Re: [Vala] [PATCH] fix typo in x11.vapi

2011-03-30 Thread Luca Bruno
On Wed, Mar 30, 2011 at 05:52:55PM +0200, Alexander Kurtz wrote: Hi, This patch fixes a small typo in the X11 bindings of Vala 0.10.4: --- x11.vapi.orig 2011-03-14 13:56:11.087734497 +0100 +++ x11.vapi 2011-03-14 13:57:16.400729669 +0100 @@ -202,7 +202,7 @@ public int

Re: [Vala] [PATCH] add missing XStringToKeysym() function to x11.vapi

2011-03-30 Thread Luca Bruno
On Wed, Mar 30, 2011 at 09:32:27PM +0200, Alexander Kurtz wrote: Hi, This patch adds a missing function to the X11 bindings of Vala 0.10.4: --- x11.vapi.orig 2011-03-14 14:09:53.640728903 +0100 +++ x11.vapi 2011-03-14 14:14:03.956717821 +0100 @@ -135,6 +135,9 @@ [CCode

Re: [Vala] [PATCH] add missing XStringToKeysym() function to x11.vapi

2011-03-30 Thread Luca Bruno
On Wed, Mar 30, 2011 at 10:08:05PM +0200, Alexander Kurtz wrote: Am Mittwoch, den 30.03.2011, 21:43 +0200 schrieb Luca Bruno: I'd rather put that static function outside Display, what do you think? IMHO XStringToKeysym() is somewhat similar to XKeysymToKeycode() which (of course) is inside

Re: [Vala] [PATCH] add missing XStringToKeysym() function to x11.vapi

2011-03-31 Thread Luca Bruno
On Thu, Mar 31, 2011 at 02:57:21AM +0200, Alexander Kurtz wrote: I am almost finished with adding all XFooToBar() functions, but I think I found another bug: The current x11 bindings say: KeySym == uint KeyCode == int However, the header files say something else: $

Re: [Vala] how can I get the number of unicode points in a string?

2011-04-03 Thread Luca Bruno
On Sun, Apr 03, 2011 at 03:59:23PM +0800, 琉璃井 wrote: I see that since 0.11.0 vala string.length returns number of bytes rather than that of unicode characters, and string[i] returns only one byte. I wonder how to deal with east Asian character strings. There are other methods in string that

Re: [Vala] [PATCH] add missing XStringToKeysym() function to x11.vapi

2011-04-04 Thread Luca Bruno
On Fri, Apr 01, 2011 at 05:25:07PM +0200, Alexander Kurtz wrote: - public unowned uint[] get_keyboard_mapping (uint first_keycode, int keycode_count, ref int keysyms_per_keycode_return); + public unowned ulong* get_keyboard_mapping (uchar first_keycode, int

Re: [Vala] [PATCH] add missing XStringToKeysym() function to x11.vapi

2011-04-04 Thread Luca Bruno
Pushed thanks. commit 079ed99d7efb399d098b6f15e920cd9cd426fa9a Author: Alexander Kurtz kurtz.a...@googlemail.com Date: Mon Apr 4 20:22:20 2011 +0200 x11: Fix get_keyboard_mapping and keysym_to_keycode bindings -- www.debian.org - The Universal Operating System

Re: [Vala] [PATCH] add missing XStringToKeysym() function to x11.vapi

2011-04-04 Thread Luca Bruno
On Mon, Apr 04, 2011 at 09:15:06PM +0200, Alexander Kurtz wrote: Now on to the main task: The attached patch adds the XKeycodeToKeysym(), XStringToKeysym(), XKeysymToString and XConvertCase() functions. I've also written and attached a small test program. What do you think? Pushed thanks. --

Re: [Vala] Problem creating a Source subclass with closures

2011-04-05 Thread Luca Bruno
On Tue, Apr 05, 2011 at 08:11:30PM +, jmax wrote: I faced the same problem... the documentation says that lambda's method cannot use a local variable (see http://live.gnome.org/Vala/Manual/Methods#Lambdas) That page needs an update, current lambdas implementation support closures. --

Re: [Vala] Use of Gtk.Builder.connect_signals() on object instance

2011-04-10 Thread Luca Bruno
On Sun, Apr 10, 2011 at 01:02:32AM +0200, lubi...@gmail.com wrote: Hi, can anyone explain me how does the Gtk.Builder.connect_signals() method works? You can read in guide (http://live.gnome.org/Vala/GTKSample) that when we want to connect signals with method of instanced object then we

Re: [Vala] LibSoup set_response with binary data?

2011-04-13 Thread Luca Bruno
On Wed, Apr 13, 2011 at 08:56:15AM -0700, Joseph Montanez wrote: var loaded = file.load_contents (null, out response_text, out length, out etag); Obviously the bindings for this method are broken. Feel free to report a bug. msgbody.append(Soup.MemoryUse.TEMPORARY, response_text.data); Try:

Re: [Vala] Vala posix profile

2011-04-17 Thread Luca Bruno
On Sun, Apr 17, 2011 at 01:20:48PM +0200, pancake wrote: I just did a little test using cairo with the posix profile of Vala. You can read the code at code.valaide.org The first issue I get is that stdio.h is not included until you use a function like print() which is a bit annoying

Re: [Vala] invocation not supported in this context

2011-04-21 Thread Luca Bruno
On Thu, Apr 21, 2011 at 03:12:23PM +0800, Nor Jaidi Tuah wrote: When using debug in vala, I got this error: invocation not supported in this context It hasn't happened before, and I can't figure out what I did differently to cause this message. I am still using the same version of vala,

Re: [Vala] Support for custom attribute introspection/reflection?

2011-04-24 Thread Luca Bruno
On Sun, Apr 24, 2011 at 06:48:39PM +0100, Ricardo Gladwell wrote: Hi Everyone Is there anyway to find out if a class is annotated with an attribute, and retrieve values from these attributes? The only way is using libvala to parse your own code. If not, are there any plans to provide

Re: [Vala] Support for custom attribute introspection/reflection?

2011-04-24 Thread Luca Bruno
On Sun, Apr 24, 2011 at 02:11:43PM -0400, Jonathan Ryan wrote: You can also do it using GObject-Introspection by parsing Girs. I wrote a small python script to do it if you would like to see it. What's the relationship of this with Vala attributes and possibly non-libraries? --

Re: [Vala] how to register new glib type without creating an instance?

2011-04-25 Thread Luca Bruno
On Mon, Apr 25, 2011 at 02:43:14PM +0800, Nor Jaidi Tuah wrote: When I tried this: /*1*/ Object.new (Type.from_name (SomeClassName)) I got this runtime error: **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed unless, somewhere before that, I have this: /*2*/ new

Re: [Vala] Oddity when using generics with boxed values

2011-04-25 Thread Luca Bruno
On Mon, Apr 25, 2011 at 11:02:42AM +0100, David Given wrote: Vala's completely happy with this, but when I try to compile it I get the C error: error: ‘TYPE_ATOM’ undeclared (first use in this function) Does this patch work for you? diff --git a/vapi/x11.vapi b/vapi/x11.vapi index

Re: [Vala] Custom array free functions

2011-04-26 Thread Luca Bruno
On Tue, Apr 26, 2011 at 12:54:13AM +0100, David Given wrote: Unfortunately this means that when Vala's finished with the array it will then try to free it with g_free(), which won't work (XFree() and g_free() may use different heaps). Is there any way to tell Vala that it should use a specific

Re: [Vala] Custom array free functions

2011-04-26 Thread Luca Bruno
On Tue, Apr 26, 2011 at 11:49:56AM +0200, Maciej Marcin Piechotka wrote: IMHO it doesn't matter that code does not crash. Consider such code in 90's: If you want to shoot yourself by ignoring that XFree() is equivalent to free() feel free to: 1) Copy the x11.vapi on your own 2) Use pointers

Re: [Vala] Custom array free functions

2011-04-26 Thread Luca Bruno
On Tue, Apr 26, 2011 at 02:58:23AM -0700, Jon Rosebaugh wrote: Surely this is a violation of encapsulation? If a library provides some structure in memory and says to free it with function foo(), then even if foo() is the same thing as free() RIGHT NOW, that doesn't mean it's a good idea to

Re: [Vala] Custom array free functions

2011-04-26 Thread Luca Bruno
On Tue, Apr 26, 2011 at 04:07:44PM +0100, David Given wrote: I'd still like to know whether Vala has any language support to help me with this. For example, whether I can tag an array type with the function to use for freeing it. There are lots of libraries that use this kind of idiom and it

Re: [Vala] Vapi delegate problems.

2011-04-27 Thread Luca Bruno
On Tue, Apr 26, 2011 at 03:50:39PM -0600, Lewis Gunsch wrote: Hi, I am having trouble getting a delegate in a vapi to work correctly. My original attempt (line 70 of the vapi) did not work because of how the typedef is in the C header (it's not a function pointer), so instead of using their

Re: [Vala] Unowned references to structures

2011-04-27 Thread Luca Bruno
On Wed, Apr 27, 2011 at 11:03:05PM +0100, David Given wrote: After a bit of thought I can see why this happens, as structures are strictly pass-by-reference, but it nevertheless came as a surprise. Given that the two cases look very similar but have decidedly different semantics, is there any

Re: [Vala] Calling cogl_path_new from vala

2011-04-28 Thread Luca Bruno
On Thu, Apr 28, 2011 at 02:59:39PM +0400, Pavel Stupnikov wrote: Hi! What is the right way to call cogl_path_new from vala? As I understand, currently is binded to Cogl.Path.Path(), but cogl_path_new is not a constructor for CoglPath, its return type is void. And so, if I try to write

Re: [Vala] The state of closures

2011-04-28 Thread Luca Bruno
On Thu, Apr 28, 2011 at 04:38:43PM +0100, Sam Liddicott wrote: On 28/04/11 16:08, Luca Bruno wrote: On Thu, Apr 28, 2011 at 03:58:32PM +0100, Sam Liddicott wrote: This feature may be less useful for vala if it does stack-tear-down for interruptable functions, but perhaps more suited

Re: [Vala] The state of closures

2011-04-28 Thread Luca Bruno
On Thu, Apr 28, 2011 at 05:19:22PM +0100, Sam Liddicott wrote: yes.. it's been a few years since I piped up. Part of the problem is (or was) with interruptable functions which tear-down the stack and thus invalidate the closure for interruptable functions. Another is that last time I

Re: [Vala] [PATCH]: Vte vapi: Vte.Terminal.fork_command_full some arguments can be nullable

2011-04-29 Thread Luca Bruno
On Fri, Apr 29, 2011 at 10:35:33PM +0200, Jacques-Pascal Deplaix wrote: Hello everybody, Vte in version = 0.26 had the function Vte.Terminal.fork_command_full. But in the vte vapi file, this function had some arguments non-nullable and some other arguments nullable. That should be the

Re: [Vala] Copy function produces segmentation fault

2011-05-18 Thread Luca Bruno
On Tue, May 17, 2011 at 01:55:57PM -0600, Lewis Gunsch wrote: Hi, I have been writing a Vapi for the ZeroMQ library: http://www.zeromq.org/. I would eventually like it to be distributed with Vala itself, and would propose myself as the maintainer. See the vapi here:

Re: [Vala] pulseaudio example

2011-05-22 Thread Luca Bruno
On Sun, May 22, 2011 at 10:53:07PM +0200, august wrote: I thought this might be useful for others. PulseAudio comes with vapi bindings, but without any examples. Here is a simple example that uses their callback api to generate and play a sine wave. http://pastebin.com/h92TT5hD

Re: [Vala] Documentation hiccups

2011-05-25 Thread Luca Bruno
On Wed, May 25, 2011 at 08:05:33PM +, Carl wrote: Hello everybody, I play with Vala on Windows since a month, and so far I love it. I came from a .Net/Java/Delphi background, so it is easy to understand why I'm so pumped by a modern, cross platform, native language. So, first of

Re: [Vala] Documentation hiccups

2011-05-25 Thread Luca Bruno
On Wed, May 25, 2011 at 11:52:50PM +0200, Carl Perfect wrote: The issue with the redundant planning/roadmap/feature page is not a minor edit :) Do you have an opinion about that ? Redundancy in documentation is not bad and it's not an issue for now. -- http://www.debian.org - The Universal

Re: [Vala] Invocation handling?

2011-05-27 Thread Luca Bruno
On Fri, May 27, 2011 at 04:01:49PM +0200, Thomas Amland wrote: But with classes you can? Including abstracts? No. -- http://www.debian.org - The Universal Operating System ___ vala-list mailing list vala-list@gnome.org

Re: [Vala] warning: copying delegates is discouraged

2011-06-09 Thread Luca Bruno
On Wed, Jun 08, 2011 at 03:20:58PM -0700, Jim Nelson wrote: Running valac from master, I'm seeing this warning pop up a lot: warning: copying delegates is discouraged Can someone explain the rationale for this? (I'm guessing it has to do with references.) Are there any blessed

Re: [Vala] is there a valgrind-like tool specific to Vala ?

2011-06-11 Thread Luca Bruno
On Sat, Jun 11, 2011 at 05:45:24PM +0200, Serge Hulne wrote: valgrind --leak-check=full --show-reachable=yes ./vwc ../../shakespeare.txt http://live.gnome.org/Valgrind -- http://www.debian.org - The Universal Operating System ___ vala-list mailing

Re: [Vala] Reading/writing a specific amount of bytes

2011-06-14 Thread Luca Bruno
On Mon, Jun 13, 2011 at 09:04:14PM +0200, Christoph Mende wrote: Hi, I'm trying to read from an FileInputStream or write to an DataOutputStream only a specific amount of bytes (4096 in this case), both streams contain binary data. I can't find a way to do this though, OutputStream.write()

Re: [Vala] anonymous structs or something similar?

2011-06-14 Thread Luca Bruno
On Tue, Jun 14, 2011 at 05:14:53PM +0200, Jan Spurný wrote: Is this or something close to this possible somehow in vala? public struct TableItem { public string name; public intdata; } void main () { const TableItem items[] = { {foo, 1}, {bar, 2}

Re: [Vala] possible bug in nullable enum

2011-06-16 Thread Luca Bruno
On Thu, Jun 16, 2011 at 05:42:23PM +0200, Jan Spurný wrote: Is this a bug or am I doing something wrong? Yes it's a bug. -- http://www.debian.org - The Universal Operating System ___ vala-list mailing list vala-list@gnome.org

Re: [Vala] anonymous structs or something similar?

2011-06-18 Thread Luca Bruno
On Sat, Jun 18, 2011 at 11:30:49AM +0200, pancake wrote: This is not anonymous. There's nothing like that in vala. -- http://www.debian.org - The Universal Operating System ___ vala-list mailing list vala-list@gnome.org

Re: [Vala] lexical analysis using libvala

2011-06-18 Thread Luca Bruno
On Sat, Jun 18, 2011 at 05:22:25PM +0400, Maga Abdurakhmanov wrote: Sure I'm looked at the Valadoc (which uses libvala already) and there is AST parser inside vala, which is libvala :) AST doesn't include comments, they are removed as useless for compilation i guess. Also I'm looked into the

Re: [Vala] Adding support for C++

2011-06-19 Thread Luca Bruno
Adding c++ and objc support would be helpful in some cases to interact with third-party libraries (say for example xapian) that have no C API. The difference with maja (a vala to javascript compiler) is that while maja is only a few lines of code and it's implemented from scratch, it wouldn't be

Re: [Vala] Is this the right syntax for defining pointers in Vala ?

2011-06-20 Thread Luca Bruno
On Mon, Jun 20, 2011 at 08:38:29PM +0200, Serge Hulne wrote: Is this the right syntax for defining pointers in Vala ? //-- using Posix; void main (string[] argv) { string a = hello; var b = a; strcpy(*b, bye); Posix.stdout.printf(a = %s\n, a);

Re: [Vala] async method and delegate

2011-06-21 Thread Luca Bruno
On Tue, Jun 21, 2011 at 11:09:47AM -0700, Jim Nelson wrote: On Mon, Jun 20, 2011 at 6:27 PM, Nor Jaidi Tuah norjaidi.t...@ubd.edu.bnwrote: On Mon, 2011-06-20 at 17:37 -0700, Jim Nelson wrote: With async, the delegate *is* copied, you just don't see it in the Vala code. With an async

Re: [Vala] [Patch] Add gtksourceview-3.0

2011-06-22 Thread Luca Bruno
Hi, thanks for the patch. Anyway, you should file a bug with the patch, and the preferred way of binding libraries now is using GIR not the Vala GI. Here is a patch to add gtksourceview-3.0 to Vala : http://ubuntuone.com/p/10cn/ -- www.debian.org - The Universal Operating System

Re: [Vala] GMP vapi

2011-06-23 Thread Luca Bruno
On Fri, Jun 24, 2011 at 01:39:29AM +0300, Jeremiah Shaulov wrote: Hello I didn't find GMP vapi anywhere. If i implement it partially (100% mpz, 100% mpf, and a few of other stuff) does anybody interested in my implementation? And how could i share my work?

Re: [Vala] Problems retrieving binary data from a sqlite3 database BLOB column

2011-06-27 Thread Luca Bruno
Use unowned arrays to avoid copies: unowned uint8[] data = (uint8[]) stmt.column_blob(4); data.length = whatever... var copied_data = data; // now you can copy the data We could use unowned uint8[] in the vapi anyway. Also, we should report an error when trying to copy an array with no known

Re: [Vala] Problems retrieving binary data from a sqlite3 database BLOB column

2011-06-27 Thread Luca Bruno
On Mon, Jun 27, 2011 at 10:17 AM, Iñigo Serna inigose...@gmail.com wrote: So we need to set the data variable length before using the returned data, and the only way to use the returned data without copying is marking it as unowned. Is this correct? Yes, in this case. -- www.debian.org -

Re: [Vala] Gee.Collection Help

2011-07-04 Thread Luca Bruno
On Mon, Jul 04, 2011 at 11:19:43PM +0900, Peter Cartwright wrote: Hi Vala developers, I am having one issue trying to base a class off of the Gee.Collection interface... class TestG : Object, IterableG, CollectionG { .. public CollectionG read_only_view { owned get { return

Re: [Vala] VAPI metadata problem

2011-07-05 Thread Luca Bruno
On Mon, Jul 04, 2011 at 08:16:28PM -0700, Jim Nelson wrote: Hello, I'm attempting to build a VAPI for GMime. (If anyone can point me to a completed version, it would be appreciated!) The problem I'm running into is this: The namespace for the module is GMime. The class GMimeStream's

Re: [Vala] Binding issues

2011-07-05 Thread Luca Bruno
On Mon, Jul 04, 2011 at 11:00:46PM +0200, Matthias Klumpp wrote: On Mon, 04 Jul 2011 22:45:59 +0200, Giulio Paci giuliop...@interfree.it wrote: Hi to all! Today I was experimenting with libarchive bindings and I found that archive_read_support_format_raw() was not available in the

Re: [Vala] Support for coroutines in Vala

2011-07-06 Thread Luca Bruno
On Wed, Jul 06, 2011 at 03:42:09AM +0200, Serge Hulne wrote: Support for coroutines in Vala: http://live.gnome.org/Vala/Tutorial#Asynchronous_Methods -- http://www.debian.org - The Universal Operating System ___ vala-list mailing list

Re: [Vala] Why the temporary variables in the C code are usefull ?

2011-07-07 Thread Luca Bruno
On Thu, Jul 07, 2011 at 12:09:16PM -0500, Jim Peters wrote: Jacques-Pascal Deplaix wrote: What are the side effects corrected by the temporary variables ? Unwanted side effects can happen if you evaluate an expression more than once, e.g. if you substituted the full expression for every

Re: [Vala] Question about a basic coroutine example

2011-07-07 Thread Luca Bruno
On Thu, Jul 07, 2011 at 09:35:41PM +0200, Serge Hulne wrote: In the snippet hereunder, I expected the respective value of the argument of the sleep() method, in the methods foo0() and foo1(), to have an influence on which one of said coroutines completes first. Apparently it is not the

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-08 Thread Luca Bruno
On Fri, Jul 08, 2011 at 05:49:32PM +0200, Serge Hulne wrote: It‘s a generator using a coroutine (at least using “yield“). The yield keyword itself doesn't mean coroutine. It's just a generator not a coroutine because you don't cooperate with any other routine. The yield statement is only used

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-09 Thread Luca Bruno
On Sat, Jul 09, 2011 at 08:04:38AM +0800, Nor Jaidi Tuah wrote: The yield statement is only used when defining a generator function, and is only used in the body of the generator function. Using a yield statement in a function definition is sufficient to cause that definition to create a

Re: [Vala] Is there a way to use the Vala coroutines to achieve the same effect as in the following Python snippet (coroutines returning partial results in an iterator-like way) ?

2011-07-09 Thread Luca Bruno
On Sat, Jul 09, 2011 at 11:22:41AM +0200, Serge Hulne wrote: Brilliant, Thank you very much indeed, Luca ! Please note that my note was merely an acknowledgement that, as a Vala newbie, I tried successively two naive implementations, knew enough to suspect intuitively one could push it a

Re: [Vala] Passing Ownership Help

2011-07-09 Thread Luca Bruno
On Sun, Jul 10, 2011 at 02:36:23AM +0900, Peter Cartwright wrote: Hi guys, I am trying to understand how a function can take ownership of an object passed into it. According to documentation it should be like below: MyList.add (owned Person p) { _first = (owned) p; } Person p = new

Re: [Vala] My first (very positive) impressions of Vala

2011-07-11 Thread Luca Bruno
On Mon, Jul 11, 2011 at 08:09:15AM +0200, Serge Hulne wrote: 1. More examples (I intend to contribute actively to that aspect). The wiki is open fore contributions. 2. Provide a way to generate the documentation locally (like Javadoc or Pydoc or godoc). - Valadoc does not seem

Re: [Vala] How to view Valadoc in Devhelp

2011-07-11 Thread Luca Bruno
On Mon, Jul 11, 2011 at 08:22:50AM +0800, linmx0130 wrote: Hi all, I hope to view valadoc in devhelp.What should I do? Sorry for my impoliteness last time. Thanks everyone who will answer me. Valadoc in general can generate devhelp files using the devhelp doclet, but you have to generate the

Re: [Vala] Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-12 Thread Luca Bruno
On Tue, Jul 12, 2011 at 07:43:14AM -0500, Jim Peters wrote: Serge Hulne wrote: Here is a further development of the idea of Luca Bruno about a Vala implementation for Generators: Simulating Go's goroutines and channels in Vala: Basically the idea is to start as many threads

Re: [Vala] Further speculations on couroutines, generators and threads : Emulating Go's goroutines and channels in Vala

2011-07-12 Thread Luca Bruno
On Tue, Jul 12, 2011 at 12:04:13PM -0500, Jim Peters wrote: Luca Bruno wrote: Threads are very heavy compared to an optimised implementation of 'goroutines' or whatever. Certainly you can emulate them but it's not going to be an efficient way of implementing algorithms unless someone

Re: [Vala] Weird error handling

2011-07-13 Thread Luca Bruno
On Wed, Jul 13, 2011 at 12:13:41PM +0200, Tomasz Jankowski wrote: Hello! While working on project I discovered invalid (in my opinion) error handling. I wrote simple program (code below), which demonstrate, that catch clause in some_function() catch errors threw from this function. On the

Re: [Vala] Function to sort a list of strings?

2011-07-14 Thread Luca Bruno
On Thu, Jul 14, 2011 at 03:30:36PM +0200, Christian Siefkes wrote: Hi all, I use the following, straightforward code to sort a Liststring: dupl_keys.sort(strcmp); That works fine, but when I invoke valac (v0.13.1 or 0.12) to compile the program, I get a warning: warning:

  1   2   3   4   5   >