Re: [Vala] "as" word

2011-03-18 Thread Anatol Pomozov
Hi 2011/3/18 Pavol Klačanský : > var window = builder.get_object("window") as Gtk.Window; Dynamic type casting http://live.gnome.org/Vala/Tutorial#Dynamic_Type_Casting ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinf

Re: [Vala] Vala broken on non-gnu systems

2011-03-16 Thread Anatol Pomozov
Hi On Wed, Mar 16, 2011 at 1:37 AM, Alexander Kojevnikov wrote: > On 16 March 2011 16:33, Anatol Pomozov wrote: >> But now tests are broken because of other error: >> >> make  check-TESTS >> TEST: Building...                                            

Re: [Vala] Vala broken on non-gnu systems

2011-03-16 Thread Anatol Pomozov
Hi On Tue, Mar 15, 2011 at 11:43 PM, Alexander Kojevnikov wrote: > On 16 March 2011 13:49, Anatol Pomozov wrote: >> On Tue, Mar 15, 2011 at 10:46 PM, Alexander Kojevnikov >> wrote: >>> On 16 March 2011 12:07, Anatol Pomozov wrote: >>>> While you

Re: [Vala] Vala broken on non-gnu systems

2011-03-15 Thread Anatol Pomozov
Hi On Tue, Mar 15, 2011 at 10:46 PM, Alexander Kojevnikov wrote: > On 16 March 2011 12:07, Anatol Pomozov wrote: >> While you are here you might want to fix tests/testrunner.sh that also >> uses GNU extension (xargs -r). See line 167. > > Which Unix are you using? macos

Re: [Vala] Vala broken on non-gnu systems

2011-03-15 Thread Anatol Pomozov
Hi On Tue, Mar 15, 2011 at 12:05 PM, pancake wrote: > The commit a2s2120.. dated at 2011-02-10 adds the use of strnlen function in > glib-2.0.vapi. > > This function is a gnu extension on libc. This is not glib and this function > is only available in GNU LibC. Do the build breaks on OSX, Windo

Re: [Vala] Vala HEAD is broken on MacOSX

2011-03-15 Thread Anatol Pomozov
nition of strnlen into the system's >> string.h include file. This is just a hack.. >> >> Any idea? Any program compiled against glib-2.0.vapi will suffer the same >> issue. >> >> On 15/03/2011, at 20:57, Anatol Pomozov wrote: >> >>> Hi, >>

[Vala] Vala HEAD is broken on MacOSX

2011-03-15 Thread Anatol Pomozov
Hi, I just tried to compile HEAD from git and it is broken on MacOSX. Here is the error: CCLD libvala-0.12.la Undefined symbols: "_strnlen", referenced from: _string_substring in valaccodebasemodule.o _string_substring in valaccodemethodmodule.o _string_substring in valad

Re: [Vala] functions and null

2011-01-19 Thread Anatol Pomozov
2011/1/19 Pavol Klačanský : > Hi, why this code doesn't work > Here the item is null > Item item = null; > > parse_content(item); > And in this function you declared parameter as non-null > parse_content(Item item) { >        stderr.printf("argh"); > } > > reports > ** (process:674): CRITICAL **: x

Re: [Vala] vala code generation too constrained?

2011-01-11 Thread Anatol Pomozov
On Tue, Jan 11, 2011 at 11:42 AM, Jim Nelson wrote: > I'll jump in here. > > The original poster is asking that Vala relax some of its restrictions that > are in place due to its relationship with C.  The only restriction that's > been named so far (unless I missed something) is overloaded method

[Vala] Different flags for vapi generation

2011-01-10 Thread Anatol Pomozov
Hi, I see several different flags for 'valac' that look similar --library --fast-vapi --vapi --internal-vapi/internal-header All of these flags generate *.vapi file for sources. Can anyone explain what is difference between these flags? PS Ideally this information should be added to the valac m

Re: [Vala] Are nested interfaces disallowed?

2011-01-07 Thread Anatol Pomozov
void main() { var cl = new AClass.BClass(); cl.print(); } On Tue, Dec 28, 2010 at 4:42 PM, Anatol Pomozov wrote: > Hi, > > I have a class and I want to add a nested interface into it. > > public class AClass : Object { >  public interface BClass : Object { public void foo(

Re: [Vala] Any xUnit framework for Vala?

2011-01-04 Thread Anatol Pomozov
> Correct, something like this. GroovyTestCase itself is based on jUnit > (de-facto standard unit framework in java world). > > There is a test framework in Glib already > http://library.gnome.org/devel/glib/unstable/glib-Testing.html and IMO > the best of all is to adopt it for Vala. There are at

Re: [Vala] Any xUnit framework for Vala?

2011-01-04 Thread Anatol Pomozov
Oops, it seems that there are a few messages were out of the maillist. Let me copy it here. Hi On Mon, Dec 27, 2010 at 7:58 PM, b4283 wrote: > Doesn't Vala already has assertion clauses ? Assertions (and contract programming) is not the same as unit testing, although they both serve the same thi

Re: [Vala] string <-> bytes conversion in Vala

2010-12-29 Thread Anatol Pomozov
On Wed, Dec 29, 2010 at 3:51 PM, Anatol Pomozov wrote: > Hi > > On Thu, Dec 23, 2010 at 12:37 AM, Anatol Pomozov > wrote: >> Hi, >> >> I manipulate with strings in my application such as storing/reading >> to/from binary files. And I need to convert a strin

Re: [Vala] string <-> bytes conversion in Vala

2010-12-29 Thread Anatol Pomozov
Hi On Thu, Dec 23, 2010 at 12:37 AM, Anatol Pomozov wrote: > Hi, > > I manipulate with strings in my application such as storing/reading > to/from binary files. And I need to convert a string to/from array of > bytes. What is the best way of doing it in Vala? > > Looking i

[Vala] Are nested interfaces disallowed?

2010-12-28 Thread Anatol Pomozov
Hi, I have a class and I want to add a nested interface into it. public class AClass : Object { public interface BClass : Object { public void foo() { } } } Valac 0.10.0 fails with following error: a.vala:2.2-2.33: error: unexpected declaration in class public interface BClass : Objec

Re: [Vala] Name clashes in generated C code

2010-12-28 Thread Anatol Pomozov
On Tue, Dec 28, 2010 at 6:29 AM, Jan Hudec wrote: > On Mon, Dec 27, 2010 at 13:46:47 -0800, Anatol Pomozov wrote: >> Hi, >> >> I have a simple Vala program >> >> public struct Struct { string name; } >> public enum Type { STRUCT } >> >> [...]

[Vala] Any xUnit framework for Vala?

2010-12-27 Thread Anatol Pomozov
Hi, I am trying to add some tests to my application and I am looking for an example of Vala application with tests. As an Java developer I would expect that Vala has some xUnit like framework http://en.wikipedia.org/wiki/XUnit but seems there is nothing like this. There is also Glib Testing frame

[Vala] Name clashes in generated C code

2010-12-27 Thread Anatol Pomozov
Hi, I have a simple Vala program public struct Struct { string name; } public enum Type { STRUCT } It looks fine, but if you try to compile it fails with following error: $ CC=clang valac a.vala /usr/local/google/home/anatol/sources/learning/vala/a.vala.c:22:2

[Vala] string <-> bytes conversion in Vala

2010-12-23 Thread Anatol Pomozov
Hi, I manipulate with strings in my application such as storing/reading to/from binary files. And I need to convert a string to/from array of bytes. What is the best way of doing it in Vala? Looking into string class http://valadoc.org/glib-2.0/string.html I see a method called string#to_utf8() t

Re: [Vala] Complex number support?

2010-12-13 Thread Anatol Pomozov
Hi 2010/12/13 pancake : > On 12/13/10 19:30, Aleksander Wabik wrote: >>> >>> -1 portability is VERY important if we want to use vala outside >>> gnu/linux. >> >> I understand your point of view (the whole idea of sticking to >> glib as a layer between vala and everything else is good). I'd then >>

Re: [Vala] Array.length

2010-12-06 Thread Anatol Pomozov
Hi 2010/12/6 Aleksander Wabik : > Seems like https://bugzilla.gnome.org/show_bug.cgi?id=585847 , but it > is claimed to be fixed. Maybe some corner case? Or regression. I see that commit 5226feafef5 that fixes the given issue does not have any unit tests. > best regards, > >>It seems you found a

Re: [Vala] Cannot have field and method with the same name

2010-12-04 Thread Anatol Pomozov
On Fri, Dec 3, 2010 at 5:08 PM, Evan Nemerson wrote: > On Fri, 2010-12-03 at 15:38 -0800, Anatol Pomozov wrote: >> Hi, >> >> I have a class that contains a field and method with the same name, >> and Valac does not like it. What is the reason? Other languages >>

Re: [Vala] Cannot have field and method with the same name

2010-12-04 Thread Anatol Pomozov
2010/12/3 Aleksander Wabik : >>I have a class that contains a field and method with the same name, >>and Valac does not like it. > > Generally Vala does not have any usable symbol mangling engine. It's > good, because Vala generates a C api and you obviously don't want to > have obfuscated symbols

[Vala] Cannot have field and method with the same name

2010-12-03 Thread Anatol Pomozov
Hi, I have a class that contains a field and method with the same name, and Valac does not like it. What is the reason? Other languages (C#/Java) allow it. You have to use () for method so you know whether you access method or field. public class Foo { public boolean stop = true; public bool

[Vala] gobject-introspect vs gir

2010-11-16 Thread Anatol Pomozov
Hi, I am trying to understand write-vala-bindings fu and I would like to clarify a couple of questions related to gen-introspect tool. There is almost no information in wiki about it. http://live.gnome.org/Vala/Bindings page recommends 2-step vapi generation 1) Generate *.gi file using gen-intr

Re: [Vala] Define constant at compile time

2010-11-16 Thread Anatol Pomozov
On Tue, Nov 16, 2010 at 11:44 AM, Jan Hudec wrote: > On Tue, Nov 16, 2010 at 18:51:12 +0100, Günther Wutz wrote: >> It is possible to use cpp as Preprocessor. I'm working on a >> wrapper-program to combine cpp and give it valac to compile. The easiest >> way i found actually. > > Sorry. That's an

Re: [Vala] vala-gen-introspect does not add my struct to *.gi file

2010-11-02 Thread Anatol Pomozov
On Tue, Nov 2, 2010 at 5:59 AM, Abderrahim Kitouni wrote: > Hello, >                  في ن، 01-11-2010 عند 14:42 -0700 ، كتب Anatol Pomozov: >> Hi, >> >> I have a smaller repo case. On my Ubuntu 10.04 I run >> >> /usr/local/lib/vala-0.10/gen-introspect-0.1

Re: [Vala] vala-gen-introspect does not add my struct to *.gi file

2010-11-01 Thread Anatol Pomozov
really new to gtk OO style so I don't understand what is going on here. On Fri, Oct 29, 2010 at 6:10 PM, Anatol Pomozov wrote: > Hi, everyone. I have a question related to vala-gen-introspect tool. > > I am trying to add a Vala support for Apache Thrift > http://incubator.apache.or

[Vala] vala-gen-introspect does not add my struct to *.gi file

2010-10-29 Thread Anatol Pomozov
Hi, everyone. I have a question related to vala-gen-introspect tool. I am trying to add a Vala support for Apache Thrift http://incubator.apache.org/thrift/ https://issues.apache.org/jira/browse/THRIFT-764 Instead of writing a library I want to reuse glib based c based library for Thrift http://g

Re: [Vala] GNU extensions :P

2010-10-28 Thread Anatol Pomozov
Hi On Thu, Oct 28, 2010 at 6:50 AM, CaStarCo wrote: > Hello , i have a question about Vala.. :p > > It's needed the gcc compiler? No, gcc is not a requirement. Vala generates very accurate standard-complaint C code. Any decent compiler is fine. Actually I prefer to use clang (c frontend for llvm

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

2010-10-26 Thread Anatol Pomozov
Hi, Jurg. Thanks for the release. One thing that confuses me is versioning policy for Vala. 0.11 version has been release recently, now you release 0.10. Also git repository as well as some developers mention 0.12 version. What is these versions for, what are the difference between them? Is there

Re: [Vala] Vala tutorial translation into Russian.

2010-10-05 Thread Anatol Pomozov
Hi, Bulat. On Tue, Oct 5, 2010 at 9:17 AM, Bulat Shafigullin wrote: > Hello everybody! > > My name is bulat. I'm very proud to announce that small group of > enthusiasts is just finishing translation of > Vala tutorial into Russian. All work is held at > http://translated.by/you/vala-tutorial/int

Re: [Vala] "Asynchronous Stream Reading" example does not work

2010-09-19 Thread Anatol Pomozov
On Sun, Sep 19, 2010 at 7:43 AM, JM wrote: > It works for me on vala-0.10.0 . Did you try it with a textfile as arg? > Jörn > > >> Hi, >> I have MacOSX 10.6, vala 0.10, libgee 0.5.3, glib 2.25.17. I run >> examples from this page http://live.gnome.org/Vala/GIOSamples and all >> of them work fine e

[Vala] "Asynchronous Stream Reading" example does not work

2010-09-19 Thread Anatol Pomozov
Hi, I have MacOSX 10.6, vala 0.10, libgee 0.5.3, glib 2.25.17. I run examples from this page http://live.gnome.org/Vala/GIOSamples and all of them work fine except "Asynchronous Stream Reading" one. I build it with "valac --pkg gio-2.0 example.vala" and then run as ./example I have following failu

[Vala] Compiling vala 0.10 on macosx

2010-09-18 Thread Anatol Pomozov
Hi, I am trying to compile vala-0.10 on mac 10.6 (snow leopard). valac itself compiles and seems work fine, but 'make test' is failing: 1) One of the failures is "xargs no such argument -r" comes from tests/testrunner.sh line if $VALAC $VALAFLAGS -o test$EXEEXT $(echo $PACKAGES | xargs -n 1 -r e

Re: [Vala] Vala compilation fails

2010-09-18 Thread Anatol Pomozov
Hi On Fri, Sep 17, 2010 at 11:37 PM, Luca Bruno wrote: > 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

[Vala] [PATCH] Use valac instead of vala as a compiler

2010-09-18 Thread Anatol Pomozov
If we leave vala it produces following error: $ ./autogen.sh --prefix=/opt/vala No source file specified. **Error**: You must have valac >= 0.7.0 installed to build vala. Download the appropriate package from your distribution or get the source tarball at http://download.gnome.org/sources/va

Re: [Vala] Vala compilation fails

2010-09-17 Thread Anatol Pomozov
Hi On Fri, Sep 17, 2010 at 6:01 PM, Anatol Pomozov wrote: > Hi, > > I just started learning Vala. I cloned vala repo from git:// > git.gnome.org/vala and run ./autogem.sh (See log here > http://pastie.org/1165976). > > Everything looks fine, but when I run mak

[Vala] Vala compilation fails

2010-09-17 Thread Anatol Pomozov
Hi, I just started learning Vala. I cloned vala repo from git:// git.gnome.org/vala and run ./autogem.sh (See log here http://pastie.org/1165976). Everything looks fine, but when I run make - compilation fails anatol:vala $ make make all-recursive make[1]: Entering directory `/usr/local/google